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

  • Home
  • SEARCH
  • 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 6549525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:06:12+00:00 2026-05-25T12:06:12+00:00

If I browse to http://localhost/edumatic3/trunk/login/accesscode/Default.aspx , my postback works. However, if I browse to

  • 0

If I browse to http://localhost/edumatic3/trunk/login/accesscode/Default.aspx, my postback works. However, if I browse to http://localhost/edumatic3/trunk/login/accesscode/ (with Default.aspx defined as default document), my postback doesn’t work.

Is there a way to make this work? Or should I remove the default document and force users to browse to http://localhost/edumatic3/trunk/login/accesscode/default.aspx?

UPDATE:

Code (part):

<div id="continueDiv">
        <asp:ImageButton ID="continueImageButton" 
                runat="server" ValidationGroup="continue" 
                OnClick="ContinueImageButton_Click" 
                AlternateText="<%$ Resources:login, continue_alternatetext %>"/>
    </div>

Code behind (part):

protected void Page_Load(object sender, EventArgs e)
{
    Log.Debug("Page_Load(...)");
    Log.Debug("Page_Load(...) :: PostBack = " + IsPostBack);

    if (!IsPostBack)
    {
        continueImageButton.ImageUrl = "~/App_Themes/" + base.Theme 
        + "/images/" + Resources.login.btn_continue;
    }
}

/// <summary>
/// Continue Image Button Click Handler
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ContinueImageButton_Click(object sender, EventArgs e)
{
 ....

When I click on the ImageButton, Page_Load is triggered, and IsPostBack is false… Normally, it should be true. ContinueImageButton_Click(…) isn’t triggered at all.

In HTML (part):

<input type="image" name="ctl00$ContentPlaceHolder1$continueImageButton" 
id="ctl00_ContentPlaceHolder1_continueImageButton" 
src="../../App_Themes/LoginTedu/images/en_continue.png" alt="Continue" 
onclick="javascript:WebForm_DoPostBackWithOptions(new 
WebForm_PostBackOptions(&quot;ctl00$ContentPlaceHolder1$continueImageButton&quot;, 
&quot;&quot;, true, &quot;continue&quot;, &quot;&quot;, false, false))" 
style="border-width:0px;">

Http request:

POST /edumatic3/trunk/login/accesscode/ HTTP/1.1
Host: localhost
Referer: http://localhost/edumatic3/trunk/login/accesscode/
Content-Length: 1351
Cache-Control: max-age=0
Origin: http://localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 
   (KHTML, like Gecko)                 Chrome/13.0.782.215 Safari/535.1
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: nl,en-US;q=0.8,en;q=0.6,fr;q=0.4
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
ASP.NET_SessionId=33yal3buv310y2etuj33qghg; CurrenUICulture=en-us

__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDw...
  • 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-25T12:06:13+00:00Added an answer on May 25, 2026 at 12:06 pm

    I thought I’d try and reproduce this, and you’re absolutely right. It breaks without the default.aspx with a very simple example that you provided. Looking at the HTML, the reason is fairly clear. It’s because the action attribute is empty.

    A quick search reveled this, ASP.NET 4 Breaking Changes (see Event Handlers Might Not Be Not Raised in a Default Document in IIS 7 or IIS 7.5 Integrated Mode).

    ASP.NET 4 now renders the HTML form element’s action attribute value
    as an empty string when a request is made to an extensionless URL that
    has a default document mapped to it. For example, in earlier releases
    of ASP.NET, a request to http://contoso.com would result in a request
    to Default.aspx. In that document, the opening form tag would be
    rendered as in the following example:

    <form action="Default.aspx" />
    

    In ASP.NET 4, a request to http://contoso.com also results in a
    request to Default.aspx. However, ASP.NET now renders the HTML opening
    form tag as in the following example:

    <form action="" />
    

    This difference in how the action attribute is rendered can cause
    subtle changes in how a form post is processed by IIS and ASP.NET.
    When the action attribute is an empty string, the IIS
    DefaultDocumentModule object will create a child request to
    Default.aspx. Under most conditions, this child request is transparent
    to application code, and the Default.aspx page runs normally.

    However, a potential interaction between managed code and IIS 7 or IIS
    7.5 Integrated mode can cause managed .aspx pages to stop working
    properly during the child request.

    I’ve created these two fixes which resolve the issue, use either.

    1) Add this code to Global.asax

    void Application_BeginRequest(object sender, EventArgs e)
    {
        var app = (HttpApplication)sender;
        if (app.Context.Request.Url.LocalPath.EndsWith("/"))
        {
        app.Context.RewritePath(
                 string.Concat(app.Context.Request.Url.LocalPath, "default.aspx"));
        }
    }
    

    2) Create a Forms ControlAdapter

    public class FormControlAdapter : ControlAdapter
    {
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            base.Render(new RewriteFormHtmlTextWriter(writer));
        }
    
        public class RewriteFormHtmlTextWriter : HtmlTextWriter
        {
            public RewriteFormHtmlTextWriter(HtmlTextWriter writer)
                : base(writer)
            {
                this.InnerWriter = writer.InnerWriter;
            }
    
            public override void WriteAttribute(string name, string value,
                                                bool fEncode)
            {
                if (name.Equals("action") && string.IsNullOrEmpty(value))
                {
                    value = "default.aspx";
                }
                base.WriteAttribute(name, value, fEncode);
            }
        }
    }
    

    Register it by creating this file in App_Browsers\Default.browsers

    <browsers>
        <browser refID="Default">
           <controlAdapters>
              <adapter controlType="System.Web.UI.HtmlControls.HtmlForm"
                                adapterType="TheCodeKing.Web.FormControlAdapter" />
           </controlAdapters>
        </browser>
    </browsers>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If i browse my site using http://localhost:8080/abc/Login/index.jsf , everything works fine. But if browse
I set up a Virtual Directory called 'Site'. I browse to http://localhost/Site/default.aspx , and
I learned Why Request.Browser.Crawler is Always False in C# ( http://www.digcode.com/default.aspx?page=ed51cde3-d979-4daf-afae-fa6192562ea9&article=bc3a7a4f-f53e-4f88-8e9c-c9337f6c05a0 ). Does anyone
When I run bundle exec rake jasmine then browse to http://localhost:8888/ I see the
I ran this Mule 3 file expecting that when I browse to http://localhost:9000 ,
On this page: http://nerddinnerbook.s3.amazonaws.com/Part4.htm After the controller is added, I can browse to http://localhost:xxxx/dinners
in solr schema the defaultOperator value is OR but when i use browse(http://localhost:8983/solr/browse)for searching
When I use my browser to test my web service, it opens at http://localhost:4832/
I've got a horizontal menu on my website: http://www.alcmariavictrix.nl When i browse it in
I have a IIS hosted service http://localhost/someProject/services/myservice.svc . Is it possible to somehow make

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.