Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top