Hi,
I have a scenario where I need to look out for a file & if it exists then I need to popup a dialog box with YES/NO buttons prompting the user to select either of the two buttons.
If the user selects YES then I will execute some block of code & similarly for NO. I have used confirm method using JavaScript, but it shows OK/CANCEL & I have called it on click event. Here I am not going to call in the click event where as after searching a file.
Please find below the code I have used so far,
protected void btn_submit_Click(object sender, EventArgs e)
{
READFILE();
}
private void READFILE()
{
try
{
string FILE_NAME = "appset.txt";
if (File.Exists(FILE_NAME))
{
// I need to populate the message box here like “Are you want to update?”
// if YES
{
Some code here
}
// if NO
else
{
Some code here
}
}
}
catch (Exception EX)
{
Alert.Show(EX.Message);
}
}
Regards,
Karthizen