.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

form in updatepanel (firefox vs ie newline)

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :ASP.Net
I've got a form consisting of a multiline textbox (textarea) and a button.It works submitting the form and storing the text in the mysql database and then displaying the text on the site.Before displaying the text I change all newlines to br-tags: .Replace(Environment.NewLine, "<br />");  The problem is that since I added an updatepanel around the form, the displayed text does not have any newlines in it.This occurs only when the form was submitted using firefox, when submitting the form in IE there are newlines.I'm pretty sure this is because in firefox a newline is \n and in IE a newline is \n\r . and then Environment.NewLine is compared to \n instead so they're not displayed. The question is why \n is saved in an async postback when \n\r is saved in the database in a non-async postback (both cases using firefox) and what can I do to fix this? If this is the problem, it should be very common but I googled and couldn't find anything....

View Complete Post

More Related Resource Links

Shadowbox kills Silverlight in SP 2010 on IE for survey form (but not Firefox)


I have put the Shadowbox javascript in place on our SharePoint 2010 system. Placing the Shadowbox files in the site assets and calling the js file with the following in the masterpage.

<script src="../../SiteAssets/Shadowbox/shadowbox.js" type="text/javascript"></script>
 <script type="text/javascript">

Shadowbox works fine on all pages where we use it. But we have just discovered that the survey response form Silverlight pop up has died in IE (we are using IE8). Silverlight popups still work in other parts of Sharepoint but not for surveys. It works in Firefox perfectly.

If I run IE in debug mode it stops with an error of: 'listName' is null or not an object

at this line in core.js: if(d.listName.toUpperCase()==a.toUpperCase())

But interestingly when I click continue in the debugger the silverlight popup works. So it only works when debugging in IE.

Has anyone else managed to get Shadowbox to work in Sharepoint 2010 without killing surveys? If so

Ajax Nobot, updatePanel on firefox


Hi guys,

I encounter a very strange problem and hope someone could help me. I have a content page in which a nobot control is used to prevent any robot guessing. There is an updatepanel used to hold all the input fields, enter button and the nobot control. Whenever I finished filling out the form and pressed enter button, an invalidbadresponse will come out. This problem doesn't appear on IE, Chrome but on Firefox. I used firebug to trace the problem and then i found that 2 posts were submited. 1 is aborted and 1 is successfully sent. The most wired thing is, when i fired the webpage on debugger mode from visual web developer (http://localhost:<port> ), firefox can validate it without a problem. Once I copied the page to my website ( http://www.mySite.net/ ), such invalidbadresponse comes out. Then, I tried to remove the updatePanel and now only 1 post is sent and no more invalidbadresponse is shown. Therefore, I guess the problem is between the mechanism of nobot and updatepanel. Could anyone know what happens behind and what I could do to solve this problem ?

My challenge is from the internet:

    Protected Sub CustomChallengeResponse(ByVal sender As Object, ByVal e As AjaxControlToolkit.NoBotEventArgs)

UpdatePanel don't work with Google Chorme or Mozilla Firefox.


Hi I am using update panels with Update mode conditional in by aspx page. The page is functioning properlly in the IE.8.0 but the page content is not posting when i open it in the Google Chrome or Mozilla Firefox.

FYI I am using Update panels for drop down lists and buttons and in the triggers also i am using similar controls

Pls can you suggest a way to get this out.



Slow updatepanel.update() in IE6/7, fast in firefox?! tried fix.


I have an update panel with about 5 slider extenders, 10 textboxes, and 3 dropdown bullet list.  When a slider is moved, a partial postback occurs, that which the server also updates another textbox with a value by first setting the textbox (.text = somevalue) and then calling the updatepanel.update().

I find out that this command updatepanel.update() significantly causes IE6 and IE7 browser to lag about 1-1.5 seconds longer when updating the values in the textbox.  It is sort of unacceptable.

I have applied this fix already: http://support.microsoft.com/kb/2000262

but it is not helping.

However, I must say, this problem is not occuring in FireFox 3.6.  In fact, it has no lag whether or not the fix is used.  The problem only occurs in IE6 and IE7.

Any idea why an updatepanel is slow to refresh?


JQuery Validate plugin to validate a ASP.NET Form

The first time I used the JQuery Validate plugin, it did not work at all, see JQuery Validate odd behaviour with the ASP.NET Script Manager for reason, but perseverance and stubbornness prevailed and I finally created my first JQuery validated ASP.NET Forms contact form.

How to use getElementById to get the elements in a form

There are many ways of accessing form elements, of which the easiest is by using the cross-browser W3C DOM document.getElementById method. Before we learn more about this method, it would be useful to know something about the Document Object Model (DOM), the concept of HTML nodes or elements, and the concept of containers.

Each time you load an HTML page, the web browser generates an internal representation of the page in the form of an inverted tree structure. Let us look at a simple form. We will use this form later to demonstrate the use of the getElementById method.

Form view in ASP.NET


hi all...!
i have a database and i create a form with button edit,delete, New Registration..using Formview in asp.net..
everything was working good...

And i write SQL statement to get New ID number into dropdownlist/TextBox when i click button "New Registration".

i can get new(next) ID number after read database
it's also working good

Now i want change it to get ID which was deleted from table and replace the ID with new record...what i need is when i click "New Registration" i want get deleted "ID" first and then go to new record ID...

my code is here:-it working for get next ID after read database.

FROM Table1
AS boon WHERE PANG &gt;300000

UpdatePanel is not a known element - message when upgrading to 1.0 ajax


It worked on one of my old pages.  I change the web.config, renamed all the <asp.

On some aspx page it doesn't recognize the updatepanel.  It only does on one page.  If I create a new aspx page with a different name - then it works.

Should I just create a new web project ajax - then copy all my code into there?  Or is there a way to get those old pages to recognize the new ajax controls?

Gridview inside updatepanel


I am displaying large amount of data in gridview,the gridview placed within updatepanel,every 1sec i am refreshing updatepanel using ajax timer.my problem is while displaying large data the cpu performance is low,pls give idea to increase cpu performance..

form feild hints are not displaying for textboxses inside create user wizard?



I'm using following JS code to display input hint box besides the textbox whenever that asp.net textbox receives focus. 

I'm doing this for a registration form and all of the textboxes are inside the asp.net create user wizard control.

<script type="text/javascript">
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("TextBox");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";

How to pass value to another form


Dear experts,

                     I have QuoteNumber filed in Db.aspx(ddquote.txt) i want to pass this QuoteNumber values(values should to another web form/page i.e. mail.aspx when i click mail button, Message should supposed to display in textbox(txtQuote.txt) of mail.aspx form/page is "You are sending "QuoteNumber"  quotation to "MailID", Thanks.




Validate form input - Japanese


 I've searched for several hours and haven't come up with a reference - or even many discussions - of how to go about validating Japanese names, addresses, etc. When I lived in Japan websites, atm's etc. required such info to be entered with the roman alphabet but I've seen some websites that are allowing Kanji/Hiragana/Katakana. I haven't tested many of them for validation but one that I did test (after looking at the page source and discovering no client-side validation) allowed me to put this in the name field: J*=123*go^ Neat!

Any pointers/references? Thanks

Form Filler: Build Workflows to Capture Data and Create Documents


Learn how to create a workflow that uses InfoPath forms and other office documents for passing data to targeted activities and for use in Office documents.

Rick Spiewak

MSDN Magazine June 2008

Wicked Code: UpdatePanel Tips and Tricks


Jeff Prosise explains when it's better to use UpdatePanel and when it's better to use asynchronous calls to WebMethods or page methods instead.

Jeff Prosise

MSDN Magazine June 2007

InfoPath 2007: Designing Form Templates With The New Features Of InfoPath


InfoPath 2007 is an XML forms designer and editor, and a fully featured and integrated member of the Office family. This article takes a sneak peek at some of its new features.

Scott Roberts and Hagen Green

MSDN Magazine August 2006

C++ at Work: Form Validation with Regular Expressions in MFC


I thought I'd use this month's column to describe an interesting app I built using the RegexWrap library described in my article "Wrappers: Use Our ManWrap Library to Get the Best of . NET in Native C++ Code" in this issue.

Paul DiLascia

MSDN Magazine April 2005

Cutting Edge: Form-based Programming in ASP.NET


One of the most common snags that ASP developers encounter when they first approach ASP.NET is that managed Web applications must be written according to a single-form interface model. Find out how it works.

Dino Esposito

MSDN Magazine May 2003

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend