|
-
Nov 3rd, 2006, 02:27 AM
#1
Thread Starter
Addicted Member
asp beginer
hi,
i am very much new to the asp and i am going to ask a silly question that is where to write the code of asp i mean something like
<%
TheName=request.form("name)
if TheName="John" then
response.write ("Hi, John. How are you?")
response.write ("<br>Did you know I got married last month?")
else
response.write ("Hi. How are you?")
end if
%>
i know that i case of html what we do is see the source option of the internet explorer and write the code there but if i write asp code there then it is not working
Using VB.NET 2003/.NET 1.1
If you found a post useful then please Rate it!
Please mark you thread resolved using the Thread Tools above
-
Nov 3rd, 2006, 05:20 AM
#2
Frenzied Member
Re: asp beginer
elixir:
You can just write you code in Notepad and save it with a .ASP extension.
Then you can run it in Internet Explorer, but you have to configure IIS first.
You put your ASP code in your HTML document something like this little sample:
[ASPCODE]<HTML>
<HEAD>
<TITLE> Get Secret Date</TITLE>
<!--This code appears at page 85 or ASP 3.0 book.-->
</HEAD>
<BODY>
<%
Function GetSecretDate()
Dim MyDate
MyDate = CDate(Now() -30)
GetSecretDate = MyDate
End Function
%>
Here comes some script using a function:
<P>
<%
Response.Write("The Secret Date is: ")
Response.Write(GetSecretDate())
%>
<P><FONT Color=Red Size=4>
Here comes some more script:
<P>
<%
Response.Write("Here is another secret date.")
%>
<BR>
<BR>
<%
Response.Write("The Second Secret Date is: ")
Response.Write(CDate(GetSecretDate() -1))
%>
</FONT>
</BODY>
</HTML>[/ASPCODE]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|