how to client click event for button used in RadAjaxManager

4 posts, 1 answers
  1. khaled jendi
    khaled jendi avatar
    64 posts
    Member since:
    Mar 2010

    Posted 23 Sep 2010 Link to this post

    hi,
    I have asp.net LinkButton, where it has been configured with RadAjaxManager to update asp.net panel.
    now I wanna after the update done (the content of that panel changed) I need to call a javascript function, because in this new content, there is div which making a type of sliding effect, but it will not start the effect unless the javascript function is called, so I need to call that javascript function once the update of asp.net panel is done.

    I tried to add "OnClientClick" property to LinkButton, but that does not working, and even it did not triggered!

    and I have tried to create another panel and in ajax calling, I tried to fill it with a Literal control, where this literal:
            Literal l = new Literal();
            l.Text = "<script type='text/javascript'>coda_side_it();</script>";

    but this is not working, and moreover, I tried to Response.Write("<script type='text/javascript'>coda_side_it();</script>"); but that makes a big problem with ajax!!

    so please any help?
  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 28 Sep 2010 Link to this post

    Hi khaled,

    Find this topic on how to execute javascript after ajax update.

    All the best,
    Iana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. khaled jendi
    khaled jendi avatar
    64 posts
    Member since:
    Mar 2010

    Posted 29 Oct 2010 Link to this post

      
    RadAjaxManager1.ResponseScripts.Add does not solve the problem!

    I tried it like this:

    protected void ProductsMenuTab_Click(object sender, EventArgs e)
        {
            LoadUserControl("uc/ProductsNew.ascx");
            RadAjaxManager1.ResponseScripts.Add("<script type='text/javascript'>coda_side_it();</script>");
            //Literal l = new Literal();
            //l.Text = "<script type='text/javascript'>coda_side_it();</script>";
        }

    but that does not work at all,

    note that I tried it also like this:

    RadAjaxManager1.ResponseScripts.Add(coda_side_it());

    but c# return debugging error, so what shall I do?

    I just wanna invoke javascript method coda_side_it(); after the web user control loaded!
  4. Answer
    Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 01 Nov 2010 Link to this post

    Hello khaled,

    The below code should work for you:

    RadAjaxManager1.ResponseScripts.Add("coda_side_it();");


    Best wishes,
    Iana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top