ASP.NET文本框问题 [英] ASP.NET textbox issue

查看:74
本文介绍了ASP.NET文本框问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本框.我将其最大限制设置为15000个字符.没问题当我在其中输入4000个以上的字符时,它们不会被渲染,这意味着它们只会显示为空白.不过,它仍然达到了极限.

I have a textbox. I set its maximum limit to say 15000 characters. No problem here. When I enter more than 4000 characters in it, they do not get rendered meaning they just appear as blank spaces. It still goes upto the limit though.

有什么想法吗?

谢谢.

推荐答案

这是什么意思,它们没有被渲染?当您键入第4001个字符时,它会移动一个空格,但是您看不到字符?

What do you mean they dont get rendered? When you type the 4001th char, it moves over a space, but you dont see the char?

或者您是说回发后4000个字符丢失了吗?

Or do you mean after a postback, the characters after 4000 are lost?

关于4000的一件事,恰好是sql服务器中nvarchar的最大存储大小.可能是您通过ontextchanged将值发送到服务器,更新了db,然后使用现在被截断的db值重新更新了控件?只是一个想法.

One thing about 4000, it happens to be the max storage size for nvarchar in sql server. It could be you are sending the value to the server in a ontextchanged, updating the db, then re-updating the control with the db value which is now truncated? Just a thought.

如果您没有看到没有任何服务器回发的字符,或者在回发后字符丢失(请记住,如果您的UpdatePanel的事件已更改且autopostback = true,则回发可能会有所帮助),将有助于您进行说明.当您跳出该字段时会透明地发生.)

It would be helpful to clarify if you dont see the chars without any server postbacks, or if the chars are lost after a postback (keep in mind if you have an UpdatePanel with a changed event and autopostback=true, a postback could be occurring transparently when you tab out of the field).

这篇关于ASP.NET文本框问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆