Posts Tagged ‘Confirm’

How Could Implement A Confirm Massage For Link Button In The Asp.net ( Using Visual Stdio 2003) Data Grid?

February 24th, 2010

Inject the JavaScript code from your code behind within the Grid_DataBound event
protected void Grid_ItemDataBound ( object sender, System. Web. UI. WebControls. DataGridItemEventArgs e )
{
if( ( e.Item. ItemType == ListItemType. Item) || ( e.Item. ItemType == ListItemType. AlternatingItem ) || (e.Item. ItemType == ListItemType .SelectedItem) ) {
// reference your button and set its onclick client side event
//
( (LinkButton) e. Item. FindControl(”YourButtonId”) ).Attributes["onclick"] = ” return confirm ( ‘Are you sure you want to delete?’ ) “;
}
}
Don’t forget to wire the DataBound event to your Grid!
Hope this helps.

How Can I Display A Confirm Box In Asp.net App. When I Click The Save Button( Pls Read The Details)?

November 7th, 2009

Hai friends, I have an asp.net app. In that i have to display a messagebox when i click button ( act as Save as well as update depends to the new record or edit the existing record ) a messagebox should be showed as “Are you sure to save?” or “Are you sure to update?” How to do this?