sanila.p
sanila222@gmail.com
www.facebook.com/username
twitter.com/sanila92
linkedin.com/sanila
ASP.NET CONTROLS
controls
• Controls are the building blocks in web form
• Server controls are tags that are understood
by the server.
Asp.net controls
server control
Html server
control
Webserver
control
Validation
server control
Html server control
• HTML server controls are HTML tags
understood by the server
• All HTML server controls must be withi...
Html server controls in asp.net
Html server controls Description
Controls an <a> HTML element
HtmlButton Controls a <butto...
Example
<html>
<body>
<form runat="server">
<input id="Text1" type="text" />
</form>
</body>
</html>
Web server control
• Web server controls are special ASP.NET tags
understood by the server
• Web server controls are also ...
Webserver control Description
AdRotator Displays a sequence of images
Button Displays a push button
BulletedList Creates a...
Example
<html>
<body>
<form runat="server">
<asp:Button id="button1" Text="Click me!"
runat="server" OnClick="submit"/>
</form>
</...
Validation server control
• Validation server controls are used to validate user-input. If
the user-input does not pass va...
Validation Server Control Description
CompareValidator Compares the value of one input
control to the value of another inp...
Example
<html>
<body>
<form runat="server">
<p>Enter a number from 1 to 100:
<asp:TextBox id="tbox1" runat="server" />
<br /><br /...
Difference between server control
and html control
 Asp.net server control: retain state
 Html control: does not retain ...
Want to learn more about programming or Looking to become a good programmer?
Are you wasting time on searching so many con...
Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ s...
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Sta...
Controls in asp.net
Upcoming SlideShare
Loading in...5
×

Controls in asp.net

180

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
180
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Controls in asp.net

  1. 1. sanila.p sanila222@gmail.com www.facebook.com/username twitter.com/sanila92 linkedin.com/sanila ASP.NET CONTROLS
  2. 2. controls • Controls are the building blocks in web form • Server controls are tags that are understood by the server.
  3. 3. Asp.net controls server control Html server control Webserver control Validation server control
  4. 4. Html server control • HTML server controls are HTML tags understood by the server • All HTML server controls must be within a <form> tag with the runat="server" attribute. • The runat="server" attribute indicates that the form should be processed on the server.
  5. 5. Html server controls in asp.net Html server controls Description Controls an <a> HTML element HtmlButton Controls a <button> HTML element HtmlInputButton Controls <input type="button">, <input type="submit">, and <input type="reset"> HTML elements HtmlInputCheckBox Controls an <input type="checkbox"> HTML element HtmlInputRadioButton Controls an <input type="radio"> HTML element HtmlTextArea Controls a <textarea> HTML element
  6. 6. Example
  7. 7. <html> <body> <form runat="server"> <input id="Text1" type="text" /> </form> </body> </html>
  8. 8. Web server control • Web server controls are special ASP.NET tags understood by the server • Web server controls are also created on the server and they require a runat="server" attribute to work.
  9. 9. Webserver control Description AdRotator Displays a sequence of images Button Displays a push button BulletedList Creates a list in bullet format Repeater Displays a repeated list of items bound to the control HyperLink Creates a hyperlink
  10. 10. Example
  11. 11. <html> <body> <form runat="server"> <asp:Button id="button1" Text="Click me!" runat="server" OnClick="submit"/> </form> </body> </html>
  12. 12. Validation server control • Validation server controls are used to validate user-input. If the user-input does not pass validation, it will display an error message to the user. • Each validation control performs a specific type of validation (like validating against a specific value or a range of values). • By default, page validation is performed when a Button, is clicked. You can prevent validation when a button control is clicked by setting the CausesValidation property to false
  13. 13. Validation Server Control Description CompareValidator Compares the value of one input control to the value of another input control or to a fixed value CustomValidator Allows you to write a method to handle the validation of the value entered RangeValidator Checks that the user enters a value that falls between two values RegularExpressionValidator Ensures that the value of an input control matches a specified pattern RequiredFieldValidator Makes an input control a required field ValidationSummary Displays a report of all validation errors occurred in a Web page
  14. 14. Example
  15. 15. <html> <body> <form runat="server"> <p>Enter a number from 1 to 100: <asp:TextBox id="tbox1" runat="server" /> <br /><br /> <asp:Button Text="Submit" runat="server" /> <asp:RangeValidator ControlToValidate="tbox1" MinimumValue="1" MaximumValue="100" Type="Integer" Text="The value must be from 1 to 100!" runat="server" /> </form> </body> </html>
  16. 16. Difference between server control and html control  Asp.net server control: retain state  Html control: does not retain state Example
  17. 17. Want to learn more about programming or Looking to become a good programmer? Are you wasting time on searching so many contents online? Do you want to learn things quickly? Tired of spending huge amount of money to become a Software professional? Do an online course @ baabtra.com We put industry standards to practice. Our structured, activity based courses are so designed to make a quick, good software professional out of anybody who holds a passion for coding.
  18. 18. Follow us @ twitter.com/baabtra Like us @ facebook.com/baabtra Subscribe to us @ youtube.com/baabtra Become a follower @ slideshare.net/BaabtraMentoringPartner Connect to us @ in.linkedin.com/in/baabtra Give a feedback @ massbaab.com/baabtra Thanks in advance www.baabtra.com | www.massbaab.com |www.baabte.com
  19. 19. Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Cafit Square, Hilite Business Park, Near Pantheerankavu, Kozhikode Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com Contact Us
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×