mulitple html forms on one ASP.Net page?

M

Martin

Hi,

I want mulitple html forms on one ASP.Net page. I guess it's invalid HTML
to nest form elements, which is okay for me.

My concern is that ASP.Net will not work well if I override the creation of
form elements on the aspx page.
I appreciate button postback events would normally post back to the main
form the the page.

My aspx page would look like this:
....

<form id="Form1" method="post" runat="server">
<!-- main form ASP.Net controls-->
</form>
<!-- user control containing datagrid -->
<asp:datagrid runat="server" ... >
<asp:TemplateColumn>
<ItemTemplate>
<form action="someother.aspx">
<!-- form controls -->
</form>
</ItemTemplate>
</asp:TemplateColumn>
</asp:datagrid>



Thanks
Martin
 
N

Natty Gur

Martin Hi,

your server side control must be inside server side Form and you can
have just one server side Form. but you can create regular HTML form
that contain HTML controls and set those forms actions as you like.

HTH

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
M

Martin

Thanks Natty,

Unfortunately, that doesn't help me as the datagrid which contains the form
data is a server side control.

Here is the bigger problem I am trying to solve - perhaps I'm approaching it
the wrong way... (could you advise?)

I've got a page Detail.aspx which is used for creating, viewing, & editing
business objects.
This page takes different url params according to if the item is to be
created, or already exists.
Once created in this page, I display the created item in that page. At this
point the url to the page should change to reflect the created status of the
object. So doing a server.transfer() is no good as I inherit the old url.
Currently I solve this by simply doing a redirect, but this is ineffiicient
for my page processing, so I hoped putting the url args in form data instead
the url would help me.
But then I hit the problem of accessing created business objects from the
page I outlined with multiple forms.

I'm sure there must be a design pattern for this.

Thanks
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top