Click here to Skip to main content
15,896,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,
I have server control and it has a child control in it. The problem is I want to set an event to that control but it dosn't riase :(

C#
protected override void RenderContents(HtmlTextWriter output)
        {
            TextBox txtBox = new TextBox();
            txtBox.ID = "txtBox";
            txtBox.AutoPostBack = true;
            txtBox.TextChanged += new EventHandler(txtBox_TextChanged);
            txtBox.RenderControl(output);
        }
        protected void txtBox_TextChanged(object sender, EventArgs e)
        {

        }


When I write some text in the textbox and press tab (which must raise the event textchanged) the page dosn't reload and the event dosn't raise.
When I view the source code of the page in the browser I only find this:

HTML
<input id="txtBox" type="text" name="txtBox"></input>


Why I can't find onclick or something like that????!!!
Why textchanged event dosn't raise???!!!!!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900