Hi,
I have a radtabstrip working as a wizard.
I have 4 tabs with a back and continue radbuttons on each. On the last page I have a back and submit button instead of a continue.
I wanted to add an alert msg on the submit button.
When i try to add the onclientclicked it tries to load the function on the continue of previous page.
I am unable to figure out the issue.
Please help.
I have attached the html for both the pages.
Page 1
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucContingentDesignation.ascx.cs"
Inherits="ucContingentDesignation" %>
<div id="ContingentDesignation">
<div>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<th align="left">
Step 3 - Contingent Designation
</th>
</tr>
<tr>
<td>
<div>
<telerik:RadGrid ID="rgContingentBeneficiary" runat="server" ImagesPath="../../App_Themes/MBen/Grid"
EnableEmbeddedSkins="false" Skin="MBen" AllowPaging="True" AllowSorting="True"
ShowFooter="true" GridLines="None" OnNeedDataSource="rgContingentBeneficiary_NeedDataSource"
OnInsertCommand="rgContingentBeneficiary_InsertCommand" OnUpdateCommand="rgContingentBeneficiary_UpdateCommand"
OnDeleteCommand="rgContingentBeneficiary_DeleteCommand" Width="100%" OnItemDataBound="rgContingentBeneficiary_ItemDataBound" EnableLinqExpressions="false">
<MasterTableView Width="750px" CommandItemDisplay="Bottom" HorizontalAlign="NotSet"
AutoGenerateColumns="False" EditMode="EditForms" DataKeyNames="BeneficiaryID,BeneficiaryPercent">
<CommandItemSettings ShowRefreshButton="false" ShowExportToExcelButton="false" ShowExportToPdfButton="false"
ShowExportToWordButton="false" ShowExportToCsvButton="false" ShowAddNewRecordButton="true"
AddNewRecordText="Add New Beneficiary" />
<Columns>
<telerik:GridBoundColumn DataField="BeneficiaryID" UniqueName="BeneficiaryID" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Full Name" SortExpression="Beneficiary" UniqueName="Beneficiary"
HeaderStyle-Width="44%" ItemStyle-Wrap="true">
<ItemTemplate>
<%# Eval("Beneficiary")%>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Relationship" SortExpression="BeneficiaryRelationship"
HeaderStyle-Width="30%" UniqueName="BeneficiaryRelationship">
<ItemTemplate>
<%# Eval("BeneficiaryRelationship")%>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="Edit" CancelText="Cancel"
HeaderStyle-Width="3%" UniqueName="EditCommandColumn">
<ItemStyle />
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" ConfirmText="Delete this Beneficiary?"
HeaderStyle-Width="3%" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
<ItemStyle HorizontalAlign="Center" />
</telerik:GridButtonColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</div>
</td>
</tr>
<tr>
<td>
<telerik:RadButton runat="server" ID="PreviousButton" Text="Previous" OnClick="PreviousButton_Click">
</telerik:RadButton>
<telerik:RadButton runat="server" ID="ContinueButton" Text="Continue" ValidationGroup="ContingentDesignationValidationGroup"
CausesValidation="true" OnClick="ContinueButton_Click">
</telerik:RadButton>
<telerik:RadButton runat="server" ID="CancelButton" Text="Cancel" CausesValidation="false"
OnClick="CancelButton_Click" OnClientClicking="showConfirmWindow">
</telerik:RadButton>
</td>
</tr>
</table>
</div>
<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
<script type="text/javascript">
function showConfirmWindow(sender, args) {
//args.set_cancel(!window.confirm("None of your changes will be saved. Are you sure you want to cancel? Click OK to Continue or Cancel to go back."));
var callBackFunction = Function.createDelegate(sender, function(argument) {
if (argument) {
this.click();
}
});
var text = "<br />None of your changes will be saved. Are you sure you want to cancel? <br /><br />";
radconfirm(text, callBackFunction, 325, 140, null, "Cancel Beneficiary Designation?");
args.set_cancel(true);
} </script>
</telerik:RadScriptBlock>
</div>
Page 2
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucDesignationSummary.ascx.cs"
Inherits="ucDesignationSummary" %>
<div id="DesignationSummary">
<div>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<th align="left">
Step 4 - Designation Summary
</th>
</tr>
<tr>
<td>
<telerik:RadGrid ID="rgBeneficiaries" runat="server" GridLines="Vertical" AllowPaging="true"
AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AutoGenerateColumns="False"
EnableLinqExpressions="false" AllowSorting="true" AllowAutomaticDeletes="false"
OnNeedDataSource="rgBeneficiaries_NeedDataSource" Skin="MBen" EnableEmbeddedSkins="false"
Width="100%" PageSize="15" ImagesPath="../../App_Themes/MBen/Grid">
<MasterTableView TableLayout="Fixed" HierarchyDefaultExpanded="true" CommandItemDisplay="None"
DataKeyNames="" PagerStyle-Position="Bottom">
<Columns>
<telerik:GridBoundColumn DataField="BeneficiaryType" UniqueName="BeneficiaryType"
HeaderText="Beneficiary Type" HeaderStyle-Width="15%" SortExpression="BeneficiaryType" />
<telerik:GridBoundColumn DataField="BeneficiaryPercent" UniqueName="BeneficiaryPercent"
HeaderText="Percentage" SortExpression="BeneficiaryPercent" HeaderStyle-Width="10%" />
<telerik:GridBoundColumn DataField="Beneficiary" UniqueName="Beneficiary" HeaderText="Beneficiary"
ItemStyle-Wrap="true" SortExpression="Beneficiary" />
<telerik:GridBoundColumn DataField="BeneficiaryRelationship" UniqueName="BeneficiaryRelationship"
HeaderText="Relationship" SortExpression="BeneficiaryRelationship" HeaderStyle-Width="15%" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
</td>
</tr>
</table>
</div>
</div>
<telerik:RadButton runat="server" ID="PreviousButton" Text="Previous" OnClick="PreviousButton_Click">
</telerik:RadButton>
<telerik:RadButton runat="server" ID="btnSubmit" Text="Submit" OnClick="btnSubmit_Click"
OnClientClicked="alert('hi');">
</telerik:RadButton>
<telerik:RadButton runat="server" ID="CancelButton" Text="Cancel" CausesValidation="false"
OnClick="CancelButton_Click" OnClientClicking="showConfirmWindow">
</telerik:RadButton>
<script type="text/javascript">
function showConfirmWindow(sender, args) {
}
function showConfirmWindow(sender, args) {
//args.set_cancel(!window.confirm("Are you sure you want to cancel?"));
var callBackFunction = Function.createDelegate(sender, function(argument) {
if (argument) {
this.click();
}
});
var text = "<br />None of your changes will be saved. Are you sure you want to cancel? <br /><br />";
radconfirm(text, callBackFunction, 325, 140, null, "Cancel Beneficiary Designation?");
args.set_cancel(true);
}
</script>