开发者

Other ways of 'disabling' a textbox against user input

in a DetailsView with the mode set to Insert, I had a textbox that is populated by an event, rather than allowing the user to type into it. Problem is, if I set the TextBox to either Enabled="false" or ReadOnly=开发者_StackOverflow"true", it doesn't seem to populate the SqlDataSource parameter with the value of the textbox, which I need. Is there any other ways to stop users inputting data into that textbox, but not use Enabled/ReadOnly?

Thanks


You could make it readonly with JavaScript:

TextBox1.Attributes.Add("readonly", "readonly")

I'm not sure if this approach solves your problem with the SqlDataSource.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜