Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I need to open a radwindow which i defined on aspx page on a button click by using javascript button click i got it open but i need to open this radwindow from server side(code behind ) of aspx page.please help me ?

What I have tried:

Code for radwindow
            <asp:Button ID="Button1" runat="server" Text="Click" />
<telerik:RadWindowManager ID="RadWindowManager2" runat="server">
   <Windows>
     <telerik:RadWindow ID="RadWindow1" runat="server" Width="1000" Height="400"  Modal="true">
        <ContentTemplate>
           <table>
                            <tr>
                                <asp:Label ID="lblFavorite" runat="server" Text="Favorites: "></asp:Label>
                                <asp:TextBox ID="txtReportFavorite" runat="server"></asp:TextBox>
                            </tr>
                            <tr>
                                <asp:Button ID="btnOk" runat="server" Text="OK" Width="50" Height="25"  />
                                <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="50" Height="25"  />
                            </tr>
                        </table>
         </ContentTemplate>
     </telerik:RadWindow>
  </Windows>
</telerik:RadWindowManager>
Posted
Updated 11-Jan-17 1:00am
Comments
Thomas Nielsen - getCore 11-Jan-17 5:36am    
Recommend using telerics own support, they're quite talented!
This is not as such a .net issue as much as it is a component issue from your teleric ui component
Member 11471318 11-Jan-17 6:56am    
Thanks for your valuable comment i already got a solution for this.
F-ES Sitecore 11-Jan-17 5:41am    
You can't execute anything on the client through server-code. If you want the action to happen automatically without the need for a button click then simply add the required js to the page directly rather than in the click event for a button.
Member 11471318 11-Jan-17 6:56am    
Thanks for your valuable comment i already got a solution for this.

1 solution

this is my rad window code
<telerik:RadWindowManager ID="RadWindowManager2" runat="server">
   <Windows>
     <telerik:RadWindow ID="RadWindow1" runat="server" Width="1000" Height="400"  Modal="true">
        <ContentTemplate>
           <table>
                            <tr>
                                <asp:Label ID="lblFavorite" runat="server" Text="Favorites: "></asp:Label>
                                <asp:TextBox ID="txtReportFavorite" runat="server"></asp:TextBox>
                            </tr>
                            <tr>
                                <asp:Button ID="btnOk" runat="server" Text="OK" Width="50" Height="25"  />
                                <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="50" Height="25"  />
                            </tr>
                        </table>
         </ContentTemplate>
     </telerik:RadWindow>
  </Windows>
</telerik:RadWindowManager>


in aspx file a added a javascript function
<script type="text/javascript">
  function openwin() {
                    window.radopen(null, "RadWindow1");
                }
</script>




then on code behind i called that javascript function

ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "openwin()", true);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900