Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use ..
HTML
<pre lang="sql">response.write(<script>Alert('error')</script>);
return;


to show the message but while showing message it doesnot show any of page content but i want to know is there any way to show this script message which can show page content and massege but not postback the data to server when error cause</pre>

HTML
<pre lang="sql">this.Page.ClientScript.RegisterStartupScript();
return;


is working but it doesnot shows the controls after this code untill we click ok on message box___________

for exapmle i want the same effect as it shows on codeproject after something goes wrong on posting comment it says "our server is overworked problem on posting comment or something like that" and it shows message box everything on page that was before clicking submit
Posted
Updated 22-Sep-13 5:15am
v2

If you would use
JavaScript
Response.Write
from your code then, the behaviour would be same just as you described above. The background will be blank and will not be rendered until you click OK on the alert box. Usually what I do in these scenarios is that I keep a asp Label & a asp image control at a fixed location on the page whose text is set to blank. The advantage is that I use the same label for information, warning, & error. For ex, if an error occurs, I will display the error icon for the image and the message will be displayed in the label. Similarly, for information & warning you can use different icons to notify the user. And since it's just a asp Label, it will not stop the rendering of your page.

Alternatively, you can also use ajax, if you want to persist to the browser's window for information. I personally, prefer the former approach.
 
Share this answer
 
Comments
varun150 24-Sep-13 12:29pm    
its working ok if i use window.onload alert() in RegisterStartupScript() but how to generate browser's window for information box in asynchronously otherwise my problem is solved
piyush_singh 25-Sep-13 1:55am    
Sorry, I didn't get it this time. If you say that its working, then the problem is solved right?? Otherwise, if, your alert message is fixed, then you can use the OnClientClick property for a button (or any other asp control) to fire the alert box.
its working ok if i use window.onload alert() in RegisterStartupScript() but how to generate browser's window for information box in asynchronously otherwise my problem is solved
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900