简体   繁体   English

启用了MultiLine TextMode的ASP.NET文本框的最大字符数是多少?

[英]What is the maximum amount of characters for an ASP.NET textbox with MultiLine TextMode enabled?

I know that the MaxLength property doesn't apply to System.Web.UI.WebControls.Textbox control in MultiLine mode. 我知道MaxLength属性不适用于MultiLine模式下的System.Web.UI.WebControls.Textbox控件。 But what is the maximum amount of characters I can type in the textbox? 但是我可以在文本框中输入的最大字符数是多少?

It seems to be 1000 characters, but I can't find this documented anywhere. 它似乎是1000个字符,但我无法在任何地方找到它。

I am not asking on how to limit the number of characters in the textbox control. 我不是在询问如何限制文本框控件中的字符数。

Thanks. 谢谢。

There is no upper limit to the number of characters in a WebControls.Textbox in multiline mode. 在多线模式下,WebControls.Textbox中的字符数没有上限。 The only limits are total post data from a form and that depends on your web-servers set-up (I presume IIS) which I think is about 2mb by default in IIS but don't quote me on that. 唯一的限制是来自表单的总发布数据,这取决于您的Web服务器设置(我假设IIS),我认为在IIS中默认约为2mb但不引用我。

What is happening when you try to type beyond 1000 charatcters? 当你尝试输入超过1000个字符时会发生什么?

There is no limit to the size of input, but if you use HTTP GET method to submit, your data will be encoded and appended to the submit URL. 输入大小没有限制,但如果您使用HTTP GET方法提交,您的数据将被编码并附加到提交URL。 URLs, depending on a browser, have limitation of about 2000 characters. URL取决于浏览器,限制为大约2000个字符。 Try using HTTP PUT to submit the data in which case the payload is added to the HTTP header of the request which has no size limitations. 尝试使用HTTP PUT提交数据,在这种情况下,将有效负载添加到请求的HTTP标头中,该标头没有大小限制。 Check method property of your FORM element. 检查FORM元素的method属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM