I have a dropdown list box and a button on a web form, the autopost back is
false for the dropdown list box and button. When the button is pushed the
selection in the dropdownlist box is lost, just wondering what is wrong.
Selected value is always 1 no matter what is selected in the dropdown list
box.
Private Sub btn_yes_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btn_yes.Click
Dim s_origidval As String
s_origidval = Me.dr_orig.SelectedValue
End SubThanks
--
Paul G
Software engineer. 4 4569
You did not provide enough code to diagnose the problem. First guess would
be that you are repopulating the dropdown in page_load every time, instead
of just the first.
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:25**********************************@microsof t.com... I have a dropdown list box and a button on a web form, the autopost back is false for the dropdown list box and button. When the button is pushed the selection in the dropdownlist box is lost, just wondering what is wrong.
Selected value is always 1 no matter what is selected in the dropdown list box.
Private Sub btn_yes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_yes.Click Dim s_origidval As String s_origidval = Me.dr_orig.SelectedValue End SubThanks -- Paul G Software engineer.
thanks for the response, yep forgot to include
if Not Page.IsPostBack
in the page load
"Marina" wrote: You did not provide enough code to diagnose the problem. First guess would be that you are repopulating the dropdown in page_load every time, instead of just the first.
"Paul" <Pa**@discussions.microsoft.com> wrote in message news:25**********************************@microsof t.com...I have a dropdown list box and a button on a web form, the autopost back is false for the dropdown list box and button. When the button is pushed the selection in the dropdownlist box is lost, just wondering what is wrong.
Selected value is always 1 no matter what is selected in the dropdown list box.
Private Sub btn_yes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_yes.Click Dim s_origidval As String s_origidval = Me.dr_orig.SelectedValue End SubThanks -- Paul G Software engineer.
Did you set value for each ListItem? There are Text and Value properties for
each ListItem. What does Items of ListBox property look like which contain
all ListItems.
Shaw
"Paul" wrote: thanks for the response, yep forgot to include if Not Page.IsPostBack in the page load "Marina" wrote:
You did not provide enough code to diagnose the problem. First guess would be that you are repopulating the dropdown in page_load every time, instead of just the first.
"Paul" <Pa**@discussions.microsoft.com> wrote in message news:25**********************************@microsof t.com...I have a dropdown list box and a button on a web form, the autopost back is false for the dropdown list box and button. When the button is pushed the selection in the dropdownlist box is lost, just wondering what is wrong.
Selected value is always 1 no matter what is selected in the dropdown list box.
Private Sub btn_yes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_yes.Click Dim s_origidval As String s_origidval = Me.dr_orig.SelectedValue End SubThanks -- Paul G Software engineer.
Yep, populating the listbox with a dataset, and then in the code binding the
control
Me.dropdown.DataBind() 'bind data to drop down list.
I also have the datasource set to the dataset in the properties box of the
dropdown list box, seems to be working now.
"Shaw" wrote: Did you set value for each ListItem? There are Text and Value properties for each ListItem. What does Items of ListBox property look like which contain all ListItems.
Shaw
"Paul" wrote:
thanks for the response, yep forgot to include if Not Page.IsPostBack in the page load "Marina" wrote:
You did not provide enough code to diagnose the problem. First guess would be that you are repopulating the dropdown in page_load every time, instead of just the first.
"Paul" <Pa**@discussions.microsoft.com> wrote in message news:25**********************************@microsof t.com... >I have a dropdown list box and a button on a web form, the autopost back is > false for the dropdown list box and button. When the button is pushed the > selection in the dropdownlist box is lost, just wondering what is wrong. > > Selected value is always 1 no matter what is selected in the dropdown list > box. > > Private Sub btn_yes_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles btn_yes.Click > Dim s_origidval As String > s_origidval = Me.dr_orig.SelectedValue > End SubThanks > -- > Paul G > Software engineer. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Joseph Barron |
last post by:
Here is a SIMPLE problem that I'm trying to solve.
It works in Netscape 6.2, but IE6 gives ""No such interface
supported."
Below are page1.htm and page2.htm .
In page1.htm, there are two...
|
by: JL |
last post by:
Does anyone have any ideas on this please?
I don't know how to evaluate the no-blank selections against each other from
a form as follows: .
I have a form with 6 dropdown fields, each...
|
by: anonymous |
last post by:
Hi Folks,
I have a form with two Dropdown list boxes, which get loaded with data from
Database.
DropDownList1 gets data from Table1
and
DropDownList2 gets data from Table2
Table1 has a...
|
by: Jeff |
last post by:
After I bind the repeater control in the form_load event, it builds
multiple lines based on the number of rows in the dataset.
In the repeater control, I have a textbox and a dropdown list box. ...
|
by: Mark |
last post by:
I have two dropdown lists. Both have autopostback set to true. In both
dropdowns, when you select an item from the list, it redirects to the Value
property of the dropdown. Nothing fancy.
...
|
by: Vijay Kerji |
last post by:
Hi,
I have a datagrid with dropdown list and Remove hyperlink in it as
columns.
When I remove a row from the datagrid, Dropdown list selection is
retaining its previous value. i.e, removed...
|
by: jung_h_park |
last post by:
From: jung_h_park@yahoo.com
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: Dropdown List not retaining its SelectedValue
Date: Mon, 26 Jun 2006 21:02:57 -0700
Hello,
My...
|
by: Cagey |
last post by:
What I'm trying for: If this selection or if click on selection
(highlighted line choice/
which ever selection change) w/in query's combo dropdown list box (on
Switchboard),
then Open in...
|
by: er1 |
last post by:
Hi all,
I have created a double dropdown list. Based on the first list selection, second list populates (this works fine). I have a submit button, which when clicked should run a select query...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |