472,117 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,117 software developers and data experts.

Response.write()in ajax enabled wesite

366 256MB
Hello friends

i am developing ajax enabled wesite in asp.net2.0 and c#

in the webforms where ever i am using update panel of ajaxtoolkit Respose.write is not working ,on ther form where there is no update panel ,in those forms it works fine

what is solution for writing responce.write method in forms that have update panel ,any help please


Thanks
Jun 6 '07 #1
5 13245
kenobewan
4,871 Expert 4TB
Have you tried write(string) instead?
Jun 6 '07 #2
nateraaaa
663 Expert 512MB
Instead of using Response.Write on your AjaxEnabled website page have you tried updating a label with the text you wanted to show using Response.Write?
Check out the following website

http://www.asp.net/learn/videos/default.aspx?tabid=63#ajax
If Joe Stagner does not use Response.Write in any of his tutorials you may not be able to use Response.Write. I am sure that he shows an alternative to that though.

Good Luck

Nathan
Jun 6 '07 #3
nmsreddi
366 256MB
Instead of using Response.Write on your AjaxEnabled website page have you tried updating a label with the text you wanted to show using Response.Write?
Check out the following website

http://www.asp.net/learn/videos/default.aspx?tabid=63#ajax
If Joe Stagner does not use Response.Write in any of his tutorials you may not be able to use Response.Write. I am sure that he shows an alternative to that though.

Good Luck

Nathan


Thanks nathan

Your idea isgood that using label instead of response.write()

but my requirement is not just writing text on the web page

i will write some java script alert method in that response.write()

method ,that is similar to message box in windows application

is there any other alternative of giving an alert message like popup for validation purpose in asp.net

Thanks
Jun 7 '07 #4
I think it is not possible
Mar 17 '08 #5
Frinavale
9,735 Expert Mod 8TB
Thanks nathan

Your idea isgood that using label instead of response.write()

but my requirement is not just writing text on the web page

i will write some java script alert method in that response.write()

method ,that is similar to message box in windows application

is there any other alternative of giving an alert message like popup for validation purpose in asp.net

Thanks
The reason why your response.write is not working is because of the partial page update....

Only part of the page is being updated, therefore response.write is not going to work properly.

The most confusing thing for you is probably when you look at the HTML(view source) of the page after it has been re-rendered...you may see your response.write content there (your JavaScript). However, this is not actually the HTML that the browser is using. The browser's using the old HTML (that was rendered the first time) with only that one section within your UpdatePanel updated.

I would recommend rethinking your JavaScript...maybe place it in an external .js file that is always accessible to the page content.

Also, you shouldn't really be using Response.Write...it places content anywhere in the output stream (could be before the <head>...before the <body> ...anywhere in the page) and this could cause problems. Instead you should consider using the Page.ClientScript.RegisterClientScriptBlock() method to send your script to the browser.

-Frinny
Mar 17 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Tom | last post: by
1 post views Thread by Vaughn | last post: by
3 posts views Thread by belange | last post: by
5 posts views Thread by Peter Aitken | last post: by
8 posts views Thread by Alejandro | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.