Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5844693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:19:45+00:00 2026-05-22T12:19:45+00:00

I have following dropdwonlists in a UserControl; <span class=src-engine-row-title-span>ADT : </span> <asp:DropDownList runat=server ID=ddlAdultTrf></asp:DropDownList>

  • 0

I have following dropdwonlists in a UserControl;

    <span class="src-engine-row-title-span">ADT : </span> 
            <asp:DropDownList runat="server" ID="ddlAdultTrf"></asp:DropDownList>

            <span class="src-engine-row-title-span">CHD : </span> 
            <asp:DropDownList runat="server" ID="ddlChildrenTrf"></asp:DropDownList>

            <span class="src-engine-row-title-span">INF : </span> 
            <asp:DropDownList runat="server" ID="ddlInfantTrf"></asp:DropDownList>

and I am assigning values to them on page_load event with following code;

ddlAdultTrf.DataTextField = "FieldName";
ddlAdultTrf.DataValueField = "FieldValue";
ddlAdultTrf.DataSource = repo.AdultsForTransferSearch();
ddlAdultTrf.DataBind();

ddlInfantTrf.DataTextField = "FieldName";
ddlInfantTrf.DataValueField = "FieldValue";
ddlInfantTrf.DataSource = repo.ChildrenForTransferSearch();
ddlInfantTrf.DataBind();

ddlChildrenTrf.DataTextField = "FieldName";
ddlChildrenTrf.DataValueField = "FieldValue";
ddlChildrenTrf.DataSource = repo.InfantsForTransferSearch();
ddlChildrenTrf.DataBind();

here is the generated markup for the dropdownlists;

            <span class="src-engine-row-title-span">ADT : </span> 
                <select name="ctl00$MainContent$SearchEngine$ddlAdultTrf" id="MainContent_SearchEngine_ddlAdultTrf">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    <option value="32">32</option>
    <option value="33">33</option>
    <option value="34">34</option>
    <option value="35">35</option>
    <option value="36">36</option>
    <option value="37">37</option>
    <option value="38">38</option>
    <option value="39">39</option>
    <option value="40">40</option>

</select>

                <span class="src-engine-row-title-span">CHD : </span> 
                <select name="ctl00$MainContent$SearchEngine$ddlChildrenTrf" id="MainContent_SearchEngine_ddlChildrenTrf">
    <option value="0">0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>

</select>

                <span class="src-engine-row-title-span">INF : </span> 
                <select name="ctl00$MainContent$SearchEngine$ddlInfantTrf" id="MainContent_SearchEngine_ddlInfantTrf">
    <option value="0">0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>

</select>

when the page is loaded and I select something from the dropdownlist, I am trying to get the selectedvalue from code behind but the selected value is not the same with the selected one.

do u have any idea what is going on here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:19:46+00:00Added an answer on May 22, 2026 at 12:19 pm

    Place the code in the Page_Load method inside the following conditional statement:

    if (!Page.IsPostBack)
    {
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user control which contains the following code: <form id=CurrencyForm method=post runat=server>
I have the following code that sets a cookie: string locale = ((DropDownList)this.LoginUser.FindControl(locale)).SelectedValue; HttpCookie
I have following classes. class A { public: void fun(); } class B: public
I have the following JavaScript to toggle a dropdownlists in a ASP.NET page, which
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following string String str = replace :) :) with some other string;
I have following foreach-loop: using System.IO; //... if (Directory.Exists(path)) { foreach(string strFile in Directory.GetFiles(path,
I have following situation. A main table and many other tables linked together with
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.