Solved

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

Posted on 2011-02-11
2
562 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

634 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