p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.0
I forgot my password Register Now
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 20th, 2009, 12:27 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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~~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Infopath 2003 book exercise files marlenevilleneuve BOOK: Beginning InfoPath 2003 7 April 30th, 2009 09:43 PM
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 12:51 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc