开发者

ASP.NET: Disabling postback of the contents of a TextBox

In my page I have a r开发者_运维技巧ead-only TextBox that contains a rather large amount of text. I noticed that on postback this text is sent back to the server and validated, even though the client can never modify it. This seems silly; is there a way to disable this behavior?


consider making it a div or another element that does not post back their content, especially if it is read only content


You can set the Page Validation to False in the Page Directive. It avoids validation of input.


Have you already tried setting the ReadOnly property of the TextBox to true?

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.readonly.aspx

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜