radconfirm, blockConfirm and AJAX?

5 posts, 0 answers
  1. Rob Heckart
    Rob Heckart avatar
    15 posts
    Member since:
    Jan 2008

    Posted 05 Oct 2009 Link to this post

    I'm using a RadAjaxManager control on a page and have wired it up to several Buttons. An example button is:

    <asp:Button ID="btnSubmitChanges" runat="server" Text="Submit Changes, New Term and/or Comments" OnClick="SubmitChanges" OnClientClick="return blockConfirm('<p><strong><u>WARNING!</u></strong></p><p>More text</p>', event, 650, 200,'','Submit Changes');" Width="300px" /> 

    I'm using the blockConfirm function with the button. I noticed (too late) that there's a line of code in there that seems to get rid of my OnClick argument (callerObj["onclick"] = "").

    The question is how to make the RadConfirm work in this instance. Do I have to break the SubmitChanges code out into a Button click handler?


    Also, is it possible to remove the question mark icon?
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 07 Oct 2009 Link to this post

    Hello Rob,

    This should not be a problem, however to be able to help, I need to have a better view over your exact setup and logic. Please open a support ticket and send me a sample page that shows the problem and I will check it.

    By the way, since you are using RadAjaxManager, you could use ajaxRequestWithTarget for that purpose - then you will not need to change the radconfirm functionality. For your convenience I attached a small sample that shows that approach in action.


    Best wishes,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Rob Heckart
    Rob Heckart avatar
    15 posts
    Member since:
    Jan 2008

    Posted 23 Oct 2009 Link to this post

    I downloaded the small demo and made my code look the same way yours does. But it doesn't update my web form afterwards. I was already using ramTermWorkPage_AjaxRequest to update another part of the UI. In my Ajax Manager, I have:

    <telerik:AjaxSetting AjaxControlID="btnSubmitChanges">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="grdReviewed" /> 
                        <telerik:AjaxUpdatedControl ControlID="grdNotReviewed" /> 
                        <telerik:AjaxUpdatedControl ControlID="grdSavedDrafts" /> 
                        <telerik:AjaxUpdatedControl ControlID="pnlDetails" LoadingPanelID="alpLoading" /> 
                        <telerik:AjaxUpdatedControl ControlID="tabAlpha" /> 
                        <telerik:AjaxUpdatedControl ControlID="grdAllTerms" /> 
                        <telerik:AjaxUpdatedControl ControlID="mnuAddTerm" /> 
                        <telerik:AjaxUpdatedControl ControlID="rptMyReviewedTerms" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 

    My button code looks like this:

    <asp:Button ID="btnSubmitChanges" runat="server" Text="Submit Changes, New Term and/or Comments" 
    OnClientClick="confirmSubmit(this);return false;" Width="300px" OnClick="SubmitChanges" /> 

    When I click the button, I get the radconfirm dialog, code behind AjaxRequest event fires, no controls shown in UpdatedControls update and the SubmitChanges code never fires. I have specific code to update the UI grids, panels, etc. That code is firing code-behind, no update on the web page.

    Private Sub ramTermWorkPage_AjaxRequest(ByVal sender As ObjectByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles ramTermWorkPage.AjaxRequest  
     
            If Not e.Argument.Contains("btnSubmitChanges"Then 
                  
                Dim txtSearch = e.Argument  
     
                tabAlpha.SelectedIndex = -1  
     
                If String.IsNullOrEmpty(txtSearch) Then 
                    grdAllTerms.MasterTableView.Controls(0).Controls.Clear()  
                    Exit Sub 
                End If 
     
                Dim dtAllTerms As DataTable = FilterAllTerms(txtSearch)  
     
                If dtAllTerms.Rows.Count > 0 Then 
                    grdAllTerms.DataSource = dtAllTerms  
                    grdAllTerms.DataBind()  
                Else 
                    grdAllTerms.MasterTableView.Controls(0).Controls.Clear()  
                End If 
            End If 
     
     
        End Sub 

    If I change the AjaxRequest to fire SubmitChanges, the data gets written to the database but again, no UI gets updated even though I'm specifically calling it to. If I can get the UI to update, I'll be good.
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 26 Oct 2009 Link to this post

    Hello Rob,

    Please open a support ticket and send us full, working project where this issue could be reproduced. I am afraid that the provided information is not enough for us to determine what might be the reason for the problem and we need to have a better view over your exact case and logic.


    Best wishes,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. SKS
    SKS avatar
    32 posts
    Member since:
    Aug 2009

    Posted 29 Jan 2010 Link to this post

    hey
    this code doesnt work.
    i am surprised telerik doesnt have a solution for this.
    this is my scenario

    i have an aspx page that has a button
    the button click opens another aspx page in a radwindow
    the radwindow has a button that has a server side handler in code behind.
    when this button is clicked
    some server side code needs to execute(in the code behind)
    in the server side code if a condition is yes then this Radwindow has to open a radconfirm
    based on the user reponse on the radconfirm
    if Yes-Execute some server side code again
    If No-dont do anything

    to summarise

    its a radconfirm in a radwindow and it needs to be invoked from code behind and the user response needs to be captured in code  behind and execute server side code based on the user response.

    i have gone thru 100's of forums for this issue but it amazes me that telerik does not have a neat and clean solution for this.

    Any help from shinu is greatly appreciated

    thanks

    ~sks
Back to Top