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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:04:13+00:00 2026-06-17T01:04:13+00:00

Using the following code: <form id=form1 action= runat=server> (even with this code-behind in Page

  • 0

Using the following code:

<form id="form1" action="" runat="server">

(even with this code-behind in Page Load: form1.Action = string.Empty;)

…this is the unexpected result that I get:

<form method="post" id="form1" name="form1" action="layouts/Default.aspx">

This is the expected result, that I would like your help to accomplish:

<!-- either action="" or no action attribute at all -->
<form method="post" id="form1" name="form1" action="">

The AppPool is set to run Integrated .NET v2.0.50727 (which I’ve verified by printing the runtime version). The .NET Framework v4.5 is installed on the server (along with Visual Studio 2012).

This is guaranteed to be some kind of dev environment issue, reason being that the very same codebase outputs action="" for two of my colleagues in their local environments. They largely have the same system environment specifications as I do:

  • Windows Server 2008 R2 64-bit
  • Visual Studio 2012
  • .NET Framework v4.5
  • Same AppPool settings (we’ve double and triple checked)
  • Same codebase (SVN controlled), including the exact same web.config

This breaking change in ASP.NET v3.5 SP1 (which was better announced in v4.0) could be related. It explains the behaviour. However, it does not explain why only my runtime is getting this breaking change.

Also note that I’ve tried all available combinations of commands using the aspnet_regiis tool (without avail) i.e. from the different .NET version folders and uninstalling/reinstalling and using -c, -i etc.

  • 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-17T01:04:16+00:00Added an answer on June 17, 2026 at 1:04 am

    The following ugly workaround is the only solution I’ve found so far. I’m subclassing the form in order to remove the action attribute on override void RenderBeginTag.

    [ToolboxData("<{0}:HtmlFormNoAction runat=\"server\"></{0}:HtmlFormNoAction>")]
    public class HtmlFormNoAction : HtmlForm
    {
        protected override void RenderBeginTag(HtmlTextWriter writer)
        {
            var htmlString = new StringBuilder(); // this will hold the string
            var stringWriter = new StringWriter(htmlString);
            var htmlWriter = new HtmlTextWriter(stringWriter);
            base.RenderBeginTag(htmlWriter);
            htmlWriter.Flush();
            var formBeginTag = htmlString.ToString();
            var formBeginTagWithoutAction = RemoveActionAttribute(formBeginTag);
    
            writer.Write(formBeginTagWithoutAction);
        }
    
        private string RemoveActionAttribute(string formBeginTag)
        {
            const string actionStart = "action=\"";
            if (!formBeginTag.Contains(actionStart))
                return formBeginTag;
    
            var start = formBeginTag.IndexOf(actionStart);
            var end = formBeginTag.IndexOf("\"", start + actionStart.Length);
            return formBeginTag.Substring(0, start) + formBeginTag.Substring(end + 1);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been using the following code in my Web form code-behind classes. I want
I am successfully posting a form via ajax, using the following code; $.post( Page.do?source=ajax,
I have a user control which contains the following code: <form id=CurrencyForm method=post runat=server>
I have the following code which I'm using to populate form fields. This code
i am using the following code for form action, // includes require_once('inc/mysql_wrapper.php'); $DB=get_db_connection(); require_once('inc/defines.inc.php');
I am using the following code for my form validation. The code is working
I am currently using the following code to update form data before submission. $('.countyx').change(function(){
i am using a jquery validation in form my code is following Jquery $(document).ready(function
I have the following code I am using to submit my form to a
I am using following jQuery code to submit a form via AJAX. jQuery('form.AjaxForm').submit( function()

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.