Saturday, September 24, 2011

How to Validate Number With Validation Control

Validate number, Validate Number with asp.net validation control, Validate numaric value <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="txtBids" Display="Dynamic" ValidationExpression="^\d+$" ValidationGroup="step1" runat="server"  ErrorMessage="*">

Bid Should Be A Number

</asp:RegularExpressionValidator>

How To Validate Decimal Number With Validation Control

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="*" Display="Dynamic" ValidationGroup="step1" ControlToValidate="txtdiscount" ValidationExpression="^\d+(\.\d{1,2})?$" >
                                             Number Should Be Decimal
</asp:RegularExpressionValidator>

Saturday, August 13, 2011

Solution Page Validation error with "EnableEventValidation=true" Command




Add the below line if grid bind in page load  :--
if (!Page.IsPostBack)
{
DataTable  dt=methodName_that_fill_datatable();
}

add
<%@ Page AutoEventWireup="true" >

and remove<%@ Page EnableEventValidation="true" >

Thursday, August 11, 2011

How to convert Null value of database to some value

If you need to change null value of database at the time of  fetching data from database
then use this method ISNULL
SELECT  ISNull(ColumnName,'Your Converted Value ')  FROM TABLENAME


Thursday, July 21, 2011

how to turn off resize text area

<textarea id="txtMessageBox" runat="server" cols="20" rows="2"  style="width:400px;height:130px;resize: none;"></textarea>

Add High Lighted  line in style of textarea

Thursday, July 7, 2011

Page Redirection Using Meta Tag

Add this line at the top of meta tag .
<html>
<head>
<meta http-equiv="refresh" content="0; url=/index.aspx">
</head>

SQL Optimization

  SQL Optimization  1. Add where on your query  2. If you remove some data after the data return then remove the remove condition in the sel...