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

RegisterStartupScript or RegisterClientScriptBlock

3 Answers 191 Views
Window
This is a migrated thread and some comments may be shown as answers.
Gourangi
Top achievements
Rank 1
Gourangi asked on 27 Aug 2008, 08:32 AM
Hi,

I want to show a radconfirm dialog which will be written via RegisterClientScriptBlock or RegisterStartupScript.
I dont know what is wrong but I am facing some javascript error.

Regards,

Divyesh Chapaneri

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 27 Aug 2008, 02:47 PM
Hi Divyesh,

Basically, outputting a JavaScript code from the codebehind is a general task that is not related to the RadWindow control - there are numerous resources on the Net that show how to do that. You can also check the following KB article which describes possible approaches for calling radalert (the logic when using radconfirm() is the same):
http://www.telerik.com/support/kb/article/b454K-gtd-b454T-cec-b454c-cec.aspx



All the best,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Gourangi
Top achievements
Rank 1
answered on 28 Aug 2008, 04:41 AM
hi,

I am facing same problem in your given example. I have tried below code and its throwing javascript error when showing radalert !
I am using RadControls for ASPNET AJAX Q1 2008 (for your reference).

ASPX CODE

    <form id="form1" runat="server">
        <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" />
        <telerik:radwindowmanager id="RadWindowManager1" runat="server" />
        <asp:Button ID="Button1" Text="Postback and show RadAlert" runat="server" OnClick="Button1_Click" />
    </form>

CODE BEHIND

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim radalertscript As String = "<script language='javascript'> window.onload = function(){radalert('Welcome to Rad<b>window</b>!', 330, 210);}</script>"
        Page.ClientScript.RegisterStartupScript(Me.[GetType](), "radalert", radalertscript)
    End Sub

Thanks,
Divyesh Chapaneri
0
Gourangi
Top achievements
Rank 1
answered on 28 Aug 2008, 05:36 AM
Ok

Things working fine now, it was Sys.Application.add_load instead of window.onload.

Thanks
Tags
Window
Asked by
Gourangi
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Gourangi
Top achievements
Rank 1
Share this question
or