confirmation dialogue box
I am having button on its click event I am calling some function that function is interacting with database and fetching some result and on basis of that result I have to pop confirmation box and on basis of that ok or cancel click I want to execute my same function further.how can I do this.

Dhanunjay JajimogglaPosted Jun 26, 2014, 2:49 AM
Hi,
The above code placed in one method.
public bool Test()
{
return true;
or
return false;
}
In your method, Handle with the if condition .
gunjan aroraPosted Jun 24, 2014, 11:35 PM
Dhanunjay JajimogglaPosted Jun 23, 2014, 11:22 AM
Try this,
StringBuilder sb = new StringBuilder();
sb.Append("");
Page.RegisterStartupScript("ConfirmStatus",sb.ToString());
gunjan aroraPosted Jun 23, 2014, 2:07 AM
Dhanunjay JajimogglaPosted Jun 21, 2014, 1:16 AM
Try this,
Button2.Attributes.Add("onclick", "return confirm('Are you sure you want to proceed?')");
if above code is not working ...Again try like below.
1. Add the reference of win form .dll
2. here write code like
if (MessageBox.Show("Are you sure you want to proceed?", "proceed", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
//write your logic
}
Best Regards,
Dhanunjay.
gunjan aroraPosted Jun 19, 2014, 11:56 PM
{
for(int i=0; i< datatablecol; i++)
{ string qry="select qry";
int res= result from that query;
if(res=="0")
{
confirmation box pop
if(user click yes) { }
else { }
if(res==1)
{
confirmation box pop
if(user click yes) { }
else { }
}
} } } }
This is a sample code...I want my function should not execute further unless and until user don't provide the confirmation.
Dhanunjay JajimogglaPosted Jun 19, 2014, 6:48 AM
Please Provide some code
gunjan aroraPosted Jun 19, 2014, 1:43 AM
Dhanunjay JajimogglaPosted Jun 19, 2014, 12:46 AM
Before onclick event, you have write the following code.
function Confirmation()
{
if (confirm("You Sure,To Get Data !") == true) {
return true;
}
else
{
return false;
}
}