开发者

ASP.Net textbox will not postback on textchanged if set to false on pageload

开发者 https://www.devze.com 2023-02-07 22:40 出处:网络
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. Obviousl

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消