How to popup a msgbox from asp.net code-behind?

G

Guest

I am writing a web application using asp.net(vb.net). And, I have an asp:
button in the web form, I would like to prompt some message to user, when the
user click on the asp:button. How to I do such? Because I notice that, I
can't use msgbox as writing window application.

Thanks....and have a nice day.
 
J

jianglinchun

You can fill javascript in the code-behind file 2 ways:

1. just use Response.Write("<script
language='javascript'>alert('aa');</script>");

2. RegisterStartupScript or RegisterClientScriptBlock
RegisterStartupScript will reponse a javascript block to client so that the
client will execute the script once the page was loaded completed.
RegisterClientScriptBlock is usually used for a function or somethig.

Regrads:
jianglinchun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,266
Latest member
DavidaAlla

Latest Threads

Top