Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.0
|
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 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 April 19th, 2009, 11:27 PM
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~~





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 09: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 09:56 AM





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