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

open a aspx page at Radwindow and passing a value by querystring from a button click event

5 Answers 382 Views
Window
This is a migrated thread and some comments may be shown as answers.
Debashis Pyne
Top achievements
Rank 1
Debashis Pyne asked on 09 Jul 2010, 04:23 PM
Hi,
I would like to open a aspx page at Radwindow and passing a value by querystring from a button click event.
Without querystring , I was successful , but stuck-up at passing the value.

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 <script type="text/javascript">
    function ShowAddSubLevel(id) {
    window.radopen("AddCausePopup.aspx?Cause_Id=" + id, "UserListDialog");
    return false;
</script>
</telerik:RadCodeBlock>
--------------------------------------------
<asp:Panel ID="pnlShowCompany" runat="server">
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behaviors="Close, Move, Reload">
  <Windows>
     <telerik:RadWindow ID="UserListDialog" runat="server" Title="Manage actions" Height="610px"
       Width="575px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" VisibleStatusbar="false" Animation="Fade" />
       </Windows>
        </telerik:RadWindowManager>
          </asp:Panel>
protected void BtnAddSublevel_Click(object sender, EventArgs e)
    {
................
............
 Cause_Id = Convert.ToInt32(DtCause1.Rows[0][0].ToString());
...............
...............
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "ShowAddSubLevel(21);", true);
}
---------------------------------------------
First of all, I am not sure how to pass Cause_Id at ShowAddSubLevel(Cause_Id)??
and even statically RadWindow is not showing.

Please help me out.

Thanks,
Debasish

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Jul 2010, 10:11 AM
Hi Debasish,


A better approach (in your scenario) would be showing the window from code behind instead of calling a client function.

C#:
protected void Button1_Click(object sender, EventArgs e)
{
    string Cause_Id = DtCause1.Rows[0][0].ToString();
    UserListDialog.NavigateUrl = "AddCausePopup.aspx?Cause_Id=" + Cause_Id;
    UserListDialog.VisibleOnPageLoad = true// Set the VisibleOnPageLoad property to True
}


If you still want to call the client method, then follow the approach described in the KB Article and pass the parameter to the client method.
Calling radalert from codebehind


Do not hesitate to write again if you are experiencing any problem in implementing this.

Regards,
Shinu.
0
Varun
Top achievements
Rank 1
answered on 13 Nov 2013, 10:37 AM
Hi,
I have apply a master page to rad window....
In Master Page there is a user control which containg Hyperlink ...
I want to redirect to plane .aspx page from hyperlink and want to close the radwindow..
Pls let me know solution for above....


0
Shinu
Top achievements
Rank 2
answered on 14 Nov 2013, 06:44 AM
Hi Varun,

Please have a look into the following code snippet to achieve your scenario.

MasterPage ASPX:
<telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true">
    <ContentTemplate>
        <uc1:WebUserControl ID="WebUserControl1" runat="server" />
    </ContentTemplate>
</telerik:RadWindow>

UserControl Page ASPX:
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/RadAsyncUpload/Detailsingrid.aspx"
    Text="URL" onclick="return closeWin();">
</asp:HyperLink>

UserControl Page JavaScript:
<script type="text/javascript">
    function closeWin() {
        GetRadWindow().close();
    }
    function GetRadWindow() {
        var oWindow = null; if (window.radWindow)
            oWindow = window.radWindow; else if (window.frameElement.radWindow)
            oWindow = window.frameElement.radWindow; return oWindow;
    }
</script>

Thanks,
Shinu
0
Varun
Top achievements
Rank 1
answered on 14 Nov 2013, 07:44 AM
Hi Shinu,

Thanks for ur reply...

I have used above code... The rad window get closed but it can not redirect to the .aspx page....

I have used the Use control in Master page .... and master apply to the Rad winow....

 Please see the below code ---

 

<asp:HyperLink ID="HyLnkSysAcc" runat="server" Font-Underline="True"

ForeColor="Black" NavigateUrl="~/PRJ/ABC.aspx" onclick="CloseRadwindow();">[HyLnk] </asp:HyperLink>

function CloseRadwindow()
    {
      var oWindow = null;
      if (window.radWindow)
          oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
            oWindow = window.frameElement.radWindow;
        oWindow.Close();
        oWindow.BrowserWindow.location.href = '/PRJ/ABC.aspx';  --   if I have remove this line ... The rad window get closed but Navigate functionality fail...     
    }

your comments pls....

0
Shinu
Top achievements
Rank 2
answered on 14 Nov 2013, 12:36 PM
Hi Varun,

The code I posted above is working fine at my end. Are you getting any error on clicking the ASP HyperLink? Can you please elaborate a bit more on what you mean by 'master apply to the RadWindow' along with the full code you tried?

Thanks,
Shinu.
Tags
Window
Asked by
Debashis Pyne
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Varun
Top achievements
Rank 1
Share this question
or