Geeks With Blogs
Pankaj Tahiliani

Problem: I have a FormView inside an update panel inside a repeater. When i change the FormView to edit mode, and update text in my textbox (also with inserting text), the text that is inserted isn't adding in the linebreaks i input. If i set EnablePartialRendering="False"  for the page it works correctly. This makes me think it's an error with AJAX and the update panel.

I have checked the database to see what is being inputted and it seems the difference between using IE and Firefox/Safari is that IE inputs 2 square boxes for each line break whereas Firefox/Safari only inputs 1 square box. I repeat, this only happens when partial page rendering is enabled, otherwise all browsers input the same. The inputting is done through an object data source.

I have tried moving the ODS inside the update panel, but this doesnt affect anything.

Solution:  I created a new function to replace carriage returns and linefeeds seperately (previously they were replaced as one):

FormatText = Replace(FormatText, vbCr, "<br/>")
FormatText = Replace(FormatText, vbCrLf, "<br/>")

Above solution is originally posted here: http://forums.asp.net/p/1163582/1929901.aspx#1929901

Posted on Monday, August 3, 2009 1:26 AM | Back to top


Comments on this post: Form inside AJAX update panel isn't submitting line breaks correctly with Firefox and Safari

# re: Form inside AJAX update panel isn't submitting line breaks correctly with Firefox and Safari
Requesting Gravatar...
This solution seems to work in Firefox, Opera, IE8, and Safari for Windows, but it doesn't work in Safari on my Mac. Any idea how to make it work there?
Left by David on Nov 23, 2009 9:28 PM

Your comment:
 (will show your gravatar)


Copyright © Pankaj Tahiliani | Powered by: GeeksWithBlogs.net