Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-09-2004, 02:35 PM
WebProWorld New Member
 

Join Date: Jun 2004
Location: USA
Posts: 12
tzpow2k2 RepRank 0
Default 2 Asp.net lisboxs with autopostback true

During first load this is shown "lsb1Blsb2A" when i select lsb1B. The problem is that both listboxs method fire at the same time. My goal is
to make it show only lsb1B. Please tell me what I am doing wrong.

Code behind
<script runat="server">
sub page_load(obj as object , e as eventargs)

if not page.ispostback then

dim arlst1 as new arraylist
dim arlst2 as new arraylist
arlst1.add("lsb1A")
arlst1.add("lsb1B")
arlst1.add("lsb1C")
arlst2.add("lsb2A")
arlst2.add("lsb2B")
arlst2.add("lsb2C")
lsb1.datasource=arlst1
lsb1.databind
lsb2.datasource=arlst2
lsb2.databind


end if


end sub
sub lsb1hdl(ByVal sender As Object, ByVal e As EventArgs)
response.write(lsb1.selecteditem.text)
end sub

sub lsb2hdl(ByVal sender As Object, ByVal e As EventArgs)

response.write(lsb2.selecteditem.text)
end sub


<form name="form1" runat="server" method="post" action="">
<asp:listbox ID="lsb1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="lsb1hdl" Rows="1" SelectionMode="single">

</asp:listbox>
<asp:listbox ID="lsb2" runat="server" AutoPostBack="true" OnSelectedIndexChanged="lsb2hdl" Rows="1" SelectionMode="single">

</asp:listbox>
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , ,



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

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


Search Engine Optimization by vBSEO 3.2.0