RadConfirm to get value in server side

2 posts, 0 answers
  1. Vitaly
    Vitaly  avatar
    86 posts
    Member since:
    Aug 2011

    Posted 23 Dec 2015 Link to this post

    How to get value from javascript in server side using RadConfirm.

    I have the following code but I am not getting any value in server side:

    here my HTML code:

    function ConfirmCancel() {
    var confirmvalue = false;
    if (!confirmvalue) {
    radconfirm('CANCELLING A REQUEST IS DEFINE AS : When an employee who received original request approval never performed one day of service in the Sixth Period Coverage Program. This action might trigger the recoupment of the original payments', confirmCallBackFn); return false;
    function confirmCallBackFn(arg) {
    var control = $find("<%= inpHide.ClientID%>");
    if (arg) {
    confirmValue = true;
    document.getElementById(control).value = "1";
    else {
    document.getElementById(control).value = "0";


    <input id="inpHide" type="hidden" runat="server" />

    <telerik:GridTemplateColumn HeaderText="Link to Form/Cancel Request" UniqueName="ButtonColumn" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="200px" >
    <ItemTemplate>                                  <
    <asp:ImageButton ID="CancelReqBtn" ImageUrl="~/Image/Cancel_button6.png" runat="server" CommandName="Cancel" ImageAlign="Right" BackColor="Transparent" ToolTip="cancel the request" Width="50px" Height="20px" Visible="false" OnClientClick="return ConfirmCancel();" />



    And here is my code behind:

    if (e.CommandName == "Cancel")
    int result = int.Parse(inpHide.Value);
    if (result == 0)
     But for some reason when I put breakpoint on command name it is not executing.

    Please help me to solve this issue.

    thanks so much

  2. Vasil
    Vasil avatar
    1642 posts

    Posted 24 Dec 2015 Link to this post

    Hello Vitaly,

    Could you clarify what does not execute:
    • The GridItemCommand is not called?
    • The CommandName is wrong?
    • Or the inpHide.Value is wrong?

    If the ItemComand is not called, make sure you have attached correctly the grid's ItemCommand event.

    If the CommandName is wrong, make sure you click the correct button. Since in the markup you have set Visible="false" for this CancelReqBtn. Please confirm that there is not another button that is visible and clickable but with different command.

    A wrong value of inpHide can be caused by updating the RadGrid using UpdatePanel, if the inpHide is outside the UpdatePanel. So during the request inpHide's value is not sent to server.

    If the problem is not caused by any of the suggested possible causes. Please try to insulate it in sample page so we can debug it and provide further assistance.

    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 Feedback Portal and vote to affect the priority of the items
Back to Top