| | |
validation of textbox in gridview
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
Hi divyasrinivasan,
This is for validating textbox for numeric only :
Thanks,
This is for validating textbox for numeric only :
ASP.NET Syntax (Toggle Plain Text)
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="OperationSheetMultipleArticle.aspx.vb" Inherits="OperationSheetMultipleArticle" EnableSessionState="true" %> <%@ OutputCache Location="Client" duration="5" varybyparam="none" %> <html xmlns="http://www.w3.org/1999/xhtml" > <script type="text/javascript" language=javascript> function keyDownNumber() { var key; if(navigator.appName == 'Microsoft Internet Explorer') key = event.keyCode; else key = event.which if ( !(key >= 48 && key <= 57) && key != 8 && key != 46 && key != 36 && key != 37) { event.returnValue = false; } } </script> <head runat="server"> <title>Operation Sheet</title> </head> <body leftmargin=5 topmargin=3> <form id="form1" runat="server"> <asp:GridView ID="GVDetail" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="LightGray" BorderColor="White" BorderStyle="Ridge" BorderWidth="1px" CaptionAlign="Top" CellPadding="0" Font-Size="12px" Font-Strikeout="False" Font-Underline="False" Height="1px" HorizontalAlign="Left" Style="left: 4px; top: 127px" UpdateAfterCallBack="True" Width="100%" EmptyDataText="NO RECORD FOUND" PageSize="12"> <FooterStyle BackColor="#C6C3C6" ForeColor="Black" /> <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" /> <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" Font-Italic="False" Font-Underline="False" ForeColor="#E7E7FF" /> <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" /> <Columns> <asp:templatefield headertext="Del." > <itemstyle borderstyle="None" font-size="8pt" width="10px" horizontalalign="Center" /> <headerstyle font-bold="False" width="10px" font-size="8pt"/> <itemtemplate> <asp:CheckBox id="ChkDelete" runat="server" width="20px" ></asp:CheckBox> </itemtemplate> </asp:templatefield> <asp:templatefield headertext="Article No."> <itemstyle borderstyle="None" font-size="8pt" width="20px" /> <headerstyle font-bold="False" width="65px" font-size="8pt"/> <itemtemplate> <asp:TextBox id="TxtArticleNo" readonly=true text='<% # eval("ArticleNo") %>' runat="server" width="65px" borderstyle="None" font-size="8pt" BackColor="LightCyan" autocallback=true></asp:TextBox> </itemtemplate> </asp:templatefield> <asp:templatefield headertext="Amount"> <itemstyle borderstyle="None" font-size="8pt" width="20px" /> <headerstyle font-bold="False" width="65px" font-size="8pt"/> <itemtemplate> <asp:TextBox id="Amount" text='<% # eval("Amount") %>' runat="server" width="65px" borderstyle="None" font-size="8pt" onkeypress="keyDownNumber()" BackColor="Beige"></asp:TextBox> </itemtemplate> </asp:templatefield> </Columns> <RowStyle BackColor="#DEDFDE" ForeColor="Black" /> <AlternatingRowStyle BackColor="LightGray" /> </asp:GridView> </form> </body> </html>
Thanks,
NEVER NEVER NEVER GIVE UP
![]() |
Similar Threads
- Difference between asp & asp.net (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: BeginnerQuestions to create WebSite
- Next Thread: Regarding the CrystalReport with asp.net
Views: 3663 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol advice ajax alltypeofvideos anathor application asp asp.net bc30451 bottomasp.net browser button c# checkbox click commonfunctions connection css dataaccesslayer database datagridview datagridviewcheckbox datalist development dgv dropdownlist dynamically edit editing expose feedback fill flash form formatdecimal formview google grid gridview iframe iis javascript list listbox login microsoft migration mono mouse mssql multistepregistration news numerical object objects opera panelmasterpagebuttoncontrols parent problem project radio registration reportemail richtextbox rotatepage rows save schoolproject search security session silverlight smartcard smoobjects software sql sql-server sqlserver2005 suse textbox theft tracking unauthorized validation vb.net video videos view virtualdirectory vista visualstudio web webapplications webdevelopemnt webprogramming webservice xsl youareanotmemberofthedebuggerusers





