ASP - Riptutorial

Transcription

ASP.NET#asp.net

Table of ContentsAbout1Chapter 1: Getting started with ASP.NET2Remarks2Examples2Installation or Setup2ASP.NET Overview2Hello World with OWIN3Simple Intro of ASP.NET3Chapter 2: Asp Web Forms IdentityExamplesGetting StartedChapter 3: ASP.NET - Basic Controls5557Syntax7Examples7Text Boxes and Labels7Check Boxes and Radio Buttons8List Controls9Radio Button list and Check Box list10Bulleted lists and Numbered lists10HyperLink Control11Image Control11Chapter 4: ASP.NET - Managing StateExamplesView StateChapter 5: ASP.NET - User on of User Controls15Creating User Control Instance Programmatically16Adding Custom Properties for User Control16

Chapter 6: ASP.NET - Validators18Syntax18Examples18Validation controls18RequiredFieldValidator Control18RangeValidator Control19CompareValidator Control19RegularExpressionValidator20Validation Summary21Validation Groups22Chapter 7: Asp.net Ajax ControlsExamples2525FileUpload Ajax Toolkit Control25Chapter 8: ASP.NET Caching27ExamplesData CacheChapter 9: Data BindingExamplesSQL Data Source2727292929Retrieving Data29Basic Usage30Object Data SourceChapter 10: Data List3032Syntax32Examples32Data Binding in asp.netChapter 11: DayPilot Scheduler3234Parameters34Remarks34Examples34Basic Info34Declaration34

Chapter 12: DirectivesExamples3636The Application Directive36The Control Directive36The Implements Directive37The Master Directive37The Import Directive37The MasterType Directive37The Page Directive38The OutputCache Directive39Chapter 13: Event Delegation40Syntax40Remarks40Examples40Delegation of Event from User Control to aspxChapter 14: Event ion and Session Events43Page and Control Events43Default Events44Chapter 15: ExpressionsExamples4747Value From App.Config47Evaluated Expression47Code Block Within ASP Markup47Chapter 16: Find Control by ID48Syntax48Remarks48Examples48Accessing the TextBox Control in aspx Page48

Find a control in a GridView, Repeater, ListView etc.Chapter 17: GridViewExamples484949Data Binding49Manual Binding49DataSourceControl49Columns49Strongly Typed GridView50Handling command event51Paging52ObjectDataSource52Manual Binding53Update Gridview on row clickChapter 18: httpHandlersExamplesUsing an httpHandler (.ashx) to download a file from a specific locationChapter 19: hapter 20: Middleware61Parameters61Remarks61Examples61Output the request path and the time it took to process itChapter 21: Page Life CycleExamples616363Life Cycle Events63Code Example64Chapter 22: Page MethodsParameters6868

Remarks68More than one parameter68Return value68Examples68How to call itChapter 23: RepeaterExamplesBasic usageChapter 24: les71Working with ScriptManagerChapter 25: Session ManagmentExamplesAdvantage and Disadvantage of Session State, types of sessionChapter 26: Session State7173737374Syntax74Remarks74Examples74Using the Session object to store values74Using a SQL Session Store75Using an Amazon DynamoDB Session Store75Chapter 27: es77Update Panel Example77Chapter 28: View State79Introduction79

Syntax79Examples79Example79Chapter 29: web.config system.webServer/httpErrors & system.web/customErrors sections81Introduction81Examples81What is the difference between customErrors and httpErrors?Chapter 30: WebForms8182Syntax82Remarks82Examples82Using a Repeater to create a HTML Table82Grouping in ListView83Example85Hyperlink85Chapter 31: WebService without Visual r WebServiceCredits8789

AboutYou can share this PDF with anyone you feel could benefit from it, downloaded the latest versionfrom: asp-netIt is an unofficial and free ASP.NET ebook created for educational purposes. All the content isextracted from Stack Overflow Documentation, which is written by many hardworking individuals atStack Overflow. It is neither affiliated with Stack Overflow nor official ASP.NET.The content is released under Creative Commons BY-SA, and the list of contributors to eachchapter are provided in the credits section at the end of this book. Images may be copyright oftheir respective owners unless otherwise specified. All trademarks and registered trademarks arethe property of their respective company owners.Use the content presented in this book at your own risk; it is not guaranteed to be correct noraccurate, please send your feedback and corrections to info@zzzprojects.comhttps://riptutorial.com/1

Chapter 1: Getting started with ASP.NETRemarksASP.NET is a collection of technologies within the .NET Framework that are targeted towards webapplication development. These technologies consist of: WebForms: A RAD style development platform using web controls.MVC: A Model View Controller development platform.SignalR: A real-time messaging platform for client/server messaging.Razor: A front-end markup language you can embed server-side commands with.WebAPI: A platform for building REST API style applications.ExamplesInstallation or SetupBy default, all the required libraries for build ASP.NET applications are included during theinstallation of Visual Studio. If a newer version of ASP.NET is released that was not included withVisual Studio, you can download the appropriate SDK library from Microsoft, which will include allthe necessary libraries for that version.Similarly, the Windows operating system comes pre-installed with a more recent version ofASP.NET and is automatically registered with IIS for configuration and execution. Similarly, if anewer version of ASP.NET becomes available, you can install the SDK for the version you needand then use the aspnet regiis tool to register the framework with IIS for use.It should be also noted that for server deployments, there also exists a ASP.NET SDKRedistributable package. This version is a streamlined version of the SDK, with just the essentiallibraries and does not have the tools and integrations with Visual Studio in it.ASP.NET OverviewASP.NET is a unified Web development model that includes the services necessary for you tobuild enterprise-class Web applications with a minimum of coding. ASP.NET is part of the .NETFramework, and when coding ASP.NET applications you have access to classes in the .NETFramework.You can code your applications in any language compatible with the common language runtime(CLR), including Microsoft Visual Basic, C#, JScript .NET, and J#. These languages enable you todevelop ASP.NET applications that benefit from the common language runtime, type safety,inheritance, and so on.ASP.NET includes: A page and controls frameworkhttps://riptutorial.com/2

The ASP.NET compilerSecurity infrastructureState-management facilitiesApplication configurationHealth monitoring and performance featuresDebugging supportAn XML Web services frameworkExtensible hosting environment and application life cycle managementAn extensible designer environmentHello World with OWINUse the packet manager to install Microsoft.Owin.SelfHostinstall-packet Microsoft.Owin.SelfHostCode for a bare minimum HelloWorld web application running from a console window:namespace HelloOwin{using System;using Owin;class Program{static readonly string baseUrl "http://localhost:8080";static void Main(string[] args){using (Microsoft.Owin.Hosting.WebApp.Start Startup (baseUrl)){Console.WriteLine("Prease any key to quit.");Console.ReadKey();}}}public class Startup{public void Configuration(IAppBuilder app){app.Run(ctx {return ctx.Response.WriteAsync("Hello World");});}}}Simple Intro of ASP.NETAsp.net is web application framework developed by Microsoft to build dynamic data-driven Webhttps://riptutorial.com/3

Application and WebServices.Asp.net is basically a subset of wider .NET framework. A framework is nothing but a collection ofclasses.In .NET Framework you can build Console application. Web Application, Window Application,Mobile Application. So for web application ASP.net is being used.ASP.NET is the successor to classic ASP (Active Server Page.)What is Web Application?A web application is an application that is accessed by users using a web browser such as: Microsoft Internet Explorer.Google ChromeMozilla FireFoxApple safariRead Getting started with ASP.NET online: startedwith-asp-nethttps://riptutorial.com/4

Chapter 2: Asp Web Forms IdentityExamplesGetting StartedGetting StartedInstall NuGet packages:1. Microsoft.AspNet.Identity.EntityFramework2. Microsoft.AspNet.Identity.Core3. Microsoft.AspNet.Identity.OWINRegister action - Account orgeryToken]public async Task ActionResult Register(RegisterViewModel model){if (ModelState.IsValid){var user new ApplicationUser() { UserName model.UserName };var result await UserManager.CreateAsync(user, model.Password);if (result.Succeeded){await SignInAsync(user, isPersistent: false);return RedirectToAction("Index", "Home");}else{AddErrors(result);}}// If we got this far, something failed, redisplay formreturn View(model);}Log-in action - SignInAsync methodprivate async Task SignInAsync(ApplicationUser user, bool tAuthenticationTypes.ExternalCookie);var identity await UserManager.CreateIdentityAsync(user, enticationManager.SignIn(new AuthenticationProperties() {https://riptutorial.com/5

IsPersistent isPersistent}, identity);}Log off// POST: ]public ActionResult LogOff(){AuthenticationManager.SignOut();return RedirectToAction("Index", "Home");}Read Asp Web Forms Identity online: -formsidentityhttps://riptutorial.com/6

Chapter 3: ASP.NET - Basic ControlsSyntax asp:Button ID "Button1" runat "server" onclick "Button1 Click" Text "Click" / asp:TextBox ID "txtstate" runat "server" /asp:TextBox asp:CheckBox ID "chkoption" runat "Server" /asp:CheckBox asp:RadioButton ID "rdboption" runat "Server" /asp: RadioButton asp:ListBox ID "ListBox1" runat "server" AutoPostBack "True"OnSelectedIndexChanged "ListBox1 SelectedIndexChanged" /asp:ListBox asp:DropDownList ID "DropDownList1" runat "server" AutoPostBack "True"OnSelectedIndexChanged "DropDownList1 SelectedIndexChanged" /asp:DropDownList asp:RadioButtonList ID "RadioButtonList1" runat "server" AutoPostBack "True"OnSelectedIndexChanged "RadioButtonList1 SelectedIndexChanged" /asp:RadioButtonList asp:CheckBoxList ID "CheckBoxList1" runat "server" AutoPostBack "True"OnSelectedIndexChanged "CheckBoxList1 SelectedIndexChanged" /asp:CheckBoxList asp:BulletedList ID "BulletedList1" runat "server" /asp:BulletedList asp:HyperLink ID "HyperLink1" runat "server" HyperLink /asp:HyperLink asp:ImageID "Image1" runat "server" ExamplesText Boxes and LabelsText box controls are typically used to accept input from the user. A text box control can acceptone or more lines of text depending upon the settings of the TextMode attribute.Label controls provide an easy way to display text which can be changed from one execution of apage to the next. If you want to display text that does not change, you use the literal text.Basic syntax of text control: asp:TextBox ID "txtstate" runat "server" /asp:TextBox Common Properties of the Text Box and Labels:PropertiesDescriptionTextModeSpecifies the type of text box. SingleLine creates a standard text box, MultiLInecreates a text box that accepts more than one line of text and the Passwordcauses the characters that are entered to be masked. The default is SingleLine.TextThe text content of the text box.https://riptutorial.com/7

PropertiesDescriptionMaxLengthThe maximum number of characters that can be entered into the text box.WrapIt determines whether or not text wraps automatically for multi-line text box;default is true.ReadOnlyDetermines whether the user can change the text in the box; default is false,i.e., the user can change the text.ColumnsThe width of the text box in characters. The actual width is determined based onthe font that is used for the text entry.RowsThe height of a multi-line text box in lines. The default value is 0, means asingle line text box.The mostly used attribute for a label control is 'Text', which implies the text displayed on the label.Check Boxes and Radio ButtonsA check box displays a single option that the user can either check or uncheck and radio buttonspresent a group of options from which the user can select just one option.To create a group of radio buttons, you specify the same name for the GroupName attribute ofeach radio button in the group. If more than one group is required in a single form, then specify adifferent group name for each group.If you want check box or radio button to be selected when the form is initially displayed, set itsChecked attribute to true. If the Checked attribute is set to true for multiple radio buttons in agroup, then only the last one is considered as true.Basic syntax of check box: asp:CheckBox ID "chkoption" runat "Server" /asp:CheckBox Basic syntax of radio button: asp:RadioButton ID "rdboption" runat "Server" /asp: RadioButton Common properties of check boxes and radio buttons:PropertiesDescriptionTextThe text displayed next to the check box or radio button.CheckedSpecifies whether it is selected or not, default is false.GroupNameName of the group the control belongs to.https://riptutorial.com/8

List ControlsASP.NET provides the following controls Drop-down listList boxRadio button listCheck box listBulleted listThese control let a user choose from one or more items from the list. List boxes and drop-downlists contain one or more list items. These lists can be loaded either by code or by theListItemCollection editor.Basic syntax of list box control: asp:ListBox ID "ListBox1" runat "server" AutoPostBack "True"OnSelectedIndexChanged "ListBox1 SelectedIndexChanged" /asp:ListBox Basic syntax of drop-down list control: asp:DropDownList ID "DropDownList1" runat "server" AutoPostBack "True"OnSelectedIndexChanged "DropDownList1 SelectedIndexChanged" /asp:DropDownList Common properties of list box and drop-down Lists:PropertiesDescriptionItemsThe collection of ListItem objects that represents the items in the control.This property returns an object of type ListItemCollection.RowsSpecifies the number of items displayed in the box. If actual list containsmore rows than displayed then a scroll bar is added.SelectedIndexThe index of the currently selected item. If more than one item is selected,then the index of the first selected item. If no item is selected, the value ofthis property is -1.SelectedValueThe value of the currently selected item. If more than one item is selected,then the value of the first selected item. If no item is selected, the value ofthis property is an empty string ("").SelectionModeIndicates whether a list box allows single selections or multiple selections.Common properties of each list item objects:https://riptutorial.com/9

PropertiesDescriptionTextThe text displayed for the item.SelectedA string value associated with the item.ValueIndicates whether the item is selected.It is important to notes that: To work with the items in a drop-down list or list box, you use the Items property of thecontrol. This property returns a ListItemCollection object which contains all the items of thelist. The SelectedIndexChanged event is raised when the user selects a different item from adrop-down list or list box.Radio Button list and Check Box listA radio button list presents a list of mutually exclusive options. A check box list presents a list ofindependent options. These controls contain a collection of ListItem objects that could be referredto through the Items property of the control.Basic syntax of radio button list: asp:RadioButtonList ID "RadioButtonList1" runat "server" AutoPostBack "True"OnSelectedIndexChanged "RadioButtonList1 SelectedIndexChanged" /asp:RadioButtonList Basic syntax of check box list: asp:CheckBoxList ID "CheckBoxList1" runat "server" AutoPostBack "True"OnSelectedIndexChanged "CheckBoxList1 SelectedIndexChanged" /asp:CheckBoxList Common properties of check box and radio button lists:PropertiesDescriptionRepeatLayoutThis attribute specifies whether the table tags or the normal html flow touse while formatting the list when it is rendered. The default is Table.RepeatDirectionIt specifies the direction in which the controls to be repeated. The valuesavailable are Horizontal and Vertical. Default is Vertical.RepeatColumnsIt specifies the number of columns to use when repeating the controls;default is 0.Bulleted lists and Numbered listshttps://riptutorial.com/10

The bulleted list control creates bulleted lists or numbered lists. These controls contain a collectionof ListItem objects that could be referred to through the Items property of the control.Basic syntax of a bulleted list: asp:BulletedList ID "BulletedList1" runat "server" /asp:BulletedList Common properties of the bulleted list:PropertiesDescriptionBulletStyleThis property specifies the style and looks of the bullets, or numbers.RepeatDirectionIt specifies the direction in which the controls to be repeated. The valuesavailable are Horizontal and Vertical. Default is Vertical.RepeatColumnsIt specifies the number of columns to use when repeating the controls;default is 0.HyperLink ControlThe HyperLink control is like the HTML element.Basic syntax for a hyperlink control: asp:HyperLink ID "HyperLink1" runat "server" HyperLink /asp:HyperLink It has the following important properties:PropertiesDescriptionImageUrlPath of the image to be displayed by the control.NavigateUrlTarget link URL.TextThe text to be displayed as the link.TargetThe window or frame which loads the linked page.Image ControlThe image control is used for displaying images on the web page, or some alternative text, if theimage is not available.Basic syntax for an image control:https://riptutorial.com/11

asp:Image ID "Image1" runat "server" It has the following important nate text to be displayed in absence of the image.ImageAlignAlignment options for the control.ImageUrlPath of the image to be displayed by the control.Read ASP.NET - Basic Controls online: ---basiccontrolshttps://riptutorial.com/12

Chapter 4: ASP.NET - Managing StateExamplesView StateThe following example demonstrates the concept of storing view state. Let us keep a counter,which is incremented each time the page is posted back by clicking a button on the page. A labelcontrol shows the value in the counter.The markup file code is as follows: %@ Page Language "C#" AutoEventWireup "true" CodeBehind "Default.aspx.cs"Inherits "statedemo. Default" % !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 xhtml1-transitional.dtd" html xmlns "http://www.w3.org/1999/xhtml" head runat "server" title Untitled Page /title /head body form id "form1" runat "server" div h3 View State demo /h3 Page Counter: asp:Label ID "lblCounter" runat "server" / asp:Button ID "btnIncrement" runat "server" Text "Add Count"onclick "btnIncrement Click" / /div /form /body /html The code behind file for the example is shown here:public partial class Default : System.Web.UI.Page{public int counter{get{if (ViewState["pcounter"] ! null){https://riptutorial.com/13

return ((int)ViewState["pcounter"]);}else{return 0;}}set{ViewState["pcounter"] value;}}protected void Page Load(object sender, EventArgs e){lblCounter.Text counter.ToString();counter ;}}It would produce the following result:View State DemoRead ASP.NET - Managing State online: --managing-statehttps://riptutorial.com/14

Chapter 5: ASP.NET - User ControlsIntroductionUser controls are containers which can be populated with HTML markup & server controls withcode-behind in the same way as ASPX page. They're treated as reusable smaller units of a page,so they can't run as stand-alone pages and must not having html, body or form HTML elementsin them.ExamplesIntroduction of User ControlsUser controls are made for reusability across ASP.NET pages, similar to master pages. Instead ofsharing base page layout, user controls share group of HTML/ASP.NET built-in server controls ora specific form layout, e.g. comment submission or guest notes.A user control can contain both HTML controls and ASP.NET server controls, including client-sidescripts.The user controls usually include Control directive on top of its definition: %@ Control Language "C#" AutoEventWireup "True" CodeFile "UserControl.ascx.cs" % Like ASPX page, user controls consists of markups which can be associated with a code behindfile to perform certain events and tasks, therefore all HTML tags available on ASPX page can beused on user controls except html , body and form tags.Here is an example for simple user control markup: %-- UserControl.ascx --% %@ Control Language "C#" AutoEventWireup "True" CodeFile "UserControl.ascx.cs" % div asp:Label ID "Label1" runat "server" / br / asp:Button ID "Button1" runat "server" Text "Click Here" OnClick "Button1 Click" / /div Code-behind example:// UserControl.ascx.cspublic partial class UserControl : System.Web.UI.UserControl{protected void Button1 Click(Object sender, EventArgs e){Label1.Text "Hello World!";}}https://riptutorial.com/15

Before a user control inserted in ASPX page, Register directive should declared on top of the pagereferencing the user control with its source URL, tag name & tag prefix. %@ Register Src "UserControl.ascx" TagName "UserControl" TagPrefix "uc" % Afterwards, you can place user control inside ASPX page like ASP.NET built-in server control: uc:UserControl ID "UserControl1" runat "server" / Creating User Control Instance ProgrammaticallyIf you want to instantiate an instance of user control inside ASPX code behind page, you need towrite user control declaration on Page Load event as follows:public partial class Default : System.Web.UI.Page{protected void Page Load(Object sender, EventArgs e){Control control1 control1);}}Note that the user control ASCX file should be already created when executing LoadControlmethod.Another way known to declare user controls programatically is using PlaceHolder:public partial class Default : System.Web.UI.Page{public PlaceHolder Placeholder1;protected void Page Load(Object sender, EventArgs e){Control control1 ols.Add(control1);}}Depending on your need, PlaceHolder places user controls on a container storing all servercontrols dynamically added into the page, where Page.Controls directly inserts user control insidethe page which more preferred for rendering HTML literal controls.Adding Custom Properties for User ControlLike standard ASP.NET built-in server controls, user controls can have properties (attributes) onits definition tag. Suppose you want to add color effect on UserControl.ascx file like this: uc:UserControl ID "UserControl1" runat "server" Color "blue" / At this point, custom attributes/properties for user controls can be set by declaring propertieshttps://riptutorial.com/16

inside user control's code behind:private String color;public String Color{get{return color;}set{color value;}}Additionally, if you want to set default value on a user control property, assign the default valueinside user control's constructor method.public UserControl(){color "red";}Then, user control markup should be modified to add color attribute as following example: %@ Control Language "C#" AutoEventWireup "True" CodeFile "UserControl.ascx.cs" % div span style "color: % Color % " asp:Label ID "Label1" runat "server" / /span br / asp:Button ID "Button1" runat "server" Text "Click Here" OnClick "Button1 Click" / /div Read ASP.NET - User Controls online: ---usercontrolshttps://riptutorial.com/17

Chapter 6: ASP.NET - ValidatorsSyntax RequiredFieldValidator Control: asp:RequiredFieldValidator ID "rfvcandidate"runat "server" ControlToValidate "ddlcandidate" ErrorMessage "Please choose acandidate" InitialValue "Please choose a candidate" /asp:RequiredFieldValidator RangeValidator Control: asp:RangeValidator ID "rvclass" runat "server" ControlToValidate "txtclass"ErrorMessage "Enter your class (6 - 12)" MaximumValue "12" MinimumValue "6"Type "Integer" /asp:RangeValidator CompareValidator Control: asp:CompareValidator ID "CompareValidator1"runat "server" ErrorMessage "CompareValidator" /asp:CompareValidator CustomValidator: asp:CustomValidator ID "CustomValidator1" runat "server"ClientValidationFunction .cvf func. ErrorMessage "CustomValidator" /asp:CustomValidator Validation Summary: asp:ValidationSummary ID "ValidationSummary1" runat "server"DisplayMode "BulletList" ShowSummary "true" HeaderText "Errors:" / ExamplesValidation controlsASP.NET validation controls validate the user input data to ensure that useless, unauthenticated,or contradictory data don't get stored.ASP.NET provides the following validation controls: ionSummaryRequiredFieldValidator Controlhttps://riptutorial.com/18

The RequiredFieldValidator control ensures that the required field is not empty. It is generally tiedto a text box to force input into the text box.The syntax of the control is as given: asp:RequiredFieldValidator ID "rfvcandidate"runat "server" ControlToValidate "ddlcandidate"ErrorMessage "Please choose a candidate"InitialValue "Please choose a candidate" /asp:RequiredFieldValidator RangeValidator ControlThe RangeValidator control verifies that the input value falls within a predetermined range.It has three specific properties:PropertiesDescriptionTypeIt defines the type of the data. The available values are: Currency, Date,MinimumValueIt specifies the minimum value of the range.MaximumValueIt specifies the maximum value of the range.The syntax of the control is as given: asp:RangeValidator ID "rvclass" runat "server" ControlToValidate "txtclass"ErrorMessage "Enter your class (6 - 12)" MaximumValue "12"MinimumValue "6" Type "Integer" /asp:RangeValidator CompareValidator ControlThe CompareValidator control compares a value in one control with a fixed value or a value inanother control.It has the following specific properties:PropertiesDescriptionTypeIt specifies the data type.ControlToCompareIt specifies the value of the input control to compare with.ValueToCompareIt specifies the constant value to compare with.ValueToCompareIt specifies the comparison operator, the available values are: Equal,https://riptutorial.com/19

PropertiesDescriptionNotEqual, GreaterThan, GreaterThanEqual, LessThan, LessThanEqual,and DataTypeCheck.The basic syntax of the control is as follows: asp:CompareValidator ID "CompareValidator1" runat "server"ErrorMessage "CompareValidator" /asp:CompareValidator RegularExpressionValidatorThe RegularExpressionValidator allows validating the input text by matching against a pattern of aregular expression. The regular expression is set in the ValidationExpression property.The following table summarizes the commonly used syntax constructs for regular expressions:Character EscapesDescription\bMatches a backspace.\tMatches a tab.\rMatches a carriage return.\vMatches a vertical tab.\fMatches a form feed.\nMatches a new line.\Escape character.Apart from single character match, a class of characters could be specified that can be matched,called the metacharacters.MetacharactersDescription.Matches any character except \n.[abcd]Matches any character in the set.[ abcd]Excludes any character in the set.[2-7a-mA-M]Matches any character specified in the range.\wMatches any alphanumeric character and underscore.https://riptutorial.com/20

MetacharactersDescription\WMatches any non-word character.\sMatches whitespace characters like, space, tab, new line etc.\SMatches any non-whitespace character.\dMatches any decimal character.\DMatches any non-decimal character.Quantifiers could be added to specify number of times a character could appear.QuantifierDescription*Zero or more matches. One or more matches.?Zero or one matches.{N}N matches.{N,}N or more matches.{N,M}Between N and M matches.The syntax of the control is as given: asp:RegularExpressionValidator ID "string" runat "server" ErrorMessage "string"ValidationExpression "string" ValidationGroup "string" /asp:RegularExpressionValidator Validation SummaryThe ValidationSummary control does not perform any validation but shows a summary of all errorsin the page. The summary displays the values of the ErrorMessage property of all validationcontrols that failed validation.The following two mutually inclusive properties list out the error message:ShowSummary : shows the error messages in specified format.ShowMessageBox : shows the error messages in a separate window.The syntax for the control is as given: asp:ValidationSummary ID "ValidationSummary1" runat "server"https://riptutorial.com/21

DisplayMode "BulletList" ShowSummary "true" HeaderText "Errors:" / Validation GroupsComplex pages have different groups of information provided in different panels. In such situation,a need might arise for performing validation separately for separate group. This kind of situation ishandled using validation groups.To create a validation group, you should put the input controls and the validation controls i

Chapter 1: Getting started with ASP.NET 2 Remarks 2 Examples 2 Installation or Setup 2 ASP.NET Overview 2 Hello World with OWIN 3 Simple Intro of ASP.NET 3 Chapter 2: Asp Web Forms Identity 5 Examples 5 Getting Started 5 Chapter 3: ASP.NET - Basic Controls 7 Syntax 7 Examples 7 Text Boxes and Labels 7 Check Boxes and Radio Buttons 8 List Controls 9