Posts

Showing posts from October, 2011

Data List

<html> <body> <form runat="server"> <asp:DataList id="cdcatalog" runat="server" cellpadding="2" cellspacing="2" borderstyle="inset" backcolor="#e8e8e8" width="100%" headerstyle-font-name="Verdana" headerstyle-font-size="12pt" headerstyle-horizontalalign="center" headerstyle-font-bold="True" itemstyle-backcolor="#778899" itemstyle-forecolor="#ffffff" alternatingitemstyle-backcolor="#e8e8e8" alternatingitemstyle-forecolor="#000000" footerstyle-font-size="9pt" footerstyle-font-italic="True"> <HeaderTemplate> My Computer sales </HeaderTemplate> <ItemTemplate> "<%#Container.DataItem("title")%>" of <%#Container.DataItem("artist")%>  - $<%#Container.DataItem("price")%> </ItemTemplate...

Validation Control of Asp.net

Validation Server Control               Description CompareValidator         Compares the value of one input control                 to the value of another input control or to                  a fixed value CustomValidator         Allows you to write a method to handle                  the validation of the value entered RangeValidator         Checks that the user enters a value                 that falls between two values RegularExpressionValidator Ensures that the value of an input control                  matches a specified pattern RequiredFieldValidator         Makes an in...

Email Validation

This means that the input data must contain an @ sign and at least one dot (.). Also, the @ must not be the first character of the email address, and the last dot must be present after the @ sign, and minimum 2 characters before the end: ---------------------------------------------------------------------------------------------------------------------------- function validateForm() { var x=document.forms["myForm"]["email"].value; var atpos=x.indexOf("@"); var dotpos=x.lastIndexOf("."); if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)   {   alert("Not a valid e-mail address");   return false;   } } ----------------------------------------------------------------------------------- <form name="myForm" action="default.aspx" onsubmit="return validateForm();" method="post"> Email: <input type="text" name="email"> <input type="subm...

DropShadowExtender AJAX Control Example

Image
If you are new to AJAX, Please refer to my  Simple AJAX Example to understand how simple to start with AJAX. Step 1: Add Script Manager Step 2: Add a pannel control  to asp.net page Step 3: Add  all  controls inside Pannel Control , that you wish to see in Rounded Corner Box (ie. Applying DropShadow effect) Note: Good Practise while defining pannel for DropShadowExtender Control Assign Width Property Assign BackColor Property eg: here I have used HotPink Color. < asp:Panel   ID ="pnlMyCalcy"   runat ="server"   BackColor ="HotPink" Width ="300" > Step 4: Adding DropShadowExtender Control, and Initialize "TargetControlID" Property with Pannel Control Id and  Property TrackPosition="true" < cc1:DropShadowExtender ID ="DropShadowExtender1" runat ="server" TargetControlID ="pnlMyCalcy" Opacity ="75" Rounded ="true" Radius ="10" Trackposition=...

.Net Framework 4.0

ControlRenderingCompatibilityVersion Setting in the Web.config File ASP.NET controls have been modified in the .NET Framework version 4 in order to let you specify more precisely how they render markup. In previous versions of the .NET Framework, some controls emitted markup that you had no way to disable. By default, ASP.NET 4 this type of markup is no longer generated. If you use Visual Studio 2010 to upgrade your application from ASP.NET 2.0 or ASP.NET 3.5, the tool automatically adds a setting to the  Web.config  file that preserves legacy rendering. However, if you upgrade an application by changing the application pool in IIS to target the .NET Framework 4, ASP.NET uses the new rendering mode by default. To disable the new rendering mode, add the following setting in the  Web.config  file: <pages controlRenderingCompatibilityVersion="3.5" /> The major rendering changes that the new behavior brings are as follows: The  Image  and...