Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 28th, 2006, 04:40 AM
Authorized User
 
Join Date: Mar 2006
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default unable to get selected value form dropdownlist

I have designed simple dataentry form which contains some text fields and dropdownlists which are bound to sql server tables. when I click on update button. I am unable to get the selected values from the dropdownlist. it is always giving me the 0th item values irrespective of the selections.

How should I design a simple dataentry screen with dropdownlist.

(like in asp when we click submit button we get all the form values using request.form )

 
Old March 28th, 2006, 05:16 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi Swati!!
Are you using postback??
is so then ,use dropdownlistboxname.selectedindex.value or text as per ur requirement.
I think you are reinitializes DropDownLists for post back.
following links will help you
http://p2p.wrox.com/topic.asp?TOPIC_ID=9127
http://www.codecomments.com/archive3...10-636071.html

Cheers :)

vinod
 
Old March 28th, 2006, 05:32 AM
Authorized User
 
Join Date: Aug 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Swati,
 If you are using AutoPostback method then it is not populated. Please lock this autopostback Method.
That is to set Autopostback = false

Otherwise the to verify the following way u select the item from drop down list.

control.selectedvalue.trim
or
control.selectedindex.value



Regards
Adalarasu. s

 
Old March 31st, 2006, 12:35 PM
RGB RGB is offline
Authorized User
 
Join Date: Mar 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Autopostback to True on your Drop Down and then make it = to either a textbox.text or a string in the page load section

What Do You Mean It Does Not Work





Similar Threads
Thread Thread Starter Forum Replies Last Post
DropDownList, DataSource and Selected Items kingroon ASP.NET 2.0 Basics 2 February 25th, 2008 10:41 AM
read the selected value of DropDownList from VBScr dbayona ASP.NET 2.0 Professional 0 November 11th, 2007 06:16 PM
about dropdownlist selected change event chandra_yvr ASP.NET 2.0 Basics 0 April 2nd, 2007 07:20 AM
DropDownList Selected Index = -1?? dorothee ASP.NET 1.0 and 1.1 Basics 4 June 11th, 2004 03:08 AM
selected value from dropdownlist control netwizard_01 ASP.NET 1.0 and 1.1 Basics 3 January 20th, 2004 09:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.