Message box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All,

I have a C# ASP.Net and would like to know how I can display a message box
or another stripped down modal internet explorer window.

Thanks
Msuk
 
Msuk,

You would have to do this through client side scripting code.
Basically, a call to the alert method on the window class provided in the
browser. You will have to register your script on the server side to act in
response to a user action (or the document loading), though.

Hope this helps.
 
Hi,

Thanks do you have a example please?

Thanks
Msuk

Nicholas Paldino said:
Msuk,

You would have to do this through client side scripting code.
Basically, a call to the alert method on the window class provided in the
browser. You will have to register your script on the server side to act in
response to a user action (or the document loading), though.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

msuk said:
All,

I have a C# ASP.Net and would like to know how I can display a message box
or another stripped down modal internet explorer window.

Thanks
Msuk
 
use this:

RegisterStartupScript( "Script", "<SCRIPT>alert('Error, you have ....
');</SCRIPT>" ); // just has an ok button..

or this

RegisterStartupScript( "Script", "<SCRIPT>return confirm('Would you like
to ...?');</SCRIPT>" ); // has a yes/no option

but with a modal that you've created...

RegisterStartupScript( "Script",
"<SCRIPT>showModal('<pagename.aspx>');</SCRIPT>" ); // your aspx page.


msuk said:
Hi,

Thanks do you have a example please?

Thanks
Msuk

Nicholas Paldino said:
Msuk,

You would have to do this through client side scripting code.
Basically, a call to the alert method on the window class provided in the
browser. You will have to register your script on the server side to act
in
response to a user action (or the document loading), though.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

msuk said:
All,

I have a C# ASP.Net and would like to know how I can display a message
box
or another stripped down modal internet explorer window.

Thanks
Msuk
 
msuk,

You have to place the code in the HTML portion of the ASPX page. Either
that, or call the RegisterClientScriptBlock method on the Page class.
However, in .NET 2.0, this method is marked as obsolete. Rather, you will
have to call methods on the ClientScriptManager instance exposed by the
ClientScript property on the Page class.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

msuk said:
Hi,

Thanks do you have a example please?

Thanks
Msuk

Nicholas Paldino said:
Msuk,

You would have to do this through client side scripting code.
Basically, a call to the alert method on the window class provided in the
browser. You will have to register your script on the server side to act
in
response to a user action (or the document loading), though.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

msuk said:
All,

I have a C# ASP.Net and would like to know how I can display a message
box
or another stripped down modal internet explorer window.

Thanks
Msuk
 
Back
Top