SlideShare a Scribd company logo
1 of 41
Using the standard control
Step1
step1
step2
Webform1.aspx
Design view
Design view-Adding a button and a
textbox
Webform1.aspx
Webform1.aspx.cs
Run application
Using the Validation control
• Using the RequiredFieldValidator Control
• In this example, we are adding two
RequiredFieldValidator controls on a Web
page for validating twoTextBox controls. The
RequiredFieldValidator controls ensure that
the two TextBox controls are not kept empty
by the user at runtime.
Design view
Default.aspx
• <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
• Inherits="_Default" %>
• <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
• "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
• <html xmlns="http://www.w3.org/1999/xhtml">
• <head runat="server">
• <title>RequiredFieldValidator Control Example</title>
• </head>
• <body>
• <form id="form1" runat="server">
• <div>
• <asp:Label ID="Label1" runat="server"
• Text="RequiredField Validator Control Example" Font-Bold="True"
• Font-Size="Medium" Font-Underline="True"></asp:Label>
• <br />
• <br />
• <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="Small"
• Text="User name:"></asp:Label>
• &nbsp;&nbsp;
• <asp:TextBox ID="TextBox1" runat="server" Height="22px"
• Width="175px"></asp:TextBox>
• <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
• ControlToValidate="TextBox1" ErrorMessage="User name can not be
• empty"></asp:RequiredFieldValidator>
• <br />
• <br />
• erver"
Cont..
• <asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Size="Small"
• Text="Password:"></asp:Label>
• &nbsp;&nbsp;&nbsp;&nbsp;
• <asp:TextBox ID="TextBox2" runat="server" Height="22px" TextMode="Password"
• Width="175px"></asp:TextBox>
• <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="s
• ControlToValidate="TextBox2" ErrorMessage="Password can not be
• empty"></asp:RequiredFieldValidator>
• <br />
• <br />
• <br />
• &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
• &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
• &nbsp;&nbsp;&nbsp;&nbsp;
• <asp:Button ID="Button1" runat="server" BackColor="Black" Font-Bold="True"
• Font-Size="Medium" ForeColor="White" Text="Submit" />
• </div>
• </form>
• </body>
• </html>
Using the RangeValidator Control: (Regular expression for date (^(19|20)dd([- /.])(0[1-9]|1[012])2(0[1-9]|[12][0-
9]|3[01])$)
Run the application
Using the RegularExpressionValidator
Control
• In this example, we are taking two
RegularExpressionValidator controls on a Web
page for validating two TextBox controls. It
ensures that the data (URL and email address)
entered in both the TextBox controls is valid
Design view
Run application
Using the CompareValidator Control
• In this example, we take a CompareValidator
control on a Web page, which validates the
third TextBox control. It ensures that the data
(password) entered in the third TextBox
control is exactly the same as the data
• (password) entered in the second TextBox
control.
Compare validator control
user interface and functionality.
Properties Description
Caption Gets or sets the caption for the calendar control.
CaptionAlign Gets or sets the alignment for the caption.
CellPadding Gets or sets the number of spaces between the data and the
Cell border.
CellSpacing Gets or sets the space between cells.
DayHeaderStyle Gets the style properties for the section that displays the
day of the week.
DayNameFormat Gets or sets format of days of the week.
DayStyle Gets the style properties for the days in the displayed month.
FirstDayOfWeek Gets or sets the day of week to display in the first column.
Cont..
NextMonthText Gets or sets the day of week to display in the first column.
NextPrevFormat Gets or sets the text for next month navigation control .The
default value is >
.
OtherMonthDayStyle Gets or sets the format of the next and previous month
navigation control.
PrevMonthText Gets the style properties for the days on the Calendar
control that are not in the displayed month.
SelectedDate Gets or sets the text for previous month navigation control.
The default value is <
.
ShowGridLines Gets or sets the value indicating whether the gridlines would
be shown.
Events
Events Description
SelectionChan
ged
It is raised when a day, a week or an entire month is selected.
DayRender t is raised when each data cell of the calendar control is
rendered.
VisibleMonth
Changed
It is raised when user changes a month.
Working with calendar controls
Default.aspx*
• <%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master"
AutoEventWireup="true" CodeBehind="Default.aspx.vb"
Inherits="rich_controls._Default" %>
• <asp:Content ID="Content1" runat="server" contentplaceholderid="MainContent">
• <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
• <div _designerregion="0">
• </div>
• <p>Todays date is:
• <asp:Label ID="lblday" runat="server"></asp:Label>
• </p>
• <p>Your Birday is:
• <asp:Label ID="lblbday" runat="server"></asp:Label>
• </p>
• </asp:Content>
Double click on the calendar
• Public Class _Default
• Inherits Page
• Protected Sub Page_Load(ByVal sender As Object, ByVal e As
EventArgs) Handles Me.Load
• End Sub
• Protected Sub Calendar1_SelectionChanged(sender As Object, e
As EventArgs) Handles Calendar1.SelectionChanged
• lblday.Text = Calendar1.TodaysDate.ToShortDateString()
• lblbday.Text = Calendar1.SelectedDate.ToShortDateString()
• End Sub
• End Class
Run the Program
Creating custom controls with user
Controls
• ASP.NET allows the users to create controls.
These user defined controls are categorized
into:
• User controls
• Custom controls
User Conrols
• User controls behaves like miniature ASP.NETpages or
web forms, which could be used by many other pages.
These are derived from the system.Web.UI.UserControl
class. These controls have the following characteristics
• They have an .ascx extension.
• They may not contain any <html>, <body>,or <form>
tags.
• They have a Control directive instead of a Page
directive.
• To understand the concept, let us create a simple user
control, which will work as footer for the web pages.
To create and use the user control, take the following
steps:
Steps
• Create a new web application.
• Right click on the project folder on the Solution Explorer and
choose Add New Item.
• Select Web User Control from the Add New Item dialog box
and name it u1.ascx. Initially, the footer.ascx contains only a
Control directive.
• <%@ Control Language="C#" AutoEventWireup="true"
• CodeBehind=“u1.ascx.cs"
Inherits="customcontroldemo.footer" %>
User control(u1.ascx)
Register user control
• <%@ Page Title="Home Page" Language="VB"
MasterPageFile="~/Site.Master"
AutoEventWireup="true"
CodeBehind="Default.aspx.vb"
Inherits="WebApplication12._Default" %>
• <%@ Register Src="~/u1.ascx" TagName="u"
TagPrefix="ut" %>
Add a form to the project and use this control
• <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb"
Inherits="WebApplication12.WebForm1" %>
• <%@ Register Src="~/u1.ascx" TagName="u" TagPrefix="ut1" %>
• <!DOCTYPE html>
• <html xmlns="http://www.w3.org/1999/xhtml">
• <head runat="server">
• <title></title>
• </head>
• <body>
• <form id="form1" runat="server">
• <div>
•
• </div>
• <ut1:u ID="footer1" runat="server" />
• </form>
• </body>
• </html>
Run the application
Custom Control
• Custom controls are deployed as individual assemblies. They are compiled
into a Dynamic Link Library (DLL) and used as any other ASP.NET server
control. They could be created in either of the following way:
• By deriving a custom control from an existing control
• By composing a new custom control combing two or more existing
controls
• By deriving from the base control class
To understand the concept, let us create a custom control, which will simply
render a text message on the browser.
If you want to change the functionality of existing controls, such as a button
or label, you can directly derive the new class with these existing classes and
can change their default behavior.
In brief, the Control class provides the basic functionality by which you can
place it in the control tree for a Page class. The WebControl class adds the
functionality to the base Control class for displaying visual content on the
client computer. For example, you can use the WebControl class to control the
look and styles through properties like font, color, and height.
1. Create an empty ASP.NET web form
application
2. Right click on the web application and add ASP.NET server control:wc (name of the custom
control)
Imports System
Imports System.Collections.Generic
Imports System.Data
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
<DefaultProperty("Text"), ToolboxData("<{0}:wc runat=server></{0}:wc>")> _
Public Class wc Inherits WebControl
<Bindable(True), Category("Appearance"), DefaultValue(""), Localizable(True)> Property Text() As String
Get
Dim s As String = CStr(ViewState("Text"))
If s Is Nothing Then
Return String.Empty
Else
Return s
End If
End Get
Set(ByVal Value As String)
ViewState("Text") = Value
End Set
End Property
Protected Overrides Sub RenderContents(ByVal writer As HtmlTextWriter)
writer.Write("hello world from custom controls")
End Sub
End Class
Build the application
• Open a new or existing web form where you
can use the custom control.
Web form2.aspx file
• <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm2.aspx.vb"
Inherits="WebApplication15.WebForm2" %>
• <%@ Register assembly="WebApplication15" namespace="WebApplication15" tagprefix="cc1"
%>
• <!DOCTYPE html>
• <html xmlns="http://www.w3.org/1999/xhtml">
• <head runat="server">
• <title></title>
• </head>
• <body>
• <form id="form1" runat="server">
• <div>
•
• <cc1:wc ID="wc1" runat="server" />
•
• </div>
• </form>
• </body>
• </html>
Run the application

More Related Content

What's hot

Ajax and ASP.NET AJAX
Ajax and ASP.NET AJAXAjax and ASP.NET AJAX
Ajax and ASP.NET AJAXJulie Iskander
 
ASP.NET User Controls - 20090828
ASP.NET User Controls - 20090828ASP.NET User Controls - 20090828
ASP.NET User Controls - 20090828Viral Patel
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10Sisir Ghosh
 
Csphtp1 20
Csphtp1 20Csphtp1 20
Csphtp1 20HUST
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04Mani Chaubey
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19Vivek chan
 
Aspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAlfa Gama Omega
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controlsReshi Unen
 
ASP.NET - Life cycle of asp
ASP.NET - Life cycle of aspASP.NET - Life cycle of asp
ASP.NET - Life cycle of asppriya Nithya
 
Asp.net server control
Asp.net  server controlAsp.net  server control
Asp.net server controlSireesh K
 
RubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendallRubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendalltutorialsruby
 
Adding a view
Adding a viewAdding a view
Adding a viewNhan Do
 
JavaScript - Chapter 14 - Form Handling
 JavaScript - Chapter 14 - Form Handling   JavaScript - Chapter 14 - Form Handling
JavaScript - Chapter 14 - Form Handling WebStackAcademy
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.netBhumivaghasiya
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with spparallelminder
 
Academy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingAcademy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingBinary Studio
 

What's hot (19)

Ajax and ASP.NET AJAX
Ajax and ASP.NET AJAXAjax and ASP.NET AJAX
Ajax and ASP.NET AJAX
 
ASP.NET User Controls - 20090828
ASP.NET User Controls - 20090828ASP.NET User Controls - 20090828
ASP.NET User Controls - 20090828
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10
 
Csphtp1 20
Csphtp1 20Csphtp1 20
Csphtp1 20
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19
 
Ajax
AjaxAjax
Ajax
 
Aspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_cs
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controls
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
ASP.NET - Life cycle of asp
ASP.NET - Life cycle of aspASP.NET - Life cycle of asp
ASP.NET - Life cycle of asp
 
Asp.net server control
Asp.net  server controlAsp.net  server control
Asp.net server control
 
Asp.net controls
Asp.net controlsAsp.net controls
Asp.net controls
 
RubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendallRubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendall
 
Adding a view
Adding a viewAdding a view
Adding a view
 
JavaScript - Chapter 14 - Form Handling
 JavaScript - Chapter 14 - Form Handling   JavaScript - Chapter 14 - Form Handling
JavaScript - Chapter 14 - Form Handling
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
 
Academy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingAcademy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & Tooling
 

Similar to Asp PPT (.NET )

12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17Vivek chan
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showSubhas Malik
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaJignesh Aakoliya
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2Julie Iskander
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to VisualforceSujit Kumar
 
Chapter 09
Chapter 09Chapter 09
Chapter 09Terry Yoast
 
Ajax control asp.net
Ajax control asp.netAjax control asp.net
Ajax control asp.netSireesh K
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentChui-Wen Chiu
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questionsAkhil Mittal
 
ASP.NET Lecture 6
ASP.NET Lecture 6ASP.NET Lecture 6
ASP.NET Lecture 6Julie Iskander
 
Custom Controls in ASP.net
Custom Controls in ASP.netCustom Controls in ASP.net
Custom Controls in ASP.netkunj desai
 
User controls
User controlsUser controls
User controlsaspnet123
 
11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16Niit Care
 
Parallelminds.web partdemo1
Parallelminds.web partdemo1Parallelminds.web partdemo1
Parallelminds.web partdemo1parallelminder
 
NET_Training.pptx
NET_Training.pptxNET_Training.pptx
NET_Training.pptxssuserc28c7c1
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event HandlingWebStackAcademy
 

Similar to Asp PPT (.NET ) (20)

12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
 
Visual studio 2008 asp net
Visual studio 2008 asp netVisual studio 2008 asp net
Visual studio 2008 asp net
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
 
ASP.NET - Web Programming
ASP.NET - Web ProgrammingASP.NET - Web Programming
ASP.NET - Web Programming
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
 
A View about ASP .NET and their objectives
A View about ASP .NET and their objectivesA View about ASP .NET and their objectives
A View about ASP .NET and their objectives
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to Visualforce
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
 
Chapter 11
Chapter 11Chapter 11
Chapter 11
 
Ajax control asp.net
Ajax control asp.netAjax control asp.net
Ajax control asp.net
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
 
ASP.NET Lecture 6
ASP.NET Lecture 6ASP.NET Lecture 6
ASP.NET Lecture 6
 
Custom Controls in ASP.net
Custom Controls in ASP.netCustom Controls in ASP.net
Custom Controls in ASP.net
 
User controls
User controlsUser controls
User controls
 
11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16
 
Parallelminds.web partdemo1
Parallelminds.web partdemo1Parallelminds.web partdemo1
Parallelminds.web partdemo1
 
NET_Training.pptx
NET_Training.pptxNET_Training.pptx
NET_Training.pptx
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
 

More from Ankit Gupta

Biometricstechnology in iot and machine learning
Biometricstechnology in iot and machine learningBiometricstechnology in iot and machine learning
Biometricstechnology in iot and machine learningAnkit Gupta
 
Week2 cloud computing week2
Week2 cloud computing week2Week2 cloud computing week2
Week2 cloud computing week2Ankit Gupta
 
Week 8 lecture material
Week 8 lecture materialWeek 8 lecture material
Week 8 lecture materialAnkit Gupta
 
Week 4 lecture material cc (1)
Week 4 lecture material cc (1)Week 4 lecture material cc (1)
Week 4 lecture material cc (1)Ankit Gupta
 
Week 3 lecture material cc
Week 3 lecture material ccWeek 3 lecture material cc
Week 3 lecture material ccAnkit Gupta
 
Week 1 lecture material cc
Week 1 lecture material ccWeek 1 lecture material cc
Week 1 lecture material ccAnkit Gupta
 
Mod05lec25(resource mgmt ii)
Mod05lec25(resource mgmt ii)Mod05lec25(resource mgmt ii)
Mod05lec25(resource mgmt ii)Ankit Gupta
 
Mod05lec24(resource mgmt i)
Mod05lec24(resource mgmt i)Mod05lec24(resource mgmt i)
Mod05lec24(resource mgmt i)Ankit Gupta
 
Mod05lec23(map reduce tutorial)
Mod05lec23(map reduce tutorial)Mod05lec23(map reduce tutorial)
Mod05lec23(map reduce tutorial)Ankit Gupta
 
Mod05lec22(cloudonomics tutorial)
Mod05lec22(cloudonomics tutorial)Mod05lec22(cloudonomics tutorial)
Mod05lec22(cloudonomics tutorial)Ankit Gupta
 
Mod05lec21(sla tutorial)
Mod05lec21(sla tutorial)Mod05lec21(sla tutorial)
Mod05lec21(sla tutorial)Ankit Gupta
 
Lecture29 cc-security4
Lecture29 cc-security4Lecture29 cc-security4
Lecture29 cc-security4Ankit Gupta
 
Lecture28 cc-security3
Lecture28 cc-security3Lecture28 cc-security3
Lecture28 cc-security3Ankit Gupta
 
Lecture27 cc-security2
Lecture27 cc-security2Lecture27 cc-security2
Lecture27 cc-security2Ankit Gupta
 
Lecture26 cc-security1
Lecture26 cc-security1Lecture26 cc-security1
Lecture26 cc-security1Ankit Gupta
 
Lecture 30 cloud mktplace
Lecture 30 cloud mktplaceLecture 30 cloud mktplace
Lecture 30 cloud mktplaceAnkit Gupta
 
Week 7 lecture material
Week 7 lecture materialWeek 7 lecture material
Week 7 lecture materialAnkit Gupta
 
Gurukul Cse cbcs-2015-16
Gurukul Cse cbcs-2015-16Gurukul Cse cbcs-2015-16
Gurukul Cse cbcs-2015-16Ankit Gupta
 
Microprocessor full hand made notes
Microprocessor full hand made notesMicroprocessor full hand made notes
Microprocessor full hand made notesAnkit Gupta
 
Transfer Leaning Using Pytorch synopsis Minor project pptx
Transfer Leaning Using Pytorch  synopsis Minor project pptxTransfer Leaning Using Pytorch  synopsis Minor project pptx
Transfer Leaning Using Pytorch synopsis Minor project pptxAnkit Gupta
 

More from Ankit Gupta (20)

Biometricstechnology in iot and machine learning
Biometricstechnology in iot and machine learningBiometricstechnology in iot and machine learning
Biometricstechnology in iot and machine learning
 
Week2 cloud computing week2
Week2 cloud computing week2Week2 cloud computing week2
Week2 cloud computing week2
 
Week 8 lecture material
Week 8 lecture materialWeek 8 lecture material
Week 8 lecture material
 
Week 4 lecture material cc (1)
Week 4 lecture material cc (1)Week 4 lecture material cc (1)
Week 4 lecture material cc (1)
 
Week 3 lecture material cc
Week 3 lecture material ccWeek 3 lecture material cc
Week 3 lecture material cc
 
Week 1 lecture material cc
Week 1 lecture material ccWeek 1 lecture material cc
Week 1 lecture material cc
 
Mod05lec25(resource mgmt ii)
Mod05lec25(resource mgmt ii)Mod05lec25(resource mgmt ii)
Mod05lec25(resource mgmt ii)
 
Mod05lec24(resource mgmt i)
Mod05lec24(resource mgmt i)Mod05lec24(resource mgmt i)
Mod05lec24(resource mgmt i)
 
Mod05lec23(map reduce tutorial)
Mod05lec23(map reduce tutorial)Mod05lec23(map reduce tutorial)
Mod05lec23(map reduce tutorial)
 
Mod05lec22(cloudonomics tutorial)
Mod05lec22(cloudonomics tutorial)Mod05lec22(cloudonomics tutorial)
Mod05lec22(cloudonomics tutorial)
 
Mod05lec21(sla tutorial)
Mod05lec21(sla tutorial)Mod05lec21(sla tutorial)
Mod05lec21(sla tutorial)
 
Lecture29 cc-security4
Lecture29 cc-security4Lecture29 cc-security4
Lecture29 cc-security4
 
Lecture28 cc-security3
Lecture28 cc-security3Lecture28 cc-security3
Lecture28 cc-security3
 
Lecture27 cc-security2
Lecture27 cc-security2Lecture27 cc-security2
Lecture27 cc-security2
 
Lecture26 cc-security1
Lecture26 cc-security1Lecture26 cc-security1
Lecture26 cc-security1
 
Lecture 30 cloud mktplace
Lecture 30 cloud mktplaceLecture 30 cloud mktplace
Lecture 30 cloud mktplace
 
Week 7 lecture material
Week 7 lecture materialWeek 7 lecture material
Week 7 lecture material
 
Gurukul Cse cbcs-2015-16
Gurukul Cse cbcs-2015-16Gurukul Cse cbcs-2015-16
Gurukul Cse cbcs-2015-16
 
Microprocessor full hand made notes
Microprocessor full hand made notesMicroprocessor full hand made notes
Microprocessor full hand made notes
 
Transfer Leaning Using Pytorch synopsis Minor project pptx
Transfer Leaning Using Pytorch  synopsis Minor project pptxTransfer Leaning Using Pytorch  synopsis Minor project pptx
Transfer Leaning Using Pytorch synopsis Minor project pptx
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 

Recently uploaded (20)

9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 

Asp PPT (.NET )

  • 7. Design view-Adding a button and a textbox
  • 11. Using the Validation control • Using the RequiredFieldValidator Control • In this example, we are adding two RequiredFieldValidator controls on a Web page for validating twoTextBox controls. The RequiredFieldValidator controls ensure that the two TextBox controls are not kept empty by the user at runtime.
  • 13. Default.aspx • <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" • Inherits="_Default" %> • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" • "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> • <html xmlns="http://www.w3.org/1999/xhtml"> • <head runat="server"> • <title>RequiredFieldValidator Control Example</title> • </head> • <body> • <form id="form1" runat="server"> • <div> • <asp:Label ID="Label1" runat="server" • Text="RequiredField Validator Control Example" Font-Bold="True" • Font-Size="Medium" Font-Underline="True"></asp:Label> • <br /> • <br /> • <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="Small" • Text="User name:"></asp:Label> • &nbsp;&nbsp; • <asp:TextBox ID="TextBox1" runat="server" Height="22px" • Width="175px"></asp:TextBox> • <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" • ControlToValidate="TextBox1" ErrorMessage="User name can not be • empty"></asp:RequiredFieldValidator> • <br /> • <br /> • erver"
  • 14. Cont.. • <asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Size="Small" • Text="Password:"></asp:Label> • &nbsp;&nbsp;&nbsp;&nbsp; • <asp:TextBox ID="TextBox2" runat="server" Height="22px" TextMode="Password" • Width="175px"></asp:TextBox> • <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="s • ControlToValidate="TextBox2" ErrorMessage="Password can not be • empty"></asp:RequiredFieldValidator> • <br /> • <br /> • <br /> • &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; • &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; • &nbsp;&nbsp;&nbsp;&nbsp; • <asp:Button ID="Button1" runat="server" BackColor="Black" Font-Bold="True" • Font-Size="Medium" ForeColor="White" Text="Submit" /> • </div> • </form> • </body> • </html>
  • 15. Using the RangeValidator Control: (Regular expression for date (^(19|20)dd([- /.])(0[1-9]|1[012])2(0[1-9]|[12][0- 9]|3[01])$)
  • 17. Using the RegularExpressionValidator Control • In this example, we are taking two RegularExpressionValidator controls on a Web page for validating two TextBox controls. It ensures that the data (URL and email address) entered in both the TextBox controls is valid
  • 20. Using the CompareValidator Control • In this example, we take a CompareValidator control on a Web page, which validates the third TextBox control. It ensures that the data (password) entered in the third TextBox control is exactly the same as the data • (password) entered in the second TextBox control.
  • 22. user interface and functionality. Properties Description Caption Gets or sets the caption for the calendar control. CaptionAlign Gets or sets the alignment for the caption. CellPadding Gets or sets the number of spaces between the data and the Cell border. CellSpacing Gets or sets the space between cells. DayHeaderStyle Gets the style properties for the section that displays the day of the week. DayNameFormat Gets or sets format of days of the week. DayStyle Gets the style properties for the days in the displayed month. FirstDayOfWeek Gets or sets the day of week to display in the first column.
  • 23. Cont.. NextMonthText Gets or sets the day of week to display in the first column. NextPrevFormat Gets or sets the text for next month navigation control .The default value is > . OtherMonthDayStyle Gets or sets the format of the next and previous month navigation control. PrevMonthText Gets the style properties for the days on the Calendar control that are not in the displayed month. SelectedDate Gets or sets the text for previous month navigation control. The default value is < . ShowGridLines Gets or sets the value indicating whether the gridlines would be shown.
  • 24. Events Events Description SelectionChan ged It is raised when a day, a week or an entire month is selected. DayRender t is raised when each data cell of the calendar control is rendered. VisibleMonth Changed It is raised when user changes a month.
  • 26. Default.aspx* • <%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="rich_controls._Default" %> • <asp:Content ID="Content1" runat="server" contentplaceholderid="MainContent"> • <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar> • <div _designerregion="0"> • </div> • <p>Todays date is: • <asp:Label ID="lblday" runat="server"></asp:Label> • </p> • <p>Your Birday is: • <asp:Label ID="lblbday" runat="server"></asp:Label> • </p> • </asp:Content>
  • 27. Double click on the calendar • Public Class _Default • Inherits Page • Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load • End Sub • Protected Sub Calendar1_SelectionChanged(sender As Object, e As EventArgs) Handles Calendar1.SelectionChanged • lblday.Text = Calendar1.TodaysDate.ToShortDateString() • lblbday.Text = Calendar1.SelectedDate.ToShortDateString() • End Sub • End Class
  • 29. Creating custom controls with user Controls • ASP.NET allows the users to create controls. These user defined controls are categorized into: • User controls • Custom controls
  • 30. User Conrols • User controls behaves like miniature ASP.NETpages or web forms, which could be used by many other pages. These are derived from the system.Web.UI.UserControl class. These controls have the following characteristics • They have an .ascx extension. • They may not contain any <html>, <body>,or <form> tags. • They have a Control directive instead of a Page directive. • To understand the concept, let us create a simple user control, which will work as footer for the web pages. To create and use the user control, take the following steps:
  • 31. Steps • Create a new web application. • Right click on the project folder on the Solution Explorer and choose Add New Item. • Select Web User Control from the Add New Item dialog box and name it u1.ascx. Initially, the footer.ascx contains only a Control directive. • <%@ Control Language="C#" AutoEventWireup="true" • CodeBehind=“u1.ascx.cs" Inherits="customcontroldemo.footer" %>
  • 33. Register user control • <%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="WebApplication12._Default" %> • <%@ Register Src="~/u1.ascx" TagName="u" TagPrefix="ut" %>
  • 34. Add a form to the project and use this control • <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication12.WebForm1" %> • <%@ Register Src="~/u1.ascx" TagName="u" TagPrefix="ut1" %> • <!DOCTYPE html> • <html xmlns="http://www.w3.org/1999/xhtml"> • <head runat="server"> • <title></title> • </head> • <body> • <form id="form1" runat="server"> • <div> • • </div> • <ut1:u ID="footer1" runat="server" /> • </form> • </body> • </html>
  • 36. Custom Control • Custom controls are deployed as individual assemblies. They are compiled into a Dynamic Link Library (DLL) and used as any other ASP.NET server control. They could be created in either of the following way: • By deriving a custom control from an existing control • By composing a new custom control combing two or more existing controls • By deriving from the base control class To understand the concept, let us create a custom control, which will simply render a text message on the browser. If you want to change the functionality of existing controls, such as a button or label, you can directly derive the new class with these existing classes and can change their default behavior. In brief, the Control class provides the basic functionality by which you can place it in the control tree for a Page class. The WebControl class adds the functionality to the base Control class for displaying visual content on the client computer. For example, you can use the WebControl class to control the look and styles through properties like font, color, and height.
  • 37. 1. Create an empty ASP.NET web form application
  • 38. 2. Right click on the web application and add ASP.NET server control:wc (name of the custom control) Imports System Imports System.Collections.Generic Imports System.Data Imports System.ComponentModel Imports System.Text Imports System.Web Imports System.Web.UI Imports System.Web.UI.WebControls <DefaultProperty("Text"), ToolboxData("<{0}:wc runat=server></{0}:wc>")> _ Public Class wc Inherits WebControl <Bindable(True), Category("Appearance"), DefaultValue(""), Localizable(True)> Property Text() As String Get Dim s As String = CStr(ViewState("Text")) If s Is Nothing Then Return String.Empty Else Return s End If End Get Set(ByVal Value As String) ViewState("Text") = Value End Set End Property Protected Overrides Sub RenderContents(ByVal writer As HtmlTextWriter) writer.Write("hello world from custom controls") End Sub End Class
  • 39. Build the application • Open a new or existing web form where you can use the custom control.
  • 40. Web form2.aspx file • <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm2.aspx.vb" Inherits="WebApplication15.WebForm2" %> • <%@ Register assembly="WebApplication15" namespace="WebApplication15" tagprefix="cc1" %> • <!DOCTYPE html> • <html xmlns="http://www.w3.org/1999/xhtml"> • <head runat="server"> • <title></title> • </head> • <body> • <form id="form1" runat="server"> • <div> • • <cc1:wc ID="wc1" runat="server" /> • • </div> • </form> • </body> • </html>