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

Radconfirm causing postback before clicking on OK button

4 Answers 255 Views
Window
This is a migrated thread and some comments may be shown as answers.
Sachin
Top achievements
Rank 1
Sachin asked on 03 Mar 2014, 11:23 AM
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.

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Mar 2014, 05:19 AM
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.
0
Sachin
Top achievements
Rank 1
answered on 05 Mar 2014, 04:27 AM
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.
0
Shinu
Top achievements
Rank 2
answered on 05 Mar 2014, 10:31 AM
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.
0
Sachin
Top achievements
Rank 1
answered on 07 Mar 2014, 07:39 AM
Thanks Shinu,
It works!!!.
Tags
Window
Asked by
Sachin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Sachin
Top achievements
Rank 1
Share this question
or