Pass value to rad window

3 posts, 0 answers
  1. Rahul
    Rahul avatar
    142 posts
    Member since:
    May 2009

    Posted 17 Jun 2009 Link to this post

    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. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 17 Jun 2009 Link to this post

    Rahul,

    Have a look at this documentation entry.

    You might also find this demo helpful.

    --
    Stuart
  3. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Jun 2009 Link to this post

    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
Back to Top