Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP 2.0 Client Side Message box inside some event

Status
Not open for further replies.

joggi

Programmer
Nov 8, 2006
44
YU
I need client side Msgbox in ASP 2.0 to confirm deleting. I found some scripts but they works on Button_click event and I need something like this:

Sub ButtonDelete_Click

Some code here…..

Some checking here…..

And here I want Msgbox (“Do you want….?”, OKCancel…..)

some code here....

end sub

So, how to insert message box inside some event?

I would appreciate some VB example.

 
For a client-side message box, you are best off using the javascript "alert" function. To register some javascript from the server-sode, you can use the RegisterStartUpScript or RegisterClientScriptBlock functions.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I am confused with this javascript. I need simple code for alert and confirmation message box.

I have on my webform one gridview and one Delete button outside the gridview, button is on the form.
I want user to select grid row, then click Delete button to delete record.

So I need code like this:

Sub ButtonDelete_OnClick

If gridview is selected then
ButtonDelete.OnClientClick = "return confirm(Do you want to delete?');"
else
some alert "You have to select the gridview"
end if

end sub

So, I need combination of confirmation and alert message box. Could someone post VB example for this?

Thank you
 
Why not use the delete button on the grid, then just assign the javascript to the button on the rowdatabound event?
 
I have my reason, it must be the way to do this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top