Jul 14, 2011, 2:06 PM
Issue with ext:button postback vs ASP.Button postback and CkEditor
Hi,
I am trying to use the CKEditor in an application I am building and have run into a problem which I am sure is easy to solve but I am not sure where or how.
I have web page which has a popup window inside of which sits the ckeditor, when I click a button on the page I want the window to open set the text in the editor to some text from a database to allow the user to then edit this.
If the button I use is an ASP.net button this all works fine, however if it is an ext.net button the window opens shows the grid but no text is displayed.
I have created a very simple app to reproduce this below:
I am trying to use the CKEditor in an application I am building and have run into a problem which I am sure is easy to solve but I am not sure where or how.
I have web page which has a popup window inside of which sits the ckeditor, when I click a button on the page I want the window to open set the text in the editor to some text from a database to allow the user to then edit this.
If the button I use is an ASP.net button this all works fine, however if it is an ext.net button the window opens shows the grid but no text is displayed.
I have created a very simple app to reproduce this below:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="test.WebForm1" validateRequest="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager runat="server" ID="rm1"></ext:ResourceManager>
<div>
<asp:Panel runat="server" ID="pnl1" Height="400" Width="300" Region="Center" >
<asp:Button runat="server" ID="x1"/>
<ext:Button runat="server" id="x2">
<DirectEvents>
<Click OnEvent="x2_Clcik"></Click>
</DirectEvents>
</ext:Button>
<CKEditor:CKEditorControl ID="ckedit" runat ="server"></CKEditor:CKEditorControl>
</asp:Panel>
<p></p>
<div>
<ext:panel runat ="server" ID="wnd1" >
<Content>
<CKEditor:CKEditorControl ID="CKEditorControl1" runat ="server" Height="400"></CKEditor:CKEditorControl>
</Content>
</ext:panel>
</div>
</div>
</form>
</body>
</html>
And Code BehindPublic Class WebForm1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
' wnd1.Visible = False
wnd1.Hide()
Dim x As String = "<UL><LI>Aircraft Leasing</LI><UL><LI><FONT face=Arial>some text linked t the leasing of aircraft</FONT></LI></UL></UL><P><FONT face=Arial>skl;dfjksj </FONT></P>"
ckedit.Text = x
End If
End Sub
Private Sub WebForm1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
Page.RegisterRequiresPostBack(CKEditorControl1)
End Sub
Public Sub x2_Clcik()
wnd1.Show()
ckedit.Text = "Validate incoming process information, engage with client to perform quality assurance and complete analysis"
Dim x As String = "<UL><LI>Aircraft Leasing</LI><UL><LI><FONT face=Arial>some text linked t the leasing of aircraft</FONT></LI></UL></UL><P><FONT face=Arial>skl;dfjksj </FONT></P>"
CKEditorControl1.Text = ckedit.Text
CKEditorControl1.AutoUpdateElement = True
End Sub
Private Sub x1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles x1.Click
'wnd1.Visible = True
wnd1.Show()
ckedit.Text = "Validate incoming process information, engage with client to perform quality assurance and complete analysis"
Dim x As String = "<UL><LI>Aircraft Leasing</LI><UL><LI><FONT face=Arial>some text linked t the leasing of aircraft</FONT></LI></UL></UL><P><FONT face=Arial>skl;dfjksj </FONT></P>"
CKEditorControl1.Text = ckedit.Text
End Sub
End Class