0

Javascript:

function ConfirmIt() {
    var x = confirm("Do you Want to Delete The Point ??");
    var control = '<%=inpHide.ClientID%>';
        if (x == true) {
            document.getElementById(control).value = "1";
        } else {
            document.getElementById(control).value = "0";
        }
}

Code behind:

ScriptManager.RegisterStartupScript(Page, GetType(), "JsStatus", "ConfirmIt();", true);
int DiagResult = int.Parse(inpHide.Value);
if (DiagResult == 1)
{
    // db.delete_Geo_Routepoints(userid);
}

I want to be able to call JavaScript code from the backend only, but the code that I currently have isn't able to do so. How am I supposed to get the value?

1

1 Answer 1

0

Javascript is client-side code you cannot get output on Code behind

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

Comments

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.