SlideShare uma empresa Scribd logo
1 de 21
ASP. NET Web server Controls
Session 9
Objectives
• Overview of web server controls
• The Label Server Control
• The Textbox Server Control
• The Button Server Control
• The Link Button Server Control
• The Image Butt on Server Control
• The Hyperlink Server Control
• The Dropdown List Server Control
continue…
• The List Box Server Control
• The Checkbox Server Control
• The Radio Button Server Control
• The Radio Button List Server Control
• The Calendar Server Control
• Panel Server Control
• Basic knowledge about server controls
• Form designing using server controls
• Applications of server controls
Overview
• There are two types of server controls, HTML server
controls and Web server controls, the latter is
considered the more powerful and flexible. HTML
server controls enable you to manipulate HTML
elements from your server - side code.
• Web server controls are powerful because they are
not explicitly tied to specific HTML elements; rather,
they are more closely aligned to the specific
functionality that you want to generate.
Label server control
• The Label server control is used to display text
in the browser.
• Because this is a server control, you can
dynamically alter the text from your server-
side code.
Example
<form id="form1" runat="server">
<p>
<asp:Label ID="Label1" runat="server"
AccessKey="N">User<u>n</u>ame
</asp:Label>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox></p
>
<p>
<asp:Label ID="Label2" runat="server"
AccessKey="P"><u>P</u>assword<
/asp:Label>
<asp:TextBox ID="TextBox2"
Runat="server"></asp:TextBox></
p>
<p>
<asp:Button ID="Button1"
runat="server" Text="Submit" />
</p>
</form>
Textbox Server Control
• One of the main features of Web pages is to
offer forms that end users can use to submit
their information for collection.
• The Textbox server control is one of the most
used controls in this space.
• the control provides a text box on the form that
enables the end user to input text.
Textbox Server Control
• First, the Textbox control can be used as a standard HTML
text box, as shown in the following code snippet:
<asp:TextBox ID="TextBox1" runat="server" Text=”Hello
World”></asp:TextBox>
• Second, the Textbox control can allow end users to input
their passwords into a form. This is done by changing the
TextMode attribute of the Textbox control to Password, as
illustrated here:
<asp:TextBox ID="TextBox1" runat="server"
TextMode="Password"></asp:TextBox>
Button Server Control
Another common control for your Web forms is a button that can
be constructed using the Button server control. Buttons are the
usual element used to submit forms. Most of the time you are
simply dealing with items contained in your forms through the
Button control’s OnClick event.
Example:
<asp:Button ID="Button1" runat="server"
Text="Button"OnClick="Button1_Click"
onclientclick="AlertHello()" />
LinkButton Server Control
The Link Button server control is a variation of the
Button control. It is the same except that the Link
Button control takes the form of a hyperlink.
Nevertheless, it is not a typical hyperlink. When the
end user clicks the link, it behaves like a button. This
is an ideal control to use if you have a large number
of buttons on your Web form.
Example:
<asp:LinkButton ID="LinkButton1" Runat="server“
OnClick="LinkButton1_Click">Submit your name to our database
</asp:LinkButton>
The ImageButt on Server Control
The Image Button control is also a variation of the Button
control. It is almost exactly the same as the Button control
except that it enables you to use a custom image as the
form’s button instead of the typical buttons used on most
forms. This means that you can create your own buttons as
images and the end users can click the images to submit form
data.
Example:
<asp:ImageButton ID="ImageButton1" runat="server"
ImageUrl="~/002.GIF" />
The HyperLink Server Control
The Hyperlink server control enables you to programmatically
work with any hyperlinks on your Web pages. Hyperlinks are
links that allow end users to transfer from one page to another.
You can set the text of a hyperlink using the control’s Text
attribute:
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl="~/SecondPage.aspx">Go to this page
here</asp:HyperLink>
The DropDownList Server Control
The select box generated by the DropDownList control
displays a single item and allows the end user to make a
selection from a larger list of items. Depending on the
number of choices available in the select box, the end user
may have to scroll through a list of items. Note that the
appearance of the scroll bar in the drop-down list is
automatically created by the browser depending on the
browser version and the number of items contained in the
list.
Example:
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Car</asp:ListItem>
<asp:ListItem>Airplane</asp:ListItem>
<asp:ListItem>Train</asp:ListItem>
</asp:DropDownList>
ListBox Server Control
The ListBox server control has a function similar to
the DropDownList control. It displays a collection of
items. The ListBox control behaves differently from
the DropDownList control in that it displays more of
the collection to the end user, and it enables the end
user to make multiple selections from the collection
— something that is not possible with the
DropDownList control.
Example:
<asp:ListBox ID="ListBox1" runat="server"
SelectionMode="Multiple">
<asp:ListItem>India</asp:ListItem>
<asp:ListItem>Pakistan</asp:ListItem>
<asp:ListItem>Sri Lanka</asp:ListItem>
<asp:ListItem>Bangaladesh</asp:ListItem>
</asp:ListBox>
Checkbox Server Control
Check boxes on a Web form enable your users to either
make selections from a collection of items or specify a
value of an item to be yes/no, on/off, or true/false. Use
either the CheckBox control or the CheckBoxList control
to include check boxes in your Web forms.
The CheckBox control allows you to place single check
boxes on a form; the CheckBoxList control allows you to
place collections of check boxes on the form. You can use
multiple CheckBox controls on your ASP. NET pages, but
then you are treating each check box as its own element
with its own associated events. On the other hand, the
CheckBoxList control allows you to take multiple check
boxes and create specific events for the entire group.
Example:
<asp:CheckBox ID="CheckBox1" runat="server"
Text="ASP.NET!“OnCheckedChanged="CheckB
ox1_CheckedChanged" AutoPostBack="True" />
RadioButtonList Server Control
The RadioButtonList server control lets you display a collection of
radio buttons on a Web page. The RadioButtonList control is quite
similar to the CheckBoxList and other list controls in that it allows you
to iterate through to see what the user selected, to make counts, or to
perform other actions.
Example:
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem Selected="True">English</asp:ListItem>
<asp:ListItem>Russian</asp:ListItem>
<asp:ListItem>Italian</asp:ListItem>
<asp:ListItem>Swedish</asp:ListItem>
</asp:RadioButtonList>
Summery
• Asp.Net web server controls
• Several controls feature & property.

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Standard control in asp.net
Standard control in asp.netStandard control in asp.net
Standard control in asp.net
 
ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server Controls
 
MVC 3-RAZOR Validation
MVC 3-RAZOR ValidationMVC 3-RAZOR Validation
MVC 3-RAZOR Validation
 
2310 b 05
2310 b 052310 b 05
2310 b 05
 
Client control
Client controlClient control
Client control
 
Custom Controls in ASP.net
Custom Controls in ASP.netCustom Controls in ASP.net
Custom Controls in ASP.net
 
Ajaxppt
AjaxpptAjaxppt
Ajaxppt
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
Custom control in asp.net
Custom control in asp.netCustom control in asp.net
Custom control in asp.net
 
Custom controls
Custom controlsCustom controls
Custom controls
 
Asp dot net final (2)
Asp dot net   final (2)Asp dot net   final (2)
Asp dot net final (2)
 
Web api 2 With MVC 5 With TrainerKrunal
Web api 2 With MVC 5 With TrainerKrunalWeb api 2 With MVC 5 With TrainerKrunal
Web api 2 With MVC 5 With TrainerKrunal
 
Visual studio 2008 asp net
Visual studio 2008 asp netVisual studio 2008 asp net
Visual studio 2008 asp net
 
Asp.net html server control
Asp.net html  server controlAsp.net html  server control
Asp.net html server control
 
2310 b 06
2310 b 062310 b 06
2310 b 06
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
 
Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...
Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...
Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...
 
ASP.NET AJAX Basics
ASP.NET AJAX BasicsASP.NET AJAX Basics
ASP.NET AJAX Basics
 
Asp.NET Validation controls
Asp.NET Validation controlsAsp.NET Validation controls
Asp.NET Validation controls
 
Introduction to asp
Introduction to aspIntroduction to asp
Introduction to asp
 

Semelhante a ASP.NET Session 9

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 04 - Additional Web Server Controls
ASP.NET 04 - Additional Web Server ControlsASP.NET 04 - Additional Web Server Controls
ASP.NET 04 - Additional Web Server ControlsRandy Connolly
 
SynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseindiappsdevelopment
 
ASP.NET Session 16
ASP.NET Session 16ASP.NET Session 16
ASP.NET Session 16Sisir Ghosh
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04Mani Chaubey
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17Vivek chan
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04Vivek chan
 
Dotnet Frame Work and Controls
Dotnet Frame Work and ControlsDotnet Frame Work and Controls
Dotnet Frame Work and Controlssunmitraeducation
 
html 5 new form attribute
html 5 new form attributehtml 5 new form attribute
html 5 new form attributePriyanka Rasal
 
HTML (HyperText Markup Language)
HTML (HyperText Markup Language)HTML (HyperText Markup Language)
HTML (HyperText Markup Language)Amber Bhaumik
 

Semelhante a ASP.NET Session 9 (20)

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 04 - Additional Web Server Controls
ASP.NET 04 - Additional Web Server ControlsASP.NET 04 - Additional Web Server Controls
ASP.NET 04 - Additional Web Server Controls
 
CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
 
Asp PPT (.NET )
Asp PPT (.NET )Asp PPT (.NET )
Asp PPT (.NET )
 
SynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically development
 
ASP.NET Session 16
ASP.NET Session 16ASP.NET Session 16
ASP.NET Session 16
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
 
Html forms
Html formsHtml forms
Html forms
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Html forms
Html formsHtml forms
Html forms
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
 
Dotnet Frame Work and Controls
Dotnet Frame Work and ControlsDotnet Frame Work and Controls
Dotnet Frame Work and Controls
 
Controls
ControlsControls
Controls
 
html 5 new form attribute
html 5 new form attributehtml 5 new form attribute
html 5 new form attribute
 
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
 
Web services intro.
Web services intro.Web services intro.
Web services intro.
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 
HTML (HyperText Markup Language)
HTML (HyperText Markup Language)HTML (HyperText Markup Language)
HTML (HyperText Markup Language)
 
ASP DOT NET
ASP DOT NETASP DOT NET
ASP DOT NET
 

Mais de Sisir Ghosh

ASP.NET Session 2
ASP.NET Session 2ASP.NET Session 2
ASP.NET Session 2Sisir Ghosh
 
ASP.NET Session 3
ASP.NET Session 3ASP.NET Session 3
ASP.NET Session 3Sisir Ghosh
 
ASP.NET Session 4
ASP.NET Session 4ASP.NET Session 4
ASP.NET Session 4Sisir Ghosh
 
ASP.NET Session 7
ASP.NET Session 7ASP.NET Session 7
ASP.NET Session 7Sisir Ghosh
 
ASP.NET Session 8
ASP.NET Session 8ASP.NET Session 8
ASP.NET Session 8Sisir Ghosh
 
ASP.NET Session 11 12
ASP.NET Session 11 12ASP.NET Session 11 12
ASP.NET Session 11 12Sisir Ghosh
 
ASP.NET Session 13 14
ASP.NET Session 13 14ASP.NET Session 13 14
ASP.NET Session 13 14Sisir Ghosh
 
ASP.NET System design 2
ASP.NET System design 2ASP.NET System design 2
ASP.NET System design 2Sisir Ghosh
 
ASP.NET Session 1
ASP.NET Session 1ASP.NET Session 1
ASP.NET Session 1Sisir Ghosh
 
Network security
Network securityNetwork security
Network securitySisir Ghosh
 
Module ii physical layer
Module ii physical layerModule ii physical layer
Module ii physical layerSisir Ghosh
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correctionSisir Ghosh
 
Overview of data communication and networking
Overview of data communication and networkingOverview of data communication and networking
Overview of data communication and networkingSisir Ghosh
 
Application layer
Application layerApplication layer
Application layerSisir Ghosh
 

Mais de Sisir Ghosh (16)

ASP.NET Session 2
ASP.NET Session 2ASP.NET Session 2
ASP.NET Session 2
 
ASP.NET Session 3
ASP.NET Session 3ASP.NET Session 3
ASP.NET Session 3
 
ASP.NET Session 4
ASP.NET Session 4ASP.NET Session 4
ASP.NET Session 4
 
ASP.NET Session 7
ASP.NET Session 7ASP.NET Session 7
ASP.NET Session 7
 
ASP.NET Session 8
ASP.NET Session 8ASP.NET Session 8
ASP.NET Session 8
 
ASP.NET Session 11 12
ASP.NET Session 11 12ASP.NET Session 11 12
ASP.NET Session 11 12
 
ASP.NET Session 13 14
ASP.NET Session 13 14ASP.NET Session 13 14
ASP.NET Session 13 14
 
ASP.NET System design 2
ASP.NET System design 2ASP.NET System design 2
ASP.NET System design 2
 
ASP.NET Session 1
ASP.NET Session 1ASP.NET Session 1
ASP.NET Session 1
 
Transport layer
Transport layerTransport layer
Transport layer
 
Routing
RoutingRouting
Routing
 
Network security
Network securityNetwork security
Network security
 
Module ii physical layer
Module ii physical layerModule ii physical layer
Module ii physical layer
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correction
 
Overview of data communication and networking
Overview of data communication and networkingOverview of data communication and networking
Overview of data communication and networking
 
Application layer
Application layerApplication layer
Application layer
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 

ASP.NET Session 9

  • 1. ASP. NET Web server Controls Session 9
  • 2. Objectives • Overview of web server controls • The Label Server Control • The Textbox Server Control • The Button Server Control • The Link Button Server Control • The Image Butt on Server Control • The Hyperlink Server Control • The Dropdown List Server Control continue…
  • 3. • The List Box Server Control • The Checkbox Server Control • The Radio Button Server Control • The Radio Button List Server Control • The Calendar Server Control • Panel Server Control • Basic knowledge about server controls • Form designing using server controls • Applications of server controls
  • 4. Overview • There are two types of server controls, HTML server controls and Web server controls, the latter is considered the more powerful and flexible. HTML server controls enable you to manipulate HTML elements from your server - side code. • Web server controls are powerful because they are not explicitly tied to specific HTML elements; rather, they are more closely aligned to the specific functionality that you want to generate.
  • 5. Label server control • The Label server control is used to display text in the browser. • Because this is a server control, you can dynamically alter the text from your server- side code.
  • 6. Example <form id="form1" runat="server"> <p> <asp:Label ID="Label1" runat="server" AccessKey="N">User<u>n</u>ame </asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></p > <p> <asp:Label ID="Label2" runat="server" AccessKey="P"><u>P</u>assword< /asp:Label> <asp:TextBox ID="TextBox2" Runat="server"></asp:TextBox></ p> <p> <asp:Button ID="Button1" runat="server" Text="Submit" /> </p> </form>
  • 7. Textbox Server Control • One of the main features of Web pages is to offer forms that end users can use to submit their information for collection. • The Textbox server control is one of the most used controls in this space. • the control provides a text box on the form that enables the end user to input text.
  • 8. Textbox Server Control • First, the Textbox control can be used as a standard HTML text box, as shown in the following code snippet: <asp:TextBox ID="TextBox1" runat="server" Text=”Hello World”></asp:TextBox> • Second, the Textbox control can allow end users to input their passwords into a form. This is done by changing the TextMode attribute of the Textbox control to Password, as illustrated here: <asp:TextBox ID="TextBox1" runat="server" TextMode="Password"></asp:TextBox>
  • 9. Button Server Control Another common control for your Web forms is a button that can be constructed using the Button server control. Buttons are the usual element used to submit forms. Most of the time you are simply dealing with items contained in your forms through the Button control’s OnClick event. Example: <asp:Button ID="Button1" runat="server" Text="Button"OnClick="Button1_Click" onclientclick="AlertHello()" />
  • 10. LinkButton Server Control The Link Button server control is a variation of the Button control. It is the same except that the Link Button control takes the form of a hyperlink. Nevertheless, it is not a typical hyperlink. When the end user clicks the link, it behaves like a button. This is an ideal control to use if you have a large number of buttons on your Web form.
  • 12. The ImageButt on Server Control The Image Button control is also a variation of the Button control. It is almost exactly the same as the Button control except that it enables you to use a custom image as the form’s button instead of the typical buttons used on most forms. This means that you can create your own buttons as images and the end users can click the images to submit form data. Example: <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/002.GIF" />
  • 13. The HyperLink Server Control The Hyperlink server control enables you to programmatically work with any hyperlinks on your Web pages. Hyperlinks are links that allow end users to transfer from one page to another. You can set the text of a hyperlink using the control’s Text attribute: <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/SecondPage.aspx">Go to this page here</asp:HyperLink>
  • 14. The DropDownList Server Control The select box generated by the DropDownList control displays a single item and allows the end user to make a selection from a larger list of items. Depending on the number of choices available in the select box, the end user may have to scroll through a list of items. Note that the appearance of the scroll bar in the drop-down list is automatically created by the browser depending on the browser version and the number of items contained in the list.
  • 16. ListBox Server Control The ListBox server control has a function similar to the DropDownList control. It displays a collection of items. The ListBox control behaves differently from the DropDownList control in that it displays more of the collection to the end user, and it enables the end user to make multiple selections from the collection — something that is not possible with the DropDownList control.
  • 18. Checkbox Server Control Check boxes on a Web form enable your users to either make selections from a collection of items or specify a value of an item to be yes/no, on/off, or true/false. Use either the CheckBox control or the CheckBoxList control to include check boxes in your Web forms.
  • 19. The CheckBox control allows you to place single check boxes on a form; the CheckBoxList control allows you to place collections of check boxes on the form. You can use multiple CheckBox controls on your ASP. NET pages, but then you are treating each check box as its own element with its own associated events. On the other hand, the CheckBoxList control allows you to take multiple check boxes and create specific events for the entire group. Example: <asp:CheckBox ID="CheckBox1" runat="server" Text="ASP.NET!“OnCheckedChanged="CheckB ox1_CheckedChanged" AutoPostBack="True" />
  • 20. RadioButtonList Server Control The RadioButtonList server control lets you display a collection of radio buttons on a Web page. The RadioButtonList control is quite similar to the CheckBoxList and other list controls in that it allows you to iterate through to see what the user selected, to make counts, or to perform other actions. Example: <asp:RadioButtonList ID="RadioButtonList1" runat="server"> <asp:ListItem Selected="True">English</asp:ListItem> <asp:ListItem>Russian</asp:ListItem> <asp:ListItem>Italian</asp:ListItem> <asp:ListItem>Swedish</asp:ListItem> </asp:RadioButtonList>
  • 21. Summery • Asp.Net web server controls • Several controls feature & property.