ASP' NET - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

ASP' NET

Description:

The On Error GoTo statement enables exception handling and ... font size='2' face='Verdana' This is a paragraph. /font /p p font size='5' face='Times' ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 25
Provided by: Rah487
Category:
Tags: asp | net | verdana

less

Transcript and Presenter's Notes

Title: ASP' NET


1
ASP. NET
Lecture-6
2
Agenda
  • Exceptions
  • Unstructured
  • On Error
  • Resume
  • Structured
  • Try Catch Finally
  • Hyper Text Markup Language (HTML)
  • Basic Structure
  • ltHeadgt
  • ltBodygt
  • Basic Tags

3
Unstructured Exception
  • Syntax

Module Module1 Public sub ltsub_namegt ? On Error
Goto Handler ? Exit Sub Handler ? End Sub
End Module
4
Unstructured Exception
  • On Error
  • The On Error GoTo statement enables exception
    handling and specifies the location of the
    exception-handling code within a procedure.
  • Using On Error GoTo statement
  • On Error GoTo line 0 -1 Resume Next

5
Unstructured Exception
  • Dim a, b, c As Integer
  • a 0 b 15
  • On Error GoTo Handler '''Important'''
  • c b / a
  • NextLine
  • Response.Write("Program executed
    Successfully")
  • Exit Sub
  • Handler
  • If TypeOf Err.GetException Is
    OverflowException Then
  • Response.Write("Devide by Zero
    Error...")
  • Resume NextLine
  • End If
  • End Sub

6
Exceptions
  • Object Exception
  • ApplicationException
  • CodeDomSerializerException
  • InvalidPrinterException
  • IOException
  • IsolatedStorageException
  • PathTooLongException
  • CookieException
  • ProtocolViolationException
  • WebException
  • MissingManifestResourceException
  • SUDSGeneratorException
  • SUDSParserException
  • SystemException
  • UriFormatException
  • SoapException

7
Exception example
  • Object Exception
  • SystemException
  • ArithmeticException
  • OverflowException
  • ?

8
Structured Exception
  • Syntax

Public Sub ltsub_namegt Try ? Catch e As
Exception1 ? Catch e As Exception2 ? End Try
End Sub
9
Structured Exception
  • Dim a As Integer 0
  • Dim b As Integer 15
  • Dim c As Integer
  • Try
  • 'c b / a
  • If b lt 18 Then
  • Throw New ApplicationException("My
    Custom Exception ")
  • End If
  • Catch ex As ArithmeticException
  • Response.Write("Arithmatic
    overflow...")
  • Catch ex As ApplicationException
  • Response.Write("Application exception
    caught")
  • Catch ex As System.DivideByZeroException
  • Response.Write("Devide by zero...")
  • Finally
  • Response.Write("Graceful
    degradation")
  • End Try

10
HTML ???
  • The definition of HTML is HyperText Markup
    Language.
  • HyperText is the method by which you move around
    on the web by clicking on special text called
    hyperlinks which bring you to the next page. The
    fact that it is hyper just means it is not linear
    i.e. you can go to any place on the Internet
    whenever you want by clicking on links there is
    no set order to do things in.
  • Markup is what HTML tags do to the text inside
    them. They mark it as a certain type of text
    (italicised text, for example).
  • HTML is a Language, as it has code-words and
    syntax like any other language.

11
HTML How does it work ?
  • HTML consists of a series of short codes typed
    into a text-file by the site author these are
    the tags.
  • The text is then saved as a html file, and viewed
    through a browser, like Internet Explorer or
    Netscape Navigator.
  • This browser reads the file and translates the
    text into a visible form.

12
HTML Basic Structure
  • lthtmlgt...lt/htmlgt
  • Standard opening and closing tags for any HTML
    page. Enclose everything else in these. Container
    tag.
  • lt!-- ... --gt
  • A comment whatever you put here will be skipped
    over by the browser.
  • ltheadgt...lt/headgt
  • Starts the header part of your document.
    Everything between these is mainly used to help
    your browser and search engines classify your
    page. Using this is optional, but recommended.
    Container tag.
  • ltbodygt...lt/bodygt
  • Everything visible on your page goes between
    these tags. Everything. Container tag.

13
My very first Page ?
lthtmlgt ltheadgt lttitlegtMy very first HTML
Pagelt/titlegt lt/headgt ltbodygt This is the
text ur page gonna show !!! lt/bodygt lt/htmlgt
14
Head Tag ltheadgt
  • lttitlegt...lt/titlegt
  • Whatever is between these tags will appear in the
    blue bar at the top of the screen.
  • ltmetagt
  • A group of tags that give page and creator
    information specifically to the search engines.
  • ltbasegt
  • Changes the default link target or relative link
    URL, useful if the page is read on another
    server.
  • ltlinkgt
  • Allows you to associate stylesheets and a
    favorites icon to your page.

15
Body Tag ltbodygt
  • Background
  • Bgcolor
  • Text
  • Link
  • Vlink
  • Alink

16
Body Tag ltbodygt
ltHTMLgt ltHEADgt ltTITLEgtA study of population
dynamicslt/TITLEgt lt/HEADgt ltBODY
bgcolor"white" text"black" link"red"
alink"fuchsia" vlink"maroon"gt ...
document body ... lt/BODYgt lt/HTMLgt
17
Basic Tags
  • lthxgt...lt/hxgt
  • Sets the text as a heading, with values of h1
    (the biggest) to h6 (the smallest).
  • e.g.
  • lth1gtThis is a headinglt/h1gt
  • lth2gtThis is a headinglt/h2gt
  • lth3gtThis is a headinglt/h3gt
  • lth4gtThis is a headinglt/h4gt
  • lth5gtThis is a headinglt/h5gt
  • lth6gtThis is a headinglt/h6gt

18
Basic Tags
  • ltpgt
  • The ltpgt tag defines a paragraph.
  • Attributes
  • Align left, right, center, justify

ltHTMLgt ltHEADgt ltTITLEgtA study of population
dynamicslt/TITLEgt lt/HEADgt ltBODY
bgcolor"white" text"black" link"red"
alink"fuchsia" vlink"maroon"gt ltp
ALIGNCENTER gt Paragraph number 1. lt/pgt lt/BODYgt
lt/HTMLgt
19
Basic Tags
  • Paragraph Container Tags
  • ltFONTgt
  • The ltfontgt tag specifies the font face, font
    size, and font color of text.
  • Attributes
  • Color rgb(x,x,x), xxxxxx, colorname
  • Face Name of the font e.g. arial
  • Size Number between 1 to 7

20
Basic Tags
ltHTMLgt ltbodygt ltpgt ltfont size"2"
face"Verdana"gt This is a paragraph. lt/fontgt lt/pgt
ltpgt ltfont size"5" face"Times"gt This is another
paragraph. lt/fontgt lt/pgt lt/bodygt lt/HTMLgt
21
Basic Tags
  • ltIgtRenders as italic text
  • ltBgtRenders as bold text
  • ltUgtDefines Underlined text
  • ltStrikegtDefines strikethrough text, same as ltsgt
  • ltBIGgtRenders as bigger text
  • ltSMALLgtRenders as smaller text
  • ltSUBgtDefines Subscript text
  • ltSUPgtDefines Superscript text

22
Basic Tags
  • ltEMgtRenders as emphasized text
  • ltSTRONGgtRenders as strong emphasized text
  • ltDEFgtRenders as strong emphasized text
  • ltCODEgtDefines computer code text
  • ltKBDgtDefines keyboard text
  • ltBRgtThis tag inserts a single line break
  • ltHRgt Tag inserts a horizontal rule.
  • ltabbrgtIndicates an abbreviated form
  • ltacronymgtIndicates start of an acronym

23
Basic Tags
  • ltAgt
  • Defines anchor. It can be used in two ways
  • To create a link to another document by using the
    href attribute.
  • To create a bookmark inside a document, by using
    the name or id attribute.
  • e.g.
  • ltpgtltA hrefhttp//sdetu target_blankgt SDET
    Unit lt/Agtlt/pgt

24
Questions???
Write a Comment
User Comments (0)
About PowerShow.com