Message box at ASP.Net

  • Thread starter Thread starter Jul
  • Start date Start date
J

Jul

Hi,

How create MsgBox or any analog of that function in ASP.Net?

Thanks
 
Jul,

By instance,
\\\
Page.RegisterClientScriptBlock("clientScript", scriptString)
Dim str As String = "<script language " & _
"=javascript>alert('I hope this helps a little bit?');</script>"
Page.RegisterStartupScript("Startup", str)
///

I hope this helps?

Cor
 
Yes, it helps, but also couple questions:
1. Why I need to call RegisterClientScriptBlock?
2. Why after I press "Refresh (F5)" I get the message " The page cannot be
refreshed without resending the information..." . When I click "Retry" the
alert dialog appear again, but it has to appear only (in my case) when I
click Button on the form.

Thanks
 
Jul,
but it has to appear only (in my case) when I click Button on the form.

Than you have to ask that. You can place in the load event of the page.
Me.Button1.Attributes("onClick") = "alert('I hope this helps a little
bit?');"

I hope this helps?

Cor
 
But can I include script/code to the Private Sub Button1_Click?
or always has to be in Load Event of the page?


and what cases I need to use RegisterClientScriptBlock or
RegisterStartupScript
 
Jul,

Register startup is "onload"
The attribute you can use where you want, don't forget that every sent the
information is refreshed.

I hope this helps?

Cor
 
Thanks for your explanations.
I will try but I am not sure that understand everything.
 

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

Back
Top