Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Experts,

I have to display pop up message in c# asp.net. I am using below code for displaying messages. But in some browsers this pop up is appearing top of browser. The page becomes ugly. So I want to display messages using any script that displays center of screen with model.
If there are any articles about it. Please refer me links. or Give me some hint how to get this in own way.
Right now i am using below code to display pop messages.

ScriptManager.RegisterStartupScript(this, this.GetType(), "ALTER", "alert('" + objTrans.ErrorMessage + "');", true);

ScriptManager.RegisterStartupScript(this, this.GetType(), "ALTER", "alert('Record Approved Successfully'); window.location = 'RvlsAppMnu.aspx'; ", true);


What I have tried:

<pre>ScriptManager.RegisterStartupScript(this, this.GetType(), "ALTER", "alert('" + objTrans.ErrorMessage + "');", true);

ScriptManager.RegisterStartupScript(this, this.GetType(), "ALTER", "alert('Record Approved Successfully'); window.location = 'RvlsAppMnu.aspx'; ", true);
Posted
Updated 10-Jul-18 15:18pm

1 solution

You may want to use the MessageBox controls I built a few years ago: A Customized MessageBox, ConfirmBox and FrameBox Controls For ASP.NET WebForms[^]
 
Share this answer
 
Comments
Member 13805387 12-Jul-18 2:30am    
Thank you so much dude.
Vincent Maverick Durano 12-Jul-18 4:22am    
glad to be of help. :)

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