Thursday, November 24, 2011

Open RadWindow from server side programming


Problem: How to open RadWindow from server side programming
Solution: It is very simple and can be done in following steps,
Step1: Create a ASPX Page which will be open as RadWindow in project e.g "Windowsvb.aspx"
The Page Must Be On Same Directory Where Your Current Page(Calling Rad Window) e.g "Default.aspx" Exist . Not Neccessary But The Code Bellow Work On This Condition

Step2: In Your Current Page "Default.aspx.vb" Write The Function.Given bellow
Protected Sub CreateWindowScript() 
        Dim window1 As New RadWindow()
        window1.NavigateUrl = "Windowsvb.aspx" ' The Path  Be Same As Created In Project
        window1.VisibleOnPageLoad = True
        window1.Width = 950
        window1.Height = 700
        window1.Modal = True
        window1.Behaviors = WindowBehaviors.Close 
        window1.Visible = True
        window1.VisibleOnPageLoad = True
        window1.AutoSize = False
        window1.VisibleStatusbar = True 
        Me.form1.Controls.Add(window1)
End Sub

'You can call this function from any event e.g Click Button Event etc

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        CreateWindowScript()
End Sub


'The DOM Which IS calling This Function Must Not BE In RadAjaxManager OR RadAjaxPanel

No comments:

Post a Comment