views:

68

answers:

1

Scenario:

I have a regular aspx page with a form.

When someone clicks a button the form submitted via post like normal.

HOWEVER. The page where the form resides is the default page(Default.aspx). So when someone goes to the site: http://site.com/ and submits the forms he gets redirected to http://site.com/default.aspx. I tried setting the action of the form to http://site.com/. However asp.net does not allow to use root urls with a POST.

So is there any workaround? Ajax is not an option.

A: 

Have you considered creating a plain HTML form? You would need to place your plain HTML form outside the ASP.Net runat=server form on your page.

<form id="form1" runat="server">    
   ASP.Net controls on your page go here
</form>

<form  method="post"  action="http://www.site.com"&gt;
    <input type="text" name="input1" />
    <input type="submit" name="input2" value="Submit" />
</form>
James Lawruk
this is not an option and besides many controls don't work with an asp.net form.
diamandiev