0

I have to get the value from the javascript Confirm Popupbox in my codebehind in c# Here is my code. I am able to display the popup box using this

if (data.certFileName != CommonVariables.certfile || data.dataFileName != CommonVariables.datafile)
{
    string msg = "You have changed Arrival Filenames. Press OK To regenerate Autosys File. Press Cancel to Update the existing Autosys file";
    string script = "<script type=\"text/javascript\">confirm('" + msg + "');</script>";
    ClientScript.RegisterClientScriptBlock(this.GetType(), "ConfirmMsg", script);
}

How do i accept the value?

Please help.

2

1 Answer 1

0
if (data.certFileName != CommonVariables.certfile || data.dataFileName != CommonVariables.datafile)
{
    string msg = "You have changed Arrival Filenames. Press OK To regenerate Autosys File. Press Cancel to Update the existing Autosys file";
    string script = "<script type=\"text/javascript\">return confirm('" + msg + "');</script>";
    ClientScript.RegisterClientScriptBlock(this.GetType(), "ConfirmMsg", script);
}

you forgot to write return

Sign up to request clarification or add additional context in comments.

5 Comments

But where will i get the retun value?
i have wrote the code u replace ur code with code in my answer try it
@user2124167 you can do something like this
@Chirag: I get the popup box, which I was geeting earlier. Now i want to capture whether user pressed OK or Cancel. How can i get that?
wait i will try and give u answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.