Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 3rd, 2003, 09:21 PM
Registered User
 
Join Date: Jun 2003
Location: Sloatsburg, NY, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stock Quote

I am building a site that gets a stock quote for a user, i would like to know the easiest way to accomplish this, using ASP.NET. The user would type a symbol into a textbox then hit a button and taken to the page that contains the quote. I am having a hard time figuring out the best way to do this.

Jon
 
Old June 3rd, 2003, 09:43 PM
Authorized User
 
Join Date: Jun 2003
Location: Lexington, KY, USA.
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

If I understand you correctly, what you need is a server-side text box (ie, runat=server) and a server-side button.

Say your page is called "entry.aspx". The text box ID is "TextBox1" and the button ID is "Button1".

In the code-behind (entry.aspx.vb) you will have an event handler for the Button1_onclick event. It might look like this in VB.NET:

if TextBox1.text = "" then
   RegisterClientScriptBlock("X","alert('Please enter a stock symbol');")
   return
else
   Response.Redirect("display.aspx?symbol=" & TextBox1.text)
end if

You then have a page "display.aspx" that uses the querystring to determine which stock quote to display.

Or, if you have hard-coded pages, you just replace that else ... section with a select case TextBox1.text structure and redirect to the appropriate page.

I don't know if this is what your stuck on... I hope it helps.

-Van




Similar Threads
Thread Thread Starter Forum Replies Last Post
Stock feed hudeanee Excel VBA 1 July 24th, 2007 08:29 PM
stock management- closing stock and opening stock bright_mulenga Access 1 July 16th, 2007 07:11 AM
Available... Units in Stock j-parker BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 December 24th, 2006 07:27 PM
Stock Quote automation aragrigorian BOOK: Expert One-on-One Access Application Development 0 May 24th, 2005 04:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.