开发者

Textbox line endings on the web?

开发者 https://www.devze.com 2022-12-17 04:45 出处:网络
I have an ASP.Net page with a multi-line textbox on it. Will the line endings on this textbox be according to the server or the client? What I\'m asking 开发者_开发知识库is if ASP.Net is running in L

I have an ASP.Net page with a multi-line textbox on it.

Will the line endings on this textbox be according to the server or the client? What I'm asking 开发者_开发知识库is if ASP.Net is running in Linux on Mono will the line endings always be \n or will it depend on if the client computer is running Linux?

Are line endings in a textbox determined by the server or client?


By the client. Jeff just posted a pretty useful blog entry about this.

As Jeff pointed out in his article the line endings are actually determined by the source of the content. So you could actually copy and paste content from different sources and end up with certain lines terminated \n and others with \r or \r\n, all in the same textbox.


It's best to try to handle all of them. Even the '\r' from older Macs. And yes, it's determined by the client.

0

精彩评论

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

关注公众号