Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
191 views
in Technique[技术] by (71.8m points)

ASP.NET textbox issue

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.

Any ideas?

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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?

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

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.

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...