Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-27-2006, 03:12 PM   PM User | #1
PradipCNair
New to the CF scene

 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
PradipCNair is an unknown quantity at this point
Problem in getting selected value from dropdownlist when using Array as datasource

Hi All,
I have used a string array as datasource for a dropdownlist. When getting the selected value from the dropdownlist in the postback, I am getting always the first value even though some other item is selected. Can any one help me to find a soultion for this problem?
PradipCNair is offline   Reply With Quote
Old 04-27-2006, 05:03 PM   PM User | #2
NuneatonSam
New Coder

 
Join Date: Mar 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
NuneatonSam is an unknown quantity at this point
When you submit the page its posting back, rebinding the drop down list. Simple put "If Not IsPostBack then" into your page load, something like below.

Sub Page_Load()
If Not IsPostBack Then
Page Load Stuff
End If
End Sub
NuneatonSam is offline   Reply With Quote
Old 04-28-2006, 07:15 AM   PM User | #3
handshakeit
New Coder

 
Join Date: Oct 2005
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
handshakeit is an unknown quantity at this point
how r u taking selected value from dropdownlist
try this

Response.Write(DropDownList1.SelectedValue);
handshakeit is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:29 PM.


Advertisement
Log in to turn off these ads.