ASP.Net textbox will not postback on textchanged if set to false on pageload
I have a textbox with a regex validator attached to it and some stuff in the ontextchanged code behind. This all works fi开发者_如何转开发ne unless I start the textbox out with Visible=false. Obviously, I'm setting the textbox.Visible to true later on in the codebehind, but when I do this, no postback occurs when the text changes. I'm pretty sure I have isolated the cause to when I change the visible property, but has anyone seen anything like this or know some sort of work around?
When you set a control's visible property to false it is not rendered on the page at all. If you simply want it to not display to the user you can use CSS.
Do you have AutoPostBack="true" set on the textbox?
精彩评论