s13khan
03-23-2006, 06:24 AM
Hello there!!!
I want to take a Yes/No confirmation from user by displaying a MessageBox of YesNo Type while deleting an item from a DataGrid which will help to define whether Item should be delted or not (that is next steps should be proceed or just exit from the Procedure).
My other functions in ASP.NET (VB.NET) like Add, Edit, Delete of DataGrid are working fine but I want to display a MsgBox for the confirmation of Delete the selected item.
Thanx
SK
handshakeit
03-23-2006, 10:36 AM
if(MessageBox.Show("Are you Sure?",MessageBoxButtons.YesNo)==DialogResult.Yes)
{
//write code
}
else
{
//write code
}
hope this is what you want
Thanx
Abhi
Handshakeit (http://www.handshakeit.com)
Brandoe85
03-23-2006, 01:57 PM
if(MessageBox.Show("Are you Sure?",MessageBoxButtons.YesNo)==DialogResult.Yes)
{
//write code
}
else
{
//write code
}
hope this is what you want
Thanx
Abhi
Handshakeit (http://www.handshakeit.com)
I have mentiond this to you in another thread as well, windows forms applications are not the same as asp.net web applictions. MessageBox doesn't exists in asp.net. This has to be done with javascript.
s13khan - Take a look at this article, it should give you an idea:
http://www.codeproject.com/aspnet/ClientSideConfDataGrid.asp
Good luck;
s13khan
03-25-2006, 04:39 AM
I got u. but the javascript over there was called by C# Code. But Can you tell me how to convert this C# codes into VB code ?
I have mentiond this to you in another thread as well, windows forms applications are not the same as asp.net web applictions. MessageBox doesn't exists in asp.net. This has to be done with javascript.
s13khan - Take a look at this article, it should give you an idea:
http://www.codeproject.com/aspnet/ClientSideConfDataGrid.asp
Good luck;
handshakeit
03-28-2006, 04:17 AM
You want this in VB
if ( e.Item.ItemType == ListItemType.AlternatingItem
|| e.Item.ItemType == ListItemType.Item
|| e.Item.ItemType == ListItemType.SelectedItem )
{
e.Item.Cells[0].Attributes.Add( "onClick", "return ConfirmDeletion();" );
}
here it is
if(e.( e.Item.ItemType == ListItemType.AlternatingItem
|| e.Item.ItemType == ListItemType.Item
|| e.Item.ItemType == ListItemType.SelectedItem ) then
e.Item.Cells[0].Attributes.Add( "onClick", "return ConfirmDeletion();" )