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

Radwindow opens on click of any button

5 Answers 145 Views
Window
This is a migrated thread and some comments may be shown as answers.
Big Daftie
Top achievements
Rank 1
Big Daftie asked on 26 Sep 2008, 11:45 AM
Hi there,

Having a problem with RadWindow - I have used the code outlined in your KB article http://www.telerik.com/support/kb/article/b454K-tgh-b454T-cee-b454c-cee.aspx (VB.net code) to open a radwindow to show upload progress. This control is tied in to an asp.net Create User Wizard to upload an image, which works fine.

However, when I then complete the account creation of the User Wizard control, the RadWindow fires again, showing upload progress for the image previously uploaded - what am I doing wrong?

thanks for any help anyone can provide!

5 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 29 Sep 2008, 02:38 PM
Hi,

To be able to help, we will need more information on your exact setup and the code that you have used. Please open a support ticket and send us a small sample project where the problem can be reproduced.

Just make sure that the project can be run locally and attach it to the support ticket - we will check it right away.


Kind regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
GP
Top achievements
Rank 1
answered on 11 Apr 2011, 01:47 PM
Was there a good answer for this one?  I am having the same behavior:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox1" />
                    <telerik:AjaxUpdatedControl ControlID="MatOM" />
                    <telerik:AjaxUpdatedControl ControlID="SigRptErr" />
                    <telerik:AjaxUpdatedControl ControlID="FinRev" />
                    <telerik:AjaxUpdatedControl ControlID="Complete" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
 
    </telerik:RadAjaxManager>     
     
    <telerik:RadCodeBlock ID="rcb1" runat="server">
        <script type="text/javascript">
            function ShowInsertForm() {
                var combo = $find("<%= RadComboBox1.ClientID %>");
                var comboItem = combo.get_selectedItem();
                if (!comboItem) {
                    window.radopen("AddComment.aspx", "UserListDialog");
                }
                else {
                    var string = comboItem.get_text();
                    window.radopen("AddComment.aspx?ID=" + comboItem.get_value(), "UserListDialog");
                }
                return false;
            }
            function refreshGrid() {
 
                radalert("Comment Added");
            }
        </script>
    </telerik:RadCodeBlock>         
     
    <telerik:RadComboBox ID="RadComboBox1" Runat="server" Skin="WebBlue"
                        Width="550px" AutoPostBack="True" EnableLoadOnDemand="True"
                        OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged" MaxHeight="350px"
                        AllowCustomText="true" EmptyMessage="Select a Grant" Filter="Contains">
                    </telerik:RadComboBox>
    <br />
 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" HorizontalAlign="Center" Visible="false">
            <p>
            <asp:Label runat="server" ID="lblResult" Font-Bold="true" Font-Size="Medium"></asp:Label>
            </p>
         
       <asp:Table ID="TechMonitor" runat="server" CssClass="mytable" Caption="Technical Monitor"
                GridLines="Both" Font-Size="Smaller" HorizontalAlign="Center" Width="40%">
        <asp:TableHeaderRow>
            <asp:TableHeaderCell HorizontalAlign="Center">Name</asp:TableHeaderCell>
            <asp:TableHeaderCell HorizontalAlign="Center">Email</asp:TableHeaderCell>
            <asp:TableHeaderCell HorizontalAlign="Center">Phone</asp:TableHeaderCell>
        </asp:TableHeaderRow>
        <asp:TableRow>
                <asp:TableCell HorizontalAlign="Center">
                    <asp:Label ID="TMName" runat="server" Text=""></asp:Label>
                </asp:TableCell>
                <asp:TableCell HorizontalAlign="Center">
                    <asp:Label ID="TMEmail" runat="server" Text=""></asp:Label>
                </asp:TableCell>
                <asp:TableCell HorizontalAlign="Center">
                    <asp:Label ID="TMPhone" runat="server" Text=""></asp:Label>
                </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
 
       <div style="text-align:center">
     <telerik:RadButton ID="AddComment" runat="server"
                        AutoPostBack="false" Text="Add Comment" CommandName="Right" OnClientClicked="ShowInsertForm()" Skin="WebBlue">
                    </telerik:RadButton>
    <telerik:RadButton runat="server" ID="btnUpdate" Skin="WebBlue" Text="Update Recipient"></telerik:RadButton>
    </div>
    </telerik:RadAjaxPanel>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" Skin="WebBlue">
        <Windows>
            <telerik:RadWindow ID="UserListDialog" runat="server" Title="Add Comment" Width="755px" Height="460px"
                ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" />
        </Windows>
    </telerik:RadWindowManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" skin="WebBlue" >
    </telerik:RadAjaxLoadingPanel>

Any help would be greatly appreciated.
0
Marin Bratanov
Telerik team
answered on 13 Apr 2011, 02:48 PM

Hi Genie,

Please set the OnClientClicked handler of the RadButton to the name of the JavaScript function without the parentheses: 

<telerik:RadButton ID="AddComment" runat="server" AutoPostBack="false" Text="Add Comment"
                CommandName="Right" OnClientClicked="ShowInsertForm" Skin="WebBlue">

The RadControls for ASP.NET AJAX take as an argument only the name of the function, while the parentheses cause it to be executed every time the tag is parsed (that is on every postback or callback), which ultimately causes your issue.



Kind regards,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
GP
Top achievements
Rank 1
answered on 13 Apr 2011, 02:52 PM
I tried that, but it requires two clicks to fire the "ShowInsertForm" Event.  The first click isn't working.

<telerik:RadButton ID="AddComment" runat="server" OnClientClicked="ShowInsertForm"
                   AutoPostBack="false" Text="Add Comment" Skin="WebBlue">
               </telerik:RadButton>
0
GP
Top achievements
Rank 1
answered on 13 Apr 2011, 03:43 PM
Never Mind.  I had to add the button to the ajax manager to make it wireup properly:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" EnablePageHeadUpdate="False">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox1" />
                    <telerik:AjaxUpdatedControl ControlID="MatOM" />
                    <telerik:AjaxUpdatedControl ControlID="SigRptErr" />
                    <telerik:AjaxUpdatedControl ControlID="FinRev" />
                    <telerik:AjaxUpdatedControl ControlID="Complete" />
                    <telerik:AjaxUpdatedControl ControlID="AddComment" />                    
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>


    </telerik:RadAjaxManager>  
Tags
Window
Asked by
Big Daftie
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
GP
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or