Button Click event not firing

8 posts, 0 answers
  1. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009

    Posted 26 Apr 2010 Link to this post

    Hi

    I have a pop up modal Radwindow, the page has a  button control on in a panel, with a label. The panel is hidden until the users make a selection.

    Then they are asked to confirm by clicking the button. I'm using RadAjaxManager to show the panel but the click event does not appear to fire.

    What should happen is a block of code runs on the server and then runs this:

    ClientScript.RegisterStartupScript(Page.GetType(),

    "mykey", "CloseAndReload();", True)

     

     


    to close the radwindow and refresh the main grid.

    It all works fine if I remove the AJAX.

    UPDATE
    The button event does fire, but its the

    ClientScript.RegisterStartupScript(Page.GetType(),

    "mykey", "CloseAndReload();", True) that does not.

     



    Andy



  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 26 Apr 2010 Link to this post

    Hello Andy,
     
    Please note that adding hidden controls to the RadAjaxManager settings is unsupported scenario. In order to have the application works properly you should wrap the hidden controls into always visible panel.
    I hope this helps.

    Greetings,
    Maria Ilieva
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009

    Posted 27 Apr 2010 Link to this post

    I've tried that and it still wont run the ClientScript.Register ... code.

    Here is my new markup:
                            <asp:Panel ID="pnlHiddenContainer" runat="server">  
                                <asp:Panel ID="pnlDetails" runat="server" CssClass="PatientDetails" Visible="false">  
                                    <asp:Literal ID="ltlDetails" runat="server"></asp:Literal> 
                                    <asp:Button ID="btnConfirm" runat="server" Text="Confirm" TabIndex="12"  CssClass="formbtnL"/>  
                                 </asp:Panel> 
                            </asp:Panel> 

    Andy
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 27 Apr 2010 Link to this post

    Hi Andy,

    Please confirm that you have also changed the RadAjaxSettings, so the always visible pnlHiddenContainer is added as target control.


    Sincerely yours,
    Maria Ilieva
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009

    Posted 27 Apr 2010 Link to this post

    Hi

    Yes it is, the panel updates from the grid (as before the hidden panel updated from the grid ok)

    Its the :

    ClientScript.RegisterStartupScript(Page.GetType(),

    "mykey", "CloseAndReload();", True) that wont run from the btnConfirm_click event. The btnConfirm is inside the hidden panel inside the container panel.

     


    Here is my Rad Ajax markup.
        <telerik:RadAjaxManager ID="AjaxManager" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="btnLookup">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="pnlHiddenContainer" /> 
                        <telerik:AjaxUpdatedControl ControlID="lblStatus" /> 
                        <telerik:AjaxUpdatedControl ControlID="lblGridStatus" /> 
                        <telerik:AjaxUpdatedControl ControlID="gridResults" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="gridResults">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="pnlHiddenContainer" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
       </telerik:RadAjaxManager> 

    And here is the portion of my btnConfirm_Click:
     Protected Sub btnConfirm_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnConfirm.Click  
     
            Try  
     
     
                Dim c As New Referral  
                Dim OKt = c.ConfirmReferral(...Params...)  
     
                If OKt Then  
                    ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndReload();", True)  
                Else  
                    Me.lblStatus.Visible = True 
                    Me.lblStatus.Text = "Save Failed" 
                End If  
     
            Catch ex As Exception  
                lblStatus.Text = "Save failed " & ex.Message  
            End Try  
     
        End Sub 

    ANdy
  7. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 28 Apr 2010 Link to this post

    Hi Andy,

    Please review the following help topic which elaborates on executing java script after ajax request. Test the provided solution and let us know if this helps.


    Greetings,
    Maria Ilieva
    the Telerik team


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Rafaga2k
    Rafaga2k avatar
    14 posts
    Member since:
    Nov 2010

    Posted 15 Dec 2010 Link to this post

    i have the same problem (1st post) and tried to make a panel to group a raddock that is closed but no success

    <asp:Panel ID="usrdockpanel" runat="server">
            <telerik:RadDock ID="RadDock1" runat="server" Width="400px" Closed="True" Style="z-index: 2410;">
                <ContentTemplate>
                    <!-- here is the Form Code (really not relevant) -->
                    <div class="footer">
                        <asp:Button runat="server" ID="cbtnGuardar" Text="Guardar" OnClick="SubmitButton_Click"
                            OnClientClick="return hideForm()" /> <!-- This is the button that i want to capture the click -->
                        <button onclick="javascript:hideForm();" type="button">
                            Cancelar</button>
                    </div>
                </ContentTemplate>
            </telerik:RadDock>
    </asp:Panel>

    Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.grd, Me.grd)
    Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.grd, Me.usrdockpanel)
    Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.usrdockpanel, Me.usrdockpanel)
    Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.usrdockpanel, Me.grd)

    which is the rigth ajax setting?
    • i want that when a command button is pressed a raddock appears (i already did this)
    • modify asp hidden fields via manager (Edit: I have solved this iusse)
    • when button in raddock is pressed then the grid is updated
    any ideas ???

    my problem with hidden fields and buttons was onClientClick event was returning true
  9. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 20 Dec 2010 Link to this post

    Hi,

    The setting in which the RadDock wrapper updates itself should handle the required functionality. As the described explanation is not enough to isolate the root cause of the issue you are facing , please open a regular support ticket and send us fully runnable application. Thus we will be able to debug it locally and advise you further.

    Kind regards,
    Maria Ilieva
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017