Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.0
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 20th, 2009, 12:27 AM
Registered User
 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Post I have a problem to solve the exercise in my book. Please Help!

Hi everyone. I have a book 'beginning asp.net using vb.net'. It is so far so good.
But doing exercise at ch 10(436pages) question No.4, by myself, I have a problem.

I wanted to add session("Basket") with product_a to product_e that user selected.
And I wanted to show the dropdownlist that is made new array by split session("Basket").
Here`s the code that I made.


Code:
<%@page language="vb"%>
<script language="vb" runat="server">
 sub page_load(source as object, e as system.eventargs)
  if not ispostback then 
 
   mydropdownlist.items.add("product_a") 
 
   mydropdownlist.items.add("product_b") 
 
   mydropdownlist.items.add("product_c") 
 
   mydropdownlist.items.add("product_d") 
 
   mydropdownlist.items.add("product_e") 
 
   addbutton.text = "Add Basket" 
 
   emptybutton.text = "Empty Basket" 
 
 
   '''''''''here`s the problem start'''''''''''
 
 
 
   dim str_session as string = session("Basket")
 
   dim str_array as array = split(str_session,":")
 
   dim i as integer
    dim for_end_count = ubound(str_array)
 
   if str_session <> "" then
    for i=0 to for_end_count
     str_session_list.items.add(str_array(i))
 
 
    next
 
 
 
 
   end if
 
 
 
  end if 
 
 end sub 
 
 
 
 sub AddBasket(sender as object, e as system.eventargs) 
 
  session("Basket") += mydropdownlist.selecteditem.text & ":" 
 
 end sub 
 
 
 
 sub EmptyBasket(sender as object, e as system.eventargs) 
 
  session("Basket") = "" 
 end sub 
</script>

HTML Code:
 
 
 
 [body]
  [form id="myform" runat="server" method="post"]
 
 
 
   [asp:DropDownList ID="mydropdownlist" Runat="server"][/asp:dropdownlist]
    [br]
   [asp:button id="addbutton" runat="server" onclick="AddBasket"][/asp:button]
    [br]
 
 
 
 
   [asp:butotn id="emptybutton" runat="server" onclick="EmptyBasket"][/asp:button]
    [br]
 
 
   MyBasket_ProductList : 
    [asp:dropdownlist id="str_session_list" runat="server"][/asp:dropdownlist]
  [/form]
 
 
 
 
 
 
 
 
 
 
 [/body]
 


Please Help me~~
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap. 14 Exercise 2 C#Book stoverje BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 July 1st, 2008 10:41 AM
Please help me to solve these two problem khatu_jec C# 4 January 3rd, 2008 08:41 AM
Will you please help me to solve this problem....? vis_kapadia Excel VBA 2 November 22nd, 2006 04:57 AM
HELP! Can anyone solve this problem? JoeR VB How-To 3 September 5th, 2006 10:56 AM



All times are GMT -4. The time now is 10:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.