Hello -- I am not having any luck with opening a popup. My code is listed below.
Can someone please help? I get an error - 'Unable to get property "open" of undefined or null reference
Thanks, Raka.
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function editInfo() {
if (confirm('Are you sure you want to do this?'))
return window.radopen('/Folder/Edit.aspx', 'rwGeneric');
}
</script>
</telerik:RadCodeBlock>
7 Answers, 1 is accepted
I tested the provided code but the window gets opened proeprly on my side. Please note, that the radopen function requires the RadWindowManager to exist on the page, even though you do not explicitly reference it in your code. Can you verify that you have RadWindowManager declared?
The code I used for my test is:
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
></
telerik:RadWindowManager
>
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
Text
=
"Show Window"
AutoPostBack
=
"false"
OnClientClicked
=
"editInfo"
></
telerik:RadButton
>
<
script
>
function editInfo() {
if (confirm('Are you sure you want to do this?'))
return window.radopen('/Folder/Edit.aspx', 'rwGeneric');
}
</
script
>
Regards,
Vessy
Telerik
Oh sorry, I forgot one important piece of information. It does work with button click. But I need to call it from server code using RegisterStartupScript. I have tried the following three methods. Each opens the window but the popup disappears as soon as it opens.
Thanks
string radalertscript = "<script language='javascript'>function f(){radalert('Welcome to RadWindow for <strong>ASP.NET AJAX</strong>!', 330, 210); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", radalertscript);
//string script = "<script language='javascript'>function f(){radalert('Welcome to RadWindow for <strong>ASP.NET AJAX</strong>!', 330, 210); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
//Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", script);
////string script = "function f(){editClassification(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
////ScriptManager.RegisterStartupScript(this, GetType(), "key", script, true);
Hello
I have modified code to execute JS on btn_Click. Please see below.
But if I return 'false' from JS, it shows the popup as disabled and the wheel on front goes round and round as if it is trying to load something and never finishes. So I cannot access the popup window.
If I return 'true' or return nothing from JS, then the popup shows and disappears quickly after loading.
Please help.
Thanks, Raka
Event --
<asp:Button ID="btnSave" runat="server" Text="Save" OnClientClick="editInfo();" OnClick="btnSave_Click" ValidationGroup="ValidationSummary1" />
JS --
function editInfo() {
if (confirm('Are you sure you want to do this?')) {
window.radopen('/Folder/EditPopup.aspx?ParentControlId=<%= ClientID %>_SelectedInfoString', 'rwGeneric');
RadWindow's object is created entirely on the Client, this is why it is not persisted after a PostBack is made on the page (the sample from your latest post).
Please, examine the following article demonstrating the whole configuration needed to call RadWindow (or its dialogs) from the server side and let me know the results:
http://www.telerik.com/support/kb/aspnet-ajax/window/details/calling-radalert-from-codebehind-%28all-versions-of-radwindow%29
Regards,
Vessy
Telerik
Hi
Can anyone help how to use url while open pdf file radopen
Java Script
function openPdf_1(sender, args) {
var radwindow1 = radopen("http://192.168.2.157/AD, K-107 11.06.2013, DDR# 10.pdf", null);
radwindow1.SetTitle("Test");
radwindow1.set_width("500");
radwindow1.set_height("500");
radwindow1.center();
}
It give error file or Directory 404 I had given Everyone Read and write permission
thank you
Hi Madja,
Can you try the suggestions form the following article and see what the result will be?
Please, make sure as well that you have given all permissions to the Telerik handlers as well:
https://docs.telerik.com/devtools/aspnet-ajax/general-information/troubleshooting/web-resources-troubleshooting#unauthorized-access-401-error
<configuration>
...
<location path="Telerik.Web.UI.WebResource.axd">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Telerik.Web.UI.DialogHandler.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="ScriptResource.axd">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="WebResource.axd">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
...
</configuration>
Regards,
Vessy
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.