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

Javascript code is not working inside a Telerik RadAjaxPanel

1 Answer 230 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rasadul Alam
Top achievements
Rank 1
Rasadul Alam asked on 01 Mar 2011, 08:03 AM
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 = "window.open('http://example.org/NewPage.aspx', '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

1 Answer, 1 is accepted

Sort by
0
Prangadj
Top achievements
Rank 1
answered on 01 Mar 2011, 02:05 PM
First, insert js code inside RadScriptBlock to be executed after ajax request inside updated panel. And register this script in asp.net ajax way, with ScriptManager.RegisterClientScriptBlock instead of Page.ClientScript.

Prangadj
Tags
General Discussions
Asked by
Rasadul Alam
Top achievements
Rank 1
Answers by
Prangadj
Top achievements
Rank 1
Share this question
or