Solved

asp.net - dropdownlist....doesnt select new value...

Posted on 2011-02-11
2
559 Views
Last Modified: 2012-05-11
when I select a new value from the dropdownlist..it continues to stay the first one...and doesnt change...

here is the control:

<asp:DropDownList ID="DropDownList1" runat="server"
           DataTextField="campaign_name"
            DataValueField="campaign_name"
            onselectedindexchanged="DropDownList1_SelectedIndexChanged"
            AutoPostBack="True">
        </asp:DropDownList>

...once selected...

    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim DDL_val As String
        Dim flag As String
        Dim TC_ID As String
       
        TC_ID = Session("SessionTC_ID")
        DDL_val = DropDownList1.SelectedIndex
        flag = "dataset"
       
        Session("sessionDDL") = DropDownList1.Text
0
Comment
Question by:GlobaLevel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Expert Comment

by:s_chilkury
ID: 34876978
Check this: even this has the same issue ..

http://forums.asp.net/t/1635851.aspx?PageIndex=3
0
 
LVL 23

Accepted Solution

by:
Rajkumar Gs earned 500 total points
ID: 34876988
Your dropdownlist is enabled with AutoPostBack. So when you select any item, PostBack occurs and Page_Load event will trigger.

Check in Page_Load event, whether dropdownlist binding code is outside IsPostBack check. If so on each Selection on Dropdownlist, dropdownlist will get rebind and lost its selection.
Page_Load Event
If (!IsPostBack)
{
 // Dropdownlist Bind Code should be here
}

Open in new window


Just verify this case
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question