EDN Admin
Well-known member
I have a gridview inside which I need to show the masked edit boxes for date. The Ajax toolkit MaskedEditExtender is working fine in the same page if placed outside the grid. But when I place the same inside the grid it doesnt work. Following is my code (I have just placed the relevant code here) :<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/CMS/CMSSite.Master" AutoEventWireup="true"
CodeBehind="LeadMaster.aspx.cs" Inherits="BEDB_WEB.CMS.LeadMaster" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="HeadContent
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="MainContent
<asp:ScriptManagerProxy ID="proxy1" runat="server" ViewStateMode="Enabled
<Scripts>
<asp:ScriptReference Path="Scripts/Common.js" />
</Scripts>
</asp:ScriptManagerProxy>
<script type="text/javascript" language="javascript Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
</script>
<div class="title
Lead Master (Contact)
<div class="errorDisplay
<asp:Label ID="lblError" runat="server" CssClass="lblError </asp:Label>
<asp:Label ID="lblSuccess" runat="server" CssClass="lblSuccess </asp:Label>
<aspanel ID="Panel1" GroupingText="Contact Details" runat="server
<div class="row
<div class="firstCol <asp:Label ID="Label6" runat="server" Text="Start Year :" ></asp:Label>
<div class="secondCol
<asp:TextBox ID="txtStartYear" runat="server" cssclass ="shorttext" TabIndex="8 </asp:TextBox>
<ajaxtoolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtStartYear"
MaskType="Number" AcceptNegative="None" InputDirection="RightToLeft" Mask="9999 </ajaxtoolkit:MaskedEditExtender>
</aspanel>
<asp:UpdatePanel ID="UpdatePanel1" GroupingText="Select Schemes" runat="server
<ContentTemplate>
<div id="DivRoot" align="left
<div style="overflow: hidden;" id="DivHeaderRow
<div style="overflow:scroll;" id="DivMainContent
<asp:GridView ID="gridviewSchemes" runat="server" Width="830px" Height="200px"
BackColor="White" BorderColor="#CCCCCC" BorderWidth="1px" CellPadding="3" AutoGenerateColumns="False" RowStyle-Height="30px"
HeaderStyle-Height="40px" BorderStyle="None" AllowPaging="False" SelectedRowStyle-BackColor="Red" CssClass="searchGridView"
PagerSettings-Mode="NextPreviousFirstLast" >
<FooterStyle BackColor="White" ForeColor="#000066" />
<HeaderStyle BackColor="#FAA71C" Font-Bold="True" />
<PagerStyle BackColor="White" ForeColor="#000066"
HorizontalAlign="Left" />
<RowStyle ForeColor="Black" Height="30px" />
<AlternatingRowStyle Height="30px" />
<SelectedRowStyle BackColor="#669999" ForeColor="White" Font-Bold="True" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#007DBB" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#00547E" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txtStartYear2" runat="server" cssclass ="shorttext" TabIndex="8 </asp:TextBox>
<ajaxtoolkit:MaskedEditExtender ID="MaskedEditExtender56" runat="server" TargetControlID="txtStartYear2"
MaskType="Number" AcceptNegative="None" InputDirection="RightToLeft" Mask="9999 </ajaxtoolkit:MaskedEditExtender>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
The ToolkitScriptManager is placed in the Master page as below :
<form id="Form1" runat="server
<ajaxtoolkit:ToolkitScriptManager runat="server" ID ="toolScriptManager1 </ajaxtoolkit:ToolkitScriptManager>
It doesnt show any error but it just doesnt work. I have already searched on internet but it wasnt of much help.
Where am I going wrong?
View the full article
CodeBehind="LeadMaster.aspx.cs" Inherits="BEDB_WEB.CMS.LeadMaster" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="HeadContent
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="MainContent
<asp:ScriptManagerProxy ID="proxy1" runat="server" ViewStateMode="Enabled
<Scripts>
<asp:ScriptReference Path="Scripts/Common.js" />
</Scripts>
</asp:ScriptManagerProxy>
<script type="text/javascript" language="javascript Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
</script>
<div class="title
Lead Master (Contact)
<div class="errorDisplay
<asp:Label ID="lblError" runat="server" CssClass="lblError </asp:Label>
<asp:Label ID="lblSuccess" runat="server" CssClass="lblSuccess </asp:Label>
<aspanel ID="Panel1" GroupingText="Contact Details" runat="server
<div class="row
<div class="firstCol <asp:Label ID="Label6" runat="server" Text="Start Year :" ></asp:Label>
<div class="secondCol
<asp:TextBox ID="txtStartYear" runat="server" cssclass ="shorttext" TabIndex="8 </asp:TextBox>
<ajaxtoolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtStartYear"
MaskType="Number" AcceptNegative="None" InputDirection="RightToLeft" Mask="9999 </ajaxtoolkit:MaskedEditExtender>
</aspanel>
<asp:UpdatePanel ID="UpdatePanel1" GroupingText="Select Schemes" runat="server
<ContentTemplate>
<div id="DivRoot" align="left
<div style="overflow: hidden;" id="DivHeaderRow
<div style="overflow:scroll;" id="DivMainContent
<asp:GridView ID="gridviewSchemes" runat="server" Width="830px" Height="200px"
BackColor="White" BorderColor="#CCCCCC" BorderWidth="1px" CellPadding="3" AutoGenerateColumns="False" RowStyle-Height="30px"
HeaderStyle-Height="40px" BorderStyle="None" AllowPaging="False" SelectedRowStyle-BackColor="Red" CssClass="searchGridView"
PagerSettings-Mode="NextPreviousFirstLast" >
<FooterStyle BackColor="White" ForeColor="#000066" />
<HeaderStyle BackColor="#FAA71C" Font-Bold="True" />
<PagerStyle BackColor="White" ForeColor="#000066"
HorizontalAlign="Left" />
<RowStyle ForeColor="Black" Height="30px" />
<AlternatingRowStyle Height="30px" />
<SelectedRowStyle BackColor="#669999" ForeColor="White" Font-Bold="True" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#007DBB" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#00547E" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txtStartYear2" runat="server" cssclass ="shorttext" TabIndex="8 </asp:TextBox>
<ajaxtoolkit:MaskedEditExtender ID="MaskedEditExtender56" runat="server" TargetControlID="txtStartYear2"
MaskType="Number" AcceptNegative="None" InputDirection="RightToLeft" Mask="9999 </ajaxtoolkit:MaskedEditExtender>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
The ToolkitScriptManager is placed in the Master page as below :
<form id="Form1" runat="server
<ajaxtoolkit:ToolkitScriptManager runat="server" ID ="toolScriptManager1 </ajaxtoolkit:ToolkitScriptManager>
It doesnt show any error but it just doesnt work. I have already searched on internet but it wasnt of much help.
Where am I going wrong?
View the full article