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 7951177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:29:02+00:00 2026-06-04T02:29:02+00:00

I have a simple ASP.NET dropdownlist control in a visual studio project (.NET framework

  • 0

I have a simple ASP.NET dropdownlist control in a visual studio project (.NET framework 3.5) that triggers a postback once the selected Index is changed and it posts back to the server successfully.
Taking the same simple ASP.NET dropdownlist control and upgrading the visual studio project to the .NET framework 4.0 results in no postback. Below is a sample of the markup on the Page (Page only contains a dropdownlist)

<body>
  <form id="form1" runat="server" >
    <asp:DropDownList ID="ddlTest" OnSelectedIndexChanged="ddlTestIndexChanged" runat="server"
     AutoPostBack="true" />
 </form> 
</body>

And in the code behind….

public void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                var list = new List<string>();
                list.Add("Hello");
                list.Add("World");
                ddlTest.DataSource = list;
                ddlTest.DataBind();
            } 
        }
        protected void ddlTestIndexChanged(object sender, EventArgs e)
        {  
            //selected index changed...success
        }

Viewing the rendered html in the browser using FireBug shows the following html when the project is run on .NET Framework 3.5

<body>
 <form name="form1" method="post" action="Default.aspx" id="form1">
 <div>
 <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="">
 <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="">
 <input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="">
 <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="has a value">
</div>
 <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['form1']; 
    if (!theForm) { theForm = document.form1; } function __doPostBack(eventTarget, eventArgument)
     { if (!theForm.onsubmit || (theForm.onsubmit() != false)) 
    { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; 
    theForm.submit(); } } //]]> </script>
 <div>
 <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="Has a value">
</div>
 <select name="ddlTest" onchange="javascript:setTimeout('__doPostBack(\'ddlTest\',\'\')', 0)" id="ddlTest">
 <option value="Hello">Hello</option>
 <option selected="selected" value="World">World</option>
</select>
</form>
</body>

And viewing the rendered html when the same project is run on the .NET framework 4.0

<body>
 <form name="form1" method="post" action="/Default.aspx" id="form1">
 <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="has a value">
 <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="has a value">
 <select name="ddlTest" id="ddlTest">
 <option selected="selected" value="Hello">Hello</option>
 <option value="World">World</option>
</select>
</form>
</body>

From comparing the html code in both snippets, it can be seen that the latter snippet is missing the “onchange” event on the dropdownlist along with the javascript itself to do the postback. My web.config contains the following for backward compatibility but this does not seen to be working either.

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>

I have also tried adding the missing Javascript in the markup – didn’t work.
Also, tried adding the onchange event + javascript from the code behind but that didn’t work either

Environment:

  • Adobe AIR 3.2 based browser (no access to browser code)
  • Windows 7 – 64 bit machine
  • Visual studio 2010
  • C#

I am aware that this issue is not a problem on the majority of browsers however as part of a work project this needs to work with an Adobe AIR 3.2 based browser. Any help is greatly appreciated, Thanks!

  • 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-06-04T02:29:04+00:00Added an answer on June 4, 2026 at 2:29 am

    The solution was to add an “App_Browsers” folder to my Website project. Then add an “AdobeAir.Browser” file. This is an xml file containing the attributes of my custom browser. Please see http://msdn.microsoft.com/en-us/library/ms228122.aspx for more information.

    .NET framework 4 browser definition files located at C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Browsers are a little light compared to those found at C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\Browsers hence my custom browser worked on pre .NET framework 4

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple ASP.NET form with a DropDownList and two RadioButtons (that both
I have a really simple ASP.NET web application and a web setup project that
I have a pretty simple ASP.NET Web Form that looks a bit like the
I have a partial view (UserControl) that implements a simple pager in my Asp.Net
I have a simple asp.net user control: <%@ Control Language=C# AutoEventWireup=true CodeBehind=QueryDefinitionItem.ascx.cs Inherits=xxx.UserControls.QueryDefinitionItem %>
I have a simple ASP.NET Web User Control. It looks like this: <%@ Control
Hopefully this is simple. I have a fairly simple ASP.NET (framework version 2) app
I am learning Entity Framework 4. I have a simple ASP.NET (Web Form) application.
I have created a simple web form on ASP.NET which includes a DropDownList with
I have a fairly simple ASP.NET 2.0 menu control using a sitemap file and

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.