60 likes | 200 Views
<% ..............ASP Codes ................. %>. if ....then ....else ...... end if. for ..............................next. do while .................... loop. database. response.write “ “ & “ “ & i. html IE Tuna Tuna <B> Tuna </B> Tuna
E N D
<% ..............ASP Codes ................. %> if ....then ....else ...... end if for ..............................next do while .................... loop database response.write “ “ & “ “ & i html IE TunaTuna <B>Tuna</B> Tuna <font size = “2”>Tuna</font> response.write“<font size = “2”>Tuna</font>“ typeMismatch ASP-Code Examples
response.write response.write“<font size = “2”>Tuna</font>“ Handling Error: 1st way: Do not use “ “ in HTML! But; <font face = lucida handwriting> face = lucida ? <% response.write<table width = 100%> %> ? 2nd way: use ‘ ‘ instead of “ “ Examples: Example 1:Adding 2 numbers <% num1 = 40 num2 = 30 response.write num1 + num2 %>
response.write Example 2:finding y <%a=1b=5c=2y= b*b - 4*a*cresponse.write y%> Example 3:finding the square of 2 numbers and the addition of their square <%num1 = 10num2 = 20sq1 = num1 * num1sq2 = num2 * num2sum = num1 + num2response.writesq2 &","& sq1 & "," & sum
response.write & if..then..else..end if Example 4:VAT included Price <%VAT = 18PRICE = 3000000VAT_INC = PRICE + (PRICE * VAT)/100Response.Write "VAT included price is"& " " & VAT_INC%> Example 5:positive or negative? <%num = 89IF num >0 THENresponse.write num &" "& "is a positive number.“ELSEresponse.write num &" "& "is a negative number.“END IF%>
response.write & if..then..else..end if Example 6: If a number less than 10, output it's square otherwise the number only.<% num = 9IF num > 10 THENsq = num * numresponse.write sqELSEresponse.write numEND IF%> Example 7: Subtract the smaller from the larger <%num1 = 3num2 = 5IF num1>num2 THENnum = num1 - num2ELSEnum = num2 - num1END IF Response.Write num%>
response.write & if..then..else..end if Example 8: SNG room 100$ others 150$> <% room_type = "DBL“num_of_night = 10IF room_type = "SNG" THENprice = 100 * num_of_night ELSEprice = 150 * num_of_nightEND IFResponse.Write "room price is " & price%> Example 9: PASS, FAIL <% final = 50IF final >= 50 THENResponse.Write "PASS“ELSEResponse.Write "FAIL“END IF%>