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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying message boxes in ASP.NET

Status
Not open for further replies.

gregburningham

Programmer
Jul 12, 2000
40
GB
Please could someone explain why the following code doesn't work ? - I have a workaround but it's over-complicated

If (Not Page.IsPostBack) Then
Me.Button1.Attributes.Add("onclick", _
"return confirm('Are you sure you want to delete?');")
End If

Thanks
Greg B

 
How come you're putting that in your page load?

It could be that when you post back, because its a postback, that code isn't being set with the button, and thus it never fires.

D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top