Adding products to Datatable on Add Button Click, If it exists need to ask Add it Again?

Posted by Shivu under C# on 1/11/2012 | Points: 10 | Views : 1134 | Status : [Member] | Replies : 1
protected void btn_Add_Click(object sender, EventArgs e)
{
//some code
if (condition)
{
//pop up This product already exist? Do need to add it again?
}
//add it DataTable and bind grid view
}
Adding some products along with some other details to Datatable and binding it to Grid view. If the product is already exist need to ask Do you want to add it again. If he says yes I need to add it.




Responses

Posted by: Sksamantaray on: 1/11/2012 [Member] Silver | Points: 25

Up
0
Down


Hi, in your aspx you create a:
1- panel
1: for confirmation if This product already exist? Do need to add it again?
In that panel keep 2 buttons 1-Cancel 2-save

2-ModalPopupExtender

protected void btn_Add_Click(object sender, EventArgs e)
{
//some code
if (condition) /// if duplicate is found
{
//modalpopupexetender's show method for confirmation
}
else
{
//add it DataTable and bind grid view
saveData();
gridviewShow();
}
}

also call saveData();
gridviewShow();
inside save button's click method (this button is inside the panel




Thanks,
Sanjay

Shivu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response