The Ajax time seems to have some trouble updating a panel that contains a text box with some special characters. I managed to replicate the problem using a very simple page that is inlcuded below. The problem is that the second update causes an error 500 from the development server of Visual Studio.
The page just has an update panel with a single multi-line text box. The code for the timer update assignes the text box the string "<br>\n".
Does anyone know how to solve this problem?
The Page is:
<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine"></asp:TextBox> <asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick"> </asp:Timer> </ContentTemplate> </asp:UpdatePanel> </form></body></html>The code for the update is:
public partialclass _Default : System.Web.UI.Page {protected void Page_Load(object sender, EventArgs e) { }protected void Timer1_Tick(object sender, EventArgs e) { TextBox1.Text = "<br>\n;"; }}
Regards,
Ivan
By the way, I do realize that the problem is with special characters that trigger the ASP.NET security validations. Changing the text in the Text Box to HTML encoded is not an option, because in this text box the user should be entering and editing HTML code.
No comments:
Post a Comment