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

RadWindow Data in aspx page

1 Answer 140 Views
Window
This is a migrated thread and some comments may be shown as answers.
DEBAL
Top achievements
Rank 1
DEBAL asked on 25 Mar 2012, 03:55 PM
Hi Support
I'm using RadWindow  and create one web user control in the name of controlconfigure.ascx page . In this page I have one button and Radwindow. When button click PopUp window is show. In the Radwindow I have  some textboxes and two button e.g. submitt and close . Upto now it is fine .

This control is going use in default.aspx page .

Now when user have enter some information to the textboxes and click submitt button in Popup window . All the value should display to a label (for simplicity) in Default.aspx page . How can I get value ? Here is the code  in Default.aspx:

 <asp:Label runat="server" Text="Value"></asp:Label>
<td>
      <ctrlconfig:Configuration ID="Configuration" runat="server" />
</td>

In this page How can I get Value from PopUp Window?



1 Answer, 1 is accepted

Sort by
0
DEBAL
Top achievements
Rank 1
answered on 26 Mar 2012, 01:24 PM
HI
Lastly I Solve my problem,  Actually the tittle should be  "How to use RadWindow using ascx control."  sorry for that , I have solve the problem using Session , here is the full code :

Ist code is How I use RadWindow in a new web User Control i.e. ascx page :

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Configuration.ascx.cs"
    Inherits="TelerikPopUpWebProject.Control.Configuration" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 <telerik:RadScriptManager runat="server" ID="ScriptManager">
    </telerik:RadScriptManager>
    <telerik:RadWindowManager runat="server" Modal="True" EnableViewState="False" Windows="RadWindow1" ID="radmanager">
        <Windows>
            <telerik:RadWindow ID="RadWindow1" Animation="Fade" Behaviors="Close" VisibleStatusbar="False" 
                OnClientClose="OnClientClose" runat="server" Height="300" Width="400">
                <ContentTemplate>
                      <table>
                        <tr>
<td>
 <asp:Button ID="Button3" runat="server" Text="Submitt" OnClick="Submitt_Click" />
                              ...............
 </table>
                </ContentTemplate>
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <asp:Button ID="Button1" runat="server" Text="PopUp" OnClick="Button1_Click" /> /* 
See this button is used to PopUp rad Window ,
*/

Up to now my user control is ready . When this control is going to use this suppose in default.aspx page and user click on the PopUp button the RadWindow should show . In the Window , there is some textboxes, colorpicker control ...etc and two button in the name of Submitt and Cancel .

After Click on the Submit button all the data that user enter should come in my default page textbox or in a label or in other place.

To do that I take help of Session in my web user ascx control's code behind page (I mean the code behind of the above page where I write all the above code in design page).

protected void Submitt_Click(object sender, EventArgs e)
        {
            Session["alttextbox"] = this.alttextbox.Text;
            Session["longtextbox"] = this.longdesctextbox.Text;
            if (this.RadColorPicker.SelectedColor.Name != "0")
            {
                Session["RadColorPicker"] = this.RadColorPicker.SelectedColor.Name;
            }
          
 Response.Redirect("Default.aspx"); //// this is I done so that the main page where this control is going to use 
//should refresh the page , I mean for postback
        }

Now I come in my deafult.aspx page , and here I write the below code and all data are displayed in my textboxes........

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script runat="server">  
    
        protected void Page_Load(object sender, System.EventArgs e)
        { 
          if (Session["alttextbox"] != null && Session["alttextbox"] != string.Empty)
            {
                inputradtextbox.Text = "alt :" + Session["alttextbox"];
            }
          if (Session["longtextbox"] != null && Session["longtextbox"] != string.Empty)
            {
                inputradtextbox.Text += ";" + "description :" + Session["longtextbox"];
            }
          if (Session["RadColorPicker"] != null && Session["RadColorPicker"] != string.Empty)
            {
                inputradtextbox.Text += ";" + "BackgroundColor :" + Session["RadColorPicker"];
            }
    ...............................
        }  
 
 </script>
</asp:Content>
   

I have done this way , pl reply me if you do it much more better way than me .
Thanks
 

                            


Tags
Window
Asked by
DEBAL
Top achievements
Rank 1
Answers by
DEBAL
Top achievements
Rank 1
Share this question
or