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

Pass value to rad window

2 Answers 608 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 17 Jun 2009, 08:34 AM
I hv open the rad window from code behind

Protected Sub imgmail_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgmail.Click

            Dim rptWindows As Telerik.Web.UI.RadWindow = New Telerik.Web.UI.RadWindow()
            rptWindows.NavigateUrl = "reportMail.aspx"
            Form1.Controls.Add(rptWindows)
            rptWindows.Height = 535
            rptWindows.Width = 500
            rptWindows.BorderColor = Drawing.Color.BlueViolet
            rptWindows.BorderStyle = BorderStyle.Solid
            rptWindows.Modal = False
            rptWindows.VisibleStatusbar = False
            rptWindows.Behavior = WindowBehaviors.Close Or WindowBehaviors.Move
            rptWindows.VisibleOnPageLoad = True

     
        End Sub
    End Class




I need to pass some argument when rad window open pass some id, name, orgid ? and the radwindow contain textbox when i pass value that time the id is diplay in textbox how to do this ?

help me urgent

2 Answers, 1 is accepted

Sort by
0
Stuart Hemming
Top achievements
Rank 2
answered on 17 Jun 2009, 09:09 AM
Rahul,

Have a look at this documentation entry.

You might also find this demo helpful.

--
Stuart
0
Shinu
Top achievements
Rank 2
answered on 17 Jun 2009, 10:09 AM
Hi Rahul,

You can use the window URL to pass parameters that are read on the server-side to configure the controls inside the window. See the code snippet below.

CS in parent page for opening window:
 
protected void Button1_Click(object sender, EventArgs e) 
    string id = "My ID"
    string name = "My Name"
    string orgid = "My OrgId"
    RadWindow winwdw = new RadWindow(); 
    winwdw.NavigateUrl = "ServerCode_window.aspx?id=" + id + "&Name=" + name + "&orgid=" + orgid; // Set Url with parameters 
    . . .  

In the dialog page you can access the parameters that you send from the Request object in the Page_Load method.
CS:
 
protected void Page_Load(object sender, EventArgs e) 
    if (Request["id"] != null && Request["Name"] != null && Request["orgid"] != null
    { 
        TextBox1.Text = Request["id"]; 
        TextBox2.Text = Request["Name"]; 
        TextBox3.Text = Request["orgid"]; 
    } 
Checkout the demo given in the above post that shows how to pass the values and getting in window page.

Thanks,
Shinu
Tags
Window
Asked by
Rahul
Top achievements
Rank 1
Answers by
Stuart Hemming
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Share this question
or