This is a migrated thread and some comments may be shown as answers.

how to client click event for button used in RadAjaxManager

3 Answers 87 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
khaled jendi
Top achievements
Rank 1
khaled jendi asked on 23 Sep 2010, 10:24 AM
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?

3 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 28 Sep 2010, 10:51 AM
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
0
khaled jendi
Top achievements
Rank 1
answered on 29 Oct 2010, 10:42 AM
  
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!
0
Accepted
Iana Tsolova
Telerik team
answered on 01 Nov 2010, 03:58 PM
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
Tags
Ajax
Asked by
khaled jendi
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
khaled jendi
Top achievements
Rank 1
Share this question
or