I want a simple MessageBox for ASP.Net, but everything I tried didn’t work and I don’t know why.
The last thing I tried was this but it didn’t work either.
Any ideas for a simple messagebox with work safe?
For more information:
- I can’t bind anything to a button
- I must call it from the Code Behind
- Directly after clicking okay, I must have a redirect
Test it with onClick on the button:
string msg = "Text";
string script = "<script language=JavaScript>alert("+msg+");</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "clientScript", script);
but it doesn’t work
You could use the dialog component from jQuery UI to display a message box.
A simple usage demo is available here.