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