0

I am using this code ..

 ScriptManager.RegisterClientScriptBlock(control, GetType(Button), "sas", "<script> alert('Inserted successfully');</script>", True)

but html result is :

    <script type="text/javascript">
    //<![CDATA[
    <script> alert('Inserted successfully');</script>
//]]>;

why ? and do I need to call it only in Page_Load or can do that in button click event ??

1 Answer 1

2

The last setting which is set to true is for automatically injecting <script type="text/javascript"></script> tags. Remove your script tags or set that flag to false.

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.