Home/ASP.NET Forums/General ASP.NET/jQuery for the ASP.NET Developer/calling code behind method from javascript function

calling code behind method from javascript function RSS

16 replies

Last post Dec 28, 2010 10:54 AM by Saturn888

  • SGWellens

    SGWellens

    All-Star

    126031 Points

    10310 Posts

    Moderator

    Re: calling code behind method from javascript function

    Dec 27, 2010 03:51 PM|LINK

    Saturn888

    I understand it is impossible to directly call a server-side function, but is there a simple way to still fire it?

     

    That is incorrect.

    Here is an example of how to do it.

    http://weblogs.asp.net/stevewellens/archive/2009/06/09/ah-ah-ah-ah-staying-alive-staying-alive.aspx

    Steve Wellens

    My blog
  • Ahmad Kmaldeen

    Ahmad Kmalde...

    Member

    122 Points

    35 Posts

    Re: calling code behind method from javascript function

    Dec 27, 2010 03:57 PM|LINK

     have you try it first case it's very fine with me and very simple to use !!!!?

  • Saturn888

    Saturn888

    Member

    13 Points

    66 Posts

    Re: calling code behind method from javascript function

    Dec 27, 2010 04:02 PM|LINK

    Ahmad Kmaldeen

     have you try it first case it's very fine with me and very simple to use !!!!?

    thanks. I tried but i get the following error:

    "Microsoft JScript runtime error: 'Sys' is undefined"



  • Ahmad Kmaldeen

    Ahmad Kmalde...

    Member

    122 Points

    35 Posts

    Re: calling code behind method from javascript function

    Dec 27, 2010 04:10 PM|LINK

    my friend you need to use ScriptManager in the same page

    <asp:ScriptManager ID="ScriptManager1" runat="server" LoadScriptsBeforeUI="true">
            </asp:ScriptManager>


     

     

  • Saturn888

    Saturn888

    Member

    13 Points

    66 Posts

    Re: calling code behind method from javascript function

    Dec 27, 2010 04:23 PM|LINK

    can you show where do you put it?

    Ahmad Kmaldeen

    my friend you need to use ScriptManager in the same page

    <div class="dp-highlighter"><div class="bar"><div class="tools">view plaincopy to clipboardprint?
    </div></div>
    1. <asp:ScriptManager ID="ScriptManager1" runat="server" LoadScriptsBeforeUI="true">  
    2. </asp:ScriptManager>  
    </div>
    <asp:ScriptManager ID="ScriptManager1" runat="server" LoadScriptsBeforeUI="true">
            </asp:ScriptManager>


     



  • Prev Next
    1 2Last

    ‹ Previous Thread|Next Thread ›