This project has moved and is read-only. For the latest updates, please go here.

asp.net UpdatePanel issue in FF and IE

Dec 26, 2011 at 8:06 PM
Edited Dec 26, 2011 at 8:23 PM

Hi,
I have an issue when using ScripManager and UpdatePanel on my aspx page with jhtmlarea.
The page contains UpdatePanel with ListControl, TextBox, Button and Label. The goal is to fill jhtmlarea with "default" values according to the ListControl's selected index, edit text and then send the edited text to, for example, Label. It works how expected in Chrome only.
In FireFox jhtmlarea text remains old after editing and the Label receives "old" value.
In IE Label receives correct value but after that jhtmlarea is disabled. To enable it I have to make a postback (choose item in the ListControl, for example).
It works fine if I remove UpdatePanel.

Can anybody help me? And sorry for English, my mother tongue is Russian...

Thanks.

 

<%@ Page Language="C#" ValidateRequest="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!IsPostBack) { tb.Text = ""; btn.Enabled = false; }
	}
	
	protected void lst_SelectedIndexChanged(object sender, EventArgs e)
	{
		btn.Enabled = true;
		switch (lst.SelectedIndex)
		{
			case 0:
				btn.Enabled = false;
				tb.Text = "";
				break;
			case 1:
				tb.Text = "<h1>case 1</h1>";
				break;
			case 2:
				tb.Text = "<h1>case 2</h1>";
				break; 
		}
	}

	protected void btn_Click(object sender, EventArgs e)
	{
		lbl.Text = tb.Text;
	}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title>jHtmlarea ff issue test</title>
	<script src="../scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
	<script src="../scripts/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
	<script src="../scripts/jHtmlArea-0.7.0.min.js" type="text/javascript"></script>
	<link href="../style/jHtmlArea.css" rel="stylesheet" type="text/css"/>
	<script language="javascript" type="text/javascript">
		function pageLoad() {
			$('#<%=tb.ClientID%>').htmlarea();
		}
	</script>
</head>
<body>
    <form id="form1" runat="server">
	<asp:ScriptManager ID="scrMgr" runat="server"/>
    <div>
		<asp:UpdatePanel ID="pnlMain" runat="server">
			<ContentTemplate>
				<asp:ListBox ID="lst" Rows="1" AutoPostBack="true" runat="server" OnSelectedIndexChanged="lst_SelectedIndexChanged">
					<asp:ListItem Text=""/>
					<asp:ListItem Text="template 1"/>
					<asp:ListItem Text="template 2"/>
				</asp:ListBox><br/><br/>
				<asp:TextBox ID="tb" Width="800" TextMode="MultiLine" Rows="10" runat="server"/><br/>
				<asp:Button ID="btn" Text="Get text" runat="server" OnClick="btn_Click"/>
				<br/><br/>
				<asp:Label ID="lbl" runat="server"/>
			</ContentTemplate>
		</asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
Apr 25, 2012 at 8:35 AM

I am also facing same issue.

Please help.

 

Anu

Jun 7, 2012 at 12:34 PM

Any news on this subject?

I am also facing this issue... :S

 

Miguel