Menu

#158 textbox ontextchanged has error

open
nobody
None
5
2011-10-27
2011-10-27
zy8008
No

I'm sorry my english is not good

I use anthem textbox in my page,but textbox ontextchanged can't autocallback,when another textbox have html code value.

my code:

ASPX:
<anthem:TextBox ID="TextBox2" runat="server" text="<a>test</a>"></anthem:TextBox>
<anthem:TextBox ID="TextBox1" runat="server" AutoCallBack="true" ontextchanged="TextBox1_TextChanged"></anthem:TextBox>
<anthem:Label ID="Label1" runat="server"></anthem:Label>

C#:
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
Label1.UpdateAfterCallBack = true;
Label1.Text = TextBox1.Text;
}

Please help me ! thanks

Discussion

  • Hery He

    Hery He - 2011-12-29

    Hi zy8008,
    Please make sure that Anthem.js has been in your project.
    It will work then.

    Regards,

    Hery He

     
  • Pablo Petracini

    Pablo Petracini - 2011-12-29

    Hi,
    It does not work because anthem detects that it could be a potentially attack. I tried your example with some tweaks and got this exception.

    A potentially dangerous Request.Form value was detected from the client (TextBox2="<a>test</a>").

    Hope that helps.

    Pablo

     

Log in to post a comment.