By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,882 Members | 2,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,882 IT Pros & Developers. It's quick & easy.

mulitple html forms on one ASP.Net page?

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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!
Nov 18 '05 #2

P: n/a
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

"Natty Gur" <na***@dao2com.com> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl...
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!

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.