Click here to Skip to main content
15,910,234 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii friends...

i have written jquery for showing progressbar when clicking button in asp.net..code is working fine..i m calling this script from code behind as shown below.

C#
string script = "$(document).ready(function () { $('[id*=btngenerate1]').click(); });";
        ClientScript.RegisterStartupScript(this.GetType(), "click", script, true);

but its giving me error message that' the name clientscript does not exist in current context'. i also written all jscript in scriptmanager tag in master page.

C#
<asp:ScriptManager ID="ScriptManager1" runat="server">
        &lt;Scripts>
            <asp:ScriptReference Path="~/jquery/jquery-1.2.3.min.js" />
            <asp:ScriptReference Path="~/jquery/jqModal.js" />
            <asp:ScriptReference Path="~/jquery/coloranim.js" />
            <asp:ScriptReference Path="~/jquery/jquery.js" />

        &lt;/Scripts>
    </asp:ScriptManager>


please help me..
thanks in advance.
Posted
Updated 30-May-13 22:42pm
v2

1 solution

Try Page.ClientScript.RegisterClientScriptBlock instead of ClientScript.RegisterStartupScript

For better understanding the difference between RegisterStartupScript and RegisterClientScriptBlock please read here[^].

Good luck,
OI
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900