techpreparation-homepage

Home  Interview Questions  Aptitude Questions  Tutorials  Placement Papers  Search  Resume Guide  Soft Skills  Video  Forum  Blog


Technical Interview Questions

Visual Basic Interview Question
.NET Web Interview Questions
.NET Interview Questions
C# Interview Questions
                              .........More

Source Codes
Asp .NET Source Codes
Asp VB Script Source Codes
                              .........More

Soft Skills
Communication Skills
Leadership Skills
                              .........More

Subscribe to our Newsletters
Name:
Email:

 

 

  

Asp/VB Script Source Codes

Display a chart using ASP

<P>In the example below we will display the latest daily stock chart for a given company . A form will be displayed to the user allowing them to enter a valid stock symbol for a company . Typical symbols are MSFT for Microsoft and SUN for Sun.</P>
<P>The first part checks to see if there has been an entry on the form , if not the form is displayed again .</P>
<P>&lt;%<BR>If Request.Form("ticker") = "" Then<BR>%&gt;<BR>&lt;html&gt;&lt;body&gt;<BR>&lt;form action = &lt;%= Request.ServerVariables("SCRIPT_NAME") %&gt; method = post&gt;<BR>
Enter your ticker symbol :&lt;input type = text name = ticker size = 6&gt;&lt;br&gt;<BR>&lt;input type = submit value = "show chart"&gt;<BR>&lt;/form&gt;<BR>&lt;/body&gt;&lt;/html&gt;<BR>&lt;% </P>
<P>If a user does enter a ticker symbol then the appropriate chart is displayed
 using the code in the second section.</P>
<P>else<BR>%&gt;<BR>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;/head&gt; </P>
<P>&lt;img border="0" src="http://ichart.yahoo.com/t?s=&lt;%=
Request.Form("ticker")%&gt;"&gt;<BR>&lt;/body&gt;
<BR>&lt;/html&gt;<BR>&lt;%<BR>
End If<BR>%&gt;</P>
<P>The complete code is displayed below</P>
<P>&lt;%<BR>If Request.Form("ticker") = "" Then<BR>%&gt;<BR>&lt;html&gt;&lt;body&gt;<BR>&lt;form action = &lt;%= Request.ServerVariables("SCRIPT_NAME") %&gt; method = post&gt;<BR>
Enter your ticker symbol :&lt;input type = text name = ticker size = 6&gt;&lt;br&gt;<BR>&lt;input type = submit value = "show chart"&gt;<BR>&lt;/form&gt;<BR>&lt;/body&gt;&lt;/html&gt;<BR>&lt;% <BR>else<BR>%&gt;<BR>&lt;html&gt;<BR>&lt;head&gt;<BR>
&lt;/head&gt; </P>
<P>&lt;img border="0"
 src="http://ichart.yahoo.com/t?s=&lt;%=
Request.Form("ticker")%&gt;"&gt;<BR>&lt;/
body&gt;<BR>&lt;/html&gt;<BR>&lt;%<BR>
End If<BR>%&gt;<BR></P>


<<<----- Return to Asp/VB Script Source Code Questions Page.


Have a Question ? post your questions here. It will be answered as soon as possible.

Check Microsoft .Net Interview Questions for more Microsoft .Net Interview Questions with Answers.

Check .Net Database Interview Questions for more .Net Database Interview Questions with answers

Check Job Interview Questions for more Interview Questions with Answers