function ValidateFn()
{
var clk;
clk = radconfirm(
'Do you want to accept changes done by ABC?',callbackFn,310,100,null,'Title');
alert(clk);
}
function callbackFn(arg)
{
//Here i need to store this variable in a hidden field which i will be using in server side code.
alert(arg);
}
<asp:ImageButton ID="ImageButton1" OnClientClick="ValidateFn(); return false;" runat="server" />
But when i click on image button then radconfirm window itself is not coming. this problem is occurring only in case when the page is inherited from master page. In case of simple page it is working fine.
Please help me to short out this problem.
waiting for reply!
| <browsers> |
| <browser refID="Default"> |
| <controlAdapters> |
| <adapter controlType="System.Web.UI.Page" adapterType="Telerik.Web.UI.RadHiddenFieldPageStateCompression" /> |
| </controlAdapters> |
| </browser> |
| </browsers> |
| <telerik:RadGrid ID="GridKenticoUser" runat="server" EnableDragToSelectRows="True" |
| AllowFilteringByColumn="false" AllowSorting="True" AutoGenerateColumns="false" |
| AllowMultiRowSelection="True" PageSize="500" Width="99%" OnNeedDataSource="GridKenticoUser_NeedDataSource" |
| OnItemCommand="GridKenticoUser_ItemCommand"> |
| <MasterTableView Width="100%" AllowPaging="true" DataKeyNames="UzivatelID, LektorID, Uzivatel" PagerStyle-Position="Bottom"> |
| <HeaderStyle HorizontalAlign="Left" /> |
| <ItemStyle HorizontalAlign="Left" /> |
| <AlternatingItemStyle HorizontalAlign="Left" /> |
| <PagerStyle AlwaysVisible="true" Position="Bottom" /> |
| <Columns> |
| <telerik:GridClientSelectColumn> |
| <HeaderStyle Width="35" /> |
| </telerik:GridClientSelectColumn> |
| <telerik:GridBoundColumn DataField="Uzivatel" HeaderText="Uživatel" AutoPostBackOnFilter="true" |
| AllowFiltering="false" ShowFilterIcon="false" FilterControlWidth="100%" CurrentFilterFunction="Contains"> |
| <HeaderStyle Width="150" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridDateTimeColumn DataField="Zalozen" HeaderText="Založen" AutoPostBackOnFilter="true" |
| AllowFiltering="false" ShowFilterIcon="false" FilterControlWidth="100%" CurrentFilterFunction="Contains" |
| DataFormatString="{0:dd.MM.yy}"> |
| <HeaderStyle Width="60" /> |
| </telerik:GridDateTimeColumn> |
| <telerik:GridBoundColumn DataField="LektorFullName" HeaderText="Lektor" AutoPostBackOnFilter="true" |
| AllowFiltering="false" ShowFilterIcon="false" FilterControlWidth="100%" CurrentFilterFunction="Contains"> |
| <HeaderStyle Width="150" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn AllowFiltering="false" HeaderText="Akce"> |
| <ItemTemplate> |
| <div style="padding-left: 10px;"> |
| <asp:ImageButton runat="server" ID="BtnParuj" CommandName="Paruj" ImageUrl="~/App_Themes/GopasRed/Images/16x16/ok.png" |
| Visible='<%# (String.IsNullOrEmpty(Eval("LektorID").ToString()))?true:false %>' |
| ToolTip="Zpárovat" /> |
| <asp:ImageButton runat="server" ID="ImageButton1" CommandName="OdParuj" ImageUrl="~/App_Themes/GopasRed/Images/16x16/cancel.png" |
| Visible='<%# (!String.IsNullOrEmpty(Eval("LektorID").ToString()))?true:false %>' |
| ToolTip="ZruÅ¡it párovánÃ" /> |
| </div> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn AllowFiltering="false"> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings> |
| <ClientEvents /> |
| <Scrolling AllowScroll="True" UseStaticHeaders="true" SaveScrollPosition="True" ScrollHeight="390" /> |
| <Selecting AllowRowSelect="true" /> |
| </ClientSettings> |
| <GroupingSettings CaseSensitive="false" /> |
| </telerik:RadGrid> |
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
<p>
</p>
<form id="form1" runat="server">
<asp:ScriptManager ID="RadScriptManager1" runat="server">
<Scripts>
<%--Needed for JavaScript IntelliSense in VS2010--%>
<%--For VS2008 replace RadScriptManager with ScriptManager--%>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
<asp:ScriptReference Path="~/Scripts/jquery.validate.js" />
<asp:ScriptReference Path="~/Scripts/additional-methods.js" />
</Scripts>
</asp:ScriptManager>
<script type="text/javascript">
$(document).ready(function() {
// Initialize validation on the entire ASP.NET form.
$("#form1").validate({
// This prevents validation from running on every
// form submission by default.
onsubmit: false
});
// Search for controls marked with the causesValidation flag
// that are contained anywhere within elements marked as
// validationGroups, and wire their click event up.
$('.validationGroup .causesValidation').click(ValidateAndSubmit);
// Select any input[type=text] elements within a validation group
// and attach keydown handlers to all of them.
$('.validationGroup :text').keydown(function(evt) {
// Only execute validation if the key pressed was enter.
if (evt.keyCode == 13) {
ValidateAndSubmit(evt);
}
});
});
function ValidateAndSubmit(evt) {
// Ascend from the button that triggered this click event
// until we find a container element flagged with
// .validationGroup and store a reference to that element.
var $group = $(evt.currentTarget).parents('.validationGroup');
var isValid = true;
// Descending from that .validationGroup element, find any input
// elements within it, iterate over them, and run validation on
// each of them.
$group.find(':input').each(function(i, item) {
if (!$(item).valid())
isValid = false;
});
// If any fields failed validation, prevent the button's click
// event from triggering form submission.
if (!isValid)
evt.preventDefault();
}
</script>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>
<div>
<asp:Panel ID="Panel1" runat="server" CssClass="validationGroup">
<asp:TextBox ID="TextBox1" CssClass="required" runat="server"></asp:TextBox>
<asp:DropDownList ID="DropDownList1" runat="server" CssClass="required">
<asp:ListItem Text="Select One" Value=""></asp:ListItem>
<asp:ListItem Text="test 1" Value="1"></asp:ListItem>
</asp:DropDownList>
<telerik:RadDatePicker ID="RadDatePicker1" CssClass="required" runat="server">
</telerik:RadDatePicker>
<telerik:RadDateInput ID="RadDateInput1" CssClass="required" runat="server">
</telerik:RadDateInput>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" CssClass="causesValidation" />
<input id="Reset1" type="reset" value="reset" />
</asp:Panel>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>