Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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 December 12th, 2006, 08:38 PM
Authorized User
 
Join Date: Dec 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drop down list text value not posting back with co

Hello:

This may sound confusing, but I have dropdownlist and databinding it, and have set the DataTextField and DataValueField correctly, but on the page itself when I choose the text from the dropdown it acts wacky on some of the values and chooses another value.

here is some code:

aspx page

<asp:dropDownList ID="outside_assoc_cities" runat="server" AutoPostBack="True" Enabled="False" DataTextField="city" DataValueField="mls_id" Visible="False"></asp:dropDownList>

codebehind

Protected Sub recip_form_type_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles recip_form_type.SelectedIndexChanged
If recip_form_type.SelectedItem.Value <> "0" Then
outside_assoc_cities.Enabled = True
ElseIf recip_form_type.SelectedItem.Value = "0" Then
outside_assoc_cities.Enabled = False
outside_assoc_cities.SelectedIndex = "0"
End If
End Sub

If anyone wants to see this wackiness, let me know so I can put it on a public site.






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add static text in drop down list vinodonline2000 ASP.NET 2.0 Basics 10 August 16th, 2007 12:39 AM
Post Back Required For Drop Down List alyeng2000 ASP.NET 1.0 and 1.1 Professional 4 March 14th, 2005 01:15 PM
Retrive values to Drop down list from DB when Back choudhmh Pro VB.NET 2002/2003 0 January 12th, 2005 10:44 AM





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