Radconfirm causing postback before clicking on OK button

5 posts, 0 answers
  1. Sachin
    Sachin avatar
    5 posts
    Member since:
    Sep 2013

    Posted 03 Mar 2014 Link to this post

    Hi,
    I am using Radconfirm(Telerik Q3 2010) window.But when I am clicking on button and calling radconfirm thread is running as usual without clicking on OK button.
    But what I want is thread should be blocked unless and untill I will not click ok button.
    What I mean is server side event of that button should not fire unless and untill I will click on OK button.
    But currently when I am clicking on button and calling RadConfirm from client side its firing server side event also before clicking on OK buttton.
    Please help.
    Thanks.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Mar 2014 in reply to Sachin Link to this post

    Hi Sachin,

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

    ASPX:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" VisibleOnPageLoad="true">
    </telerik:RadWindowManager>
    <telerik:RadButton ID="RadButton1" runat="server" Text="OpenWindow" AutoPostBack="false"
        OnClientClicking="OpenConfirm" OnClick="RadButton1_Click">
    </telerik:RadButton>

    JavaScript:
    <script type="text/javascript">
        function OpenConfirm() {
            radconfirm("Client radconfirm: Are you sure?", confirmCallBackFn, 300, 300, "Demo", null);
        }
        function confirmCallBackFn(arg) {
            if (arg) {
                __doPostBack("<%= RadButton1.UniqueID %>", "onclick");
            }
        }
    </script>

    C#:
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        Response.Write("Fired");
    }

    Let me know if you have any concern.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sachin
    Sachin avatar
    5 posts
    Member since:
    Sep 2013

    Posted 04 Mar 2014 in reply to Shinu Link to this post

    Hi Shinu,
    Thanks for the reply.
    Yes now unless and untill I am not clicking on OK button main thread is getting blocked.But only issue is with how to find findnig Radbutton control.Because code to find out RadButton control is thrwoing error as:
    Code block <%= RadButton1.UniqueID %>
    Error :"The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)"
    Tried various ways to find out control but not able to resolve it.
    And as not able to find control its firing onclick event of it.
    Thanks in advance.
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Mar 2014 in reply to Sachin Link to this post

    Hi Sachin,

    RadCodeBlock should be used when you have server code blocks placed within the markup (most often some JavaScript functions accessing server controls). Have a look into this help article for further information.

    Thanks,
    Shinu.
  6. Sachin
    Sachin avatar
    5 posts
    Member since:
    Sep 2013

    Posted 07 Mar 2014 in reply to Shinu Link to this post

    Thanks Shinu,
    It works!!!.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017