By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,813 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

CRLF appearing in empty textbox when __doPostBack is used

P: n/a
When I use a __doPostBack to submit a page to the server the last textbox on
the page always contains a CRLF. I've used HttpRequest.SaveAs to dump the
entire request (IIS 6) to disk and the body of the message reads like this

viewstate=blahblahblah&txtPhoneNumber=

A CRLF is present at the end of the line and it's included in
txtPhoneNumber.Text. This causes my validator to fail. The validator insures
that if any characters are entered there are a minimum of 10. This issue
doesn't present itself if I press btnSubmit because the request body then
reads something like

viewstate=blahblahblah&txtPhoneNumber=&btnSubmit=b tnSubmit

The extra CRLF isn't present in IIS 5.1 (windows XP) so it's fine. However,
IIS 6 has them. I read on a post somewhere on the net that's RFC 2616 is hte
problem. IIS 5 ignores extra CRLFs whereas IIS 6 doesn't. I would have
expected the .Net framework to ignore them. Is this a known issue in the
IIS6/ASP.Net combo?

My current work around is to call document.all.btnSubmit.submit() in the
__doPostBack function instead of document.forms.Form1.submit().

Any one got a similar problem? I'd like to get to the bottom of this to
satisfy my own curiosity ;->

Nov 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.