|
|
 |
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.
|
 |

April 20th, 2009, 12:27 AM
|
|
Registered User
|
|
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |