Javascript code is not working inside a Telerik RadAjaxPanel

2 posts, 0 answers
  1. Rasadul Alam
    Rasadul Alam avatar
    1 posts
    Member since:
    Jul 2010

    Posted 01 Mar 2011 Link to this post

    JavaScript code is not working inside a RadAjaxPanel

    I have used a telerik RadAjaxPanel. Insdie this panel I have a button. I want to open a new window using javascript code by clicking this button. My code is shown below:

    string script = "'', 'new_window');";
    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Open window", script, true);

    NB:This code is written in .cs page and this are C# code.
     If i use the button outside the RadAjaxPanel then it works nicely.

    Thanks in advance
  2. Prangadj
    Prangadj avatar
    174 posts
    Member since:
    Jan 2008

    Posted 01 Mar 2011 Link to this post

    First, insert js code inside RadScriptBlock to be executed after ajax request inside updated panel. And register this script in ajax way, with ScriptManager.RegisterClientScriptBlock instead of Page.ClientScript.

Back to Top