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

RadConfirm to get value in server side

1 Answer 165 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vitaly
Top achievements
Rank 1
Iron
Iron
Vitaly asked on 23 Dec 2015, 04:20 PM

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();" />

</ItemTemplate>
</telerik:GridTemplateColumn>

 

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

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 24 Dec 2015, 08:54 AM
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.

Regards,
Vasil
Telerik
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
Tags
General Discussions
Asked by
Vitaly
Top achievements
Rank 1
Iron
Iron
Answers by
Vasil
Telerik team
Share this question
or