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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:20:01+00:00 2026-06-12T07:20:01+00:00

I have a page with one form (i.e. a element that submits data to

  • 0

I have a page with one form (i.e. a element that submits data to a page) and several ASP controls. The ASP controls must be wrapped in a form tag with runat="server", despite the fact that they have nothing to do with submitting data and the extraneous form tag is worse than useless. This form must encompass all of the controls, which means that it will also encompass the tag of the actual form doing useful work.

This form has a method of get and an action of not-this-page, neither of which plays nicely with ASP. I tried nesting the proper form tag inside the ASP boilerplate, but the browsers won’t take it, probably because it’s expressly prohibited by the spec. The fields of this form are generated via Javascript, so they can’t be turned into ASP controls.

Things that would solve this problem:

  • Multiple useless ASP forms per page, so that they can be tightly scoped. (Prohibited by ASP)
  • Nested forms, so that the functional one can still exist (Prohibited by HTML)
  • A new control that can take the place of the vacuous ASP form without dumping useless crud into the markup. (Is this possible?)
  • Removing the tag from the useful form and manually going through the POST data on postback to figure out what should be submitted as a GET, then redirecting. On every page with a useful form.
  • A complicated system of doing the above semi-automatically, which may be impractical given that the form fields will not be ASP controls.
  • Abandoning ASP controls entirely.

Ideas?

  • 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-12T07:20:03+00:00Added an answer on June 12, 2026 at 7:20 am

    A new event handler:

    public void GetRequest(object sender, CommandEventArgs e)
    {
        string url = string.IsNullOrEmpty(e.CommandArgument as string)
            ? Request.Url.AbsolutePath
            : (string)e.CommandArgument;
    
        var query = Request.Form.ToDictionary()
            .Where(kv => kv.Key.StartsWith(e.CommandName + "$"))
            .Select(kv => string.Format("{0}={1}",
                Server.UrlEncode(kv.Key.Substring(kv.Key.IndexOf("$") + 1)),
                Server.UrlEncode(kv.Value)));
    
        string destination = string.Format("http://{0}{1}{2}{3}",
            Request.Url.Authority,
            Page.ResolveUrl(url),
            query.Any() ? "?" : "",
            string.Join("&", query));
    
        Response.Redirect(destination);
    }
    

    And in the aspx:

    <div class="form" id="filters-form">
        <div><input type="hidden" name="filters$OrderBy" value="<%= Orderings.ToSortString() %>" /></div>
        <fieldset id="filters"><!-- Will be filled in by javascript --></fieldset>
        <fieldset id="controls">
            <div>
                <button type="button" id="add-filter">New Filter</button>
                <asp:Button runat="server" Text="Apply Filters" OnCommand="GetRequest" CommandName="filters" />
            </div>
        </fieldset>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On a page that I'm designing I have a form with one input of
I have a form with several textarea elements. User enters data and submits the
I have a page where there is currently more than one form. I used
I have a page in one of my client's websites that generates an extensive
I have a form with one text box that is part of a div
I have the following: <form class=form id=main-form data-entity=Page data-action=@(action) data-href=/Admin/Contents/Json@(action) > It works find
I have an ASP.NET Web Form (C#) that users fill out, it has a
I have a page with several forms on one page. I have a button
I have a page which has a small form with one input field and
I have a page that contains 3 forms, each one with a Zend_Form_Element_Hash for

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.