Hi,
I have a problem with a page which has about 50 web controls , 12 of the are
DropDownList.
Also, I have a "Continue" button, and on the server code an event sub
btnContinue_Click, where I process the input data.
There is a code like :
Dim MyVariable As Integer
Dim AnOtherVariable As Integer
MyVariable = DropDownList1.SelectedItem.Value
AnOtherVariable = DropDownList2.SelectedItem.Value
Can anyone help? 4 1651
The Problem is that allways I get 1, that is the first item selected, no
matter wich exactly is selected
"Ivan" <iz*****@hotmail.com> wrote in message
news:er*************@TK2MSFTNGP09.phx.gbl... Hi, I have a problem with a page which has about 50 web controls , 12 of the
are DropDownList. Also, I have a "Continue" button, and on the server code an event sub btnContinue_Click, where I process the input data. There is a code like :
Dim MyVariable As Integer Dim AnOtherVariable As Integer MyVariable = DropDownList1.SelectedItem.Value AnOtherVariable = DropDownList2.SelectedItem.Value
Can anyone help?
You don't state what the problem is, but judging from the
code sample you provided, I'd say you need to convert the
selected value to an integer.
You'll need something like the following:
MyVar = Integer.Parse(DropDownList1.SelectedItem.Value) -----Original Message----- Hi, I have a problem with a page which has about 50 web
controls , 12 of the areDropDownList. Also, I have a "Continue" button, and on the server code
an event subbtnContinue_Click, where I process the input data. There is a code like :
Dim MyVariable As Integer Dim AnOtherVariable As Integer MyVariable = DropDownList1.SelectedItem.Value AnOtherVariable = DropDownList2.SelectedItem.Value
Can anyone help?
.
Are you populating the drop down lists dynamically? I've
had similar problems when I accidentally put the
population code in the PageLoad event and did not protect
it with a test for IsPostBack.
-Roger -----Original Message----- The Problem is that allways I get 1, that is the first
item selected, nomatter wich exactly is selected
"Ivan" <iz*****@hotmail.com> wrote in message news:er*************@TK2MSFTNGP09.phx.gbl... Hi, I have a problem with a page which has about 50 web
controls , 12 of theare DropDownList. Also, I have a "Continue" button, and on the server
code an event sub btnContinue_Click, where I process the input data. There is a code like :
Dim MyVariable As Integer Dim AnOtherVariable As Integer MyVariable = DropDownList1.SelectedItem.Value AnOtherVariable = DropDownList2.SelectedItem.Value
Can anyone help?
.
It works now :)
IsPostBack was the problem
Thanks
"R Warford" <an*******@discussions.microsoft.com> wrote in message
news:0f****************************@phx.gbl... Are you populating the drop down lists dynamically? I've had similar problems when I accidentally put the population code in the PageLoad event and did not protect it with a test for IsPostBack.
-Roger-----Original Message----- The Problem is that allways I get 1, that is the first item selected, nomatter wich exactly is selected
"Ivan" <iz*****@hotmail.com> wrote in message news:er*************@TK2MSFTNGP09.phx.gbl... Hi, I have a problem with a page which has about 50 web controls , 12 of theare DropDownList. Also, I have a "Continue" button, and on the server code an event sub btnContinue_Click, where I process the input data. There is a code like :
Dim MyVariable As Integer Dim AnOtherVariable As Integer MyVariable = DropDownList1.SelectedItem.Value AnOtherVariable = DropDownList2.SelectedItem.Value
Can anyone help?
. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: DC Gringo |
last post by:
I'm having such a problem with this DropDownList in a user control that is
posting back and throwing an error: System.Web.HttpException: A...
|
by: theo |
last post by:
Program flow...load file,then extract the xml text tags from the
file,then the number of
Xml tags retrieved from the file determines the number of...
|
by: huobazi |
last post by:
I have many dropdownlist controls in my ascx (and use LoadControl in a aspx fiel) file,so i write a method "InitList(DropDownList list,string...
|
by: Randy Armknecht |
last post by:
The problem is that when the SelectedIndex is changed, it posts back the
page. It does not however fire the OnSelectedIndexChanged event, and it...
|
by: dhnriverside |
last post by:
Hi guys
Still having a problem with this dropdownlist.
Basically, I've got 4. The first 2 work fine, then my code crashes on the
3rd.
...
|
by: vladp |
last post by:
Hi!
Here is problem I got.
I use vb.net and MSSQL Server 2000.
My dropdownlist box gets information from view, and it works. However when I
am...
|
by: Antonio D'Ottavio |
last post by:
Good morning,
I've a problem with a dropdownlist located inside any row of a datalist,
I fill both datalist and dropdownlist at runtime, the...
|
by: ^MisterJingo^ |
last post by:
Hi all,
I have a web page which has a single dropdownlist containing 3 items.
Below the dropdownlist are two listboxes. Depending on the option...
|
by: MaryamSh |
last post by:
Hi,
I am creating a Dynamic Search in my application.
I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic...
|
by: MaryamSh |
last post by:
Create Dynamic Dropdownlist Controls and related event
--------------------------------------------------------------------------------
Hi,
I...
|
by: concettolabs |
last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
|
by: teenabhardwaj |
last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
| |