Executing Javascript

5 posts, 0 answers
  1. Shane
    Shane avatar
    91 posts
    Member since:
    Mar 2007

    Posted 25 Sep 2007 Link to this post

    Hi Guys

    I am using User Control wrapped with an update panel. I using master page. When I click a button in the user control, it just update some details.
    (One master page with a user control to display messages and a page with another user control)

    My problem is, I have a user control in the master page which show the result if is successful, but this user control is not in the update panel.

    I used a javascript function to display the message before. Now I have put the other user control inside a update panel.

    My question is, how do I execute a javascript code when an operation is successful from code behind? Can I pass back parameter from code behind to update panel, so the update panel can execute javascript according to the result?


    Cheers
    Shane
  2. John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 27 Sep 2007 Link to this post

    hi

    Shane, could you please try using the ResponseScripts property of your AjaxPanel

    RadAjaxPanel1.ResponseScripts.Add("alert('hello script!');");

    For more information on this property check out the ajax documentation

    aLl ThE BeSt...
    <John Pell />
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shane
    Shane avatar
    91 posts
    Member since:
    Mar 2007

    Posted 27 Sep 2007 Link to this post

    Hi John

    The user controls is wrapped by RadAjaxPanel. I don't know how I can access the RadAjaxPanel from user control.

    I need to fire up the Javascript  function from the event inside the user control.

    Cheers
    Shane
  5. David Silveria
    David Silveria avatar
    234 posts
    Member since:
    May 2006

    Posted 28 Sep 2007 Link to this post

    You can setup a public property for the AjaxPanel and access it in your user control.

    Cheers
  6. Shane
    Shane avatar
    91 posts
    Member since:
    Mar 2007

    Posted 28 Sep 2007 Link to this post

    Thanks for help guys. I have achieved what I wanted.

    Thanks again guys!

    Cheers
    Shane
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017