Hi all,
I got an error when I tried to hide and show FCKeditor by using Ajax controls.
see the error picture in the attachment.
Thanks
--HTML CODE
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TEST_11.aspx.vb" Inherits="KAS5.TEST_11" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="Editor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem Text="1" Value="1"></asp:ListItem>
<asp:ListItem Text="2" Value="2"></asp:ListItem>
</asp:DropDownList>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<Editor:FCKeditor ID="fckeMessageBody" Visible="true" runat="server" ToolbarSet="EmailForm" Height="250" Width="600" ContentLangDirection="RightToLeft" AutoDetectLanguage="true"
BasePath="~/FCKeditor/" >
</Editor:FCKeditor>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1"
EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<br />
</div>
</form>
</body>
</html>
VB CODE--
Public Partial Class TEST_11
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Me.ClientScript.RegisterOnSubmitStatement(fckeMessageBody.GetType(), "fckeMessageBody", "FCKUpdateLinkedField('" + fckeMessageBody.ClientID + "');")
End Sub
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DropDownList1.SelectedIndexChanged
If DropDownList1.SelectedIndex = 0 Then
fckeMessageBody.Visible = True
Else
fckeMessageBody.Visible = False
End If
End Sub
End Class
Fri, 07/24/2009 - 22:20
#1
Re: Editor problem with updatepanel in ASP.NET
Try to put your dropdownlist into the updatepanel.
It should work.