Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple forms in a single ASPX page - BIG limitation?
Message
From
02/10/2003 11:00:53
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00833850
Message ID:
00834277
Views:
57
Rick,

Thanks for the reply. Your expertise is very much appreciated.

So I take it from what you are saying is that I could move this framework to .NET as long as I keep my 'one' ASP.NET form self-contained inside my body of the form. And it would be ok to have ASP.NET code above and below my ASP.NET form. Just no other ASP.NET forms.

The biggest limitation I'm seeing now is that it makes it incredibly difficult to make reusable ASP.NET modules that contain forms.

For example, I have a web poll in my far right panel on dietfacts.com. It is a self-contained form that I can put on any web sites using my framework. Example syntax.

<% Set oPoll = new poll
oPoll.showpoll()
%>

But how can I have my web poll self-contained in my right panel using .NET if my body may also have a .NET form for editing an article, collecting user information, etc? The answer is, I can't.

In my dietfacts.com example I have a search form in the header of my page.

<% Set oSearch = new search
oSearch.showsearch()
%>

So even in this most basic example of code reuse, with two simple forms on the home page of dietfacts.com, .NET can't do it.

If this framework was just used in one site it wouldn't be nearly so bad or limiting. But I'm using it in several dozen websites, which could easily grow to several hundered... A few other example sites using the framework are spiritualminds.com, animalsites.com, churchguides.com, secludedvacations.com, dojangweb.com, jokepro.com, affiliateplan.com, linkgeneral.com, jobkings.com, mrstar.com, fastlotto.com, americanboaters.com, and about another 20 more. All these sites share a common database and code framework making it easy to bring up new sites and make changes to the base framework to add features to all sites.

But it's seeming more and more impractical to design a comprehensive framework in .NET for multiple websites given the 'one form' limitation.

Even if I was to re-write for .NET from the ground up, I'm just not sure how to create anything near as re-usable as I have now. Now I can drop any of my modules (search form, web polls, newsletter signup, etc.) on a page anywhere I want without worrying about limiations.

.NET seems to set code reuse aside as it relates to forms. Ironically forms are the things I want to re-use most often on different web sites. I pretty much flow the content that varies from site to site around the forms I've built to reuse. Because the content from site to site could contain site specific forms or HTML forms from the 'ad table', I can't wrap my entire framework in a ASP.NET form tag. But wrapping the entire framework in the ASP.NET form tag is the only real possible solution I see to getting any kind of reusability. Sort of a vicious circle.

My conclusion is that Microsoft was focused on making it easy to build one site or one page rather than creating re-usable components that could be used on many sites and many pages. So anything you write in .NET that contains a form basically has no re-use value at this point. At least not in the context of multiple web sites with varying levels of complexity.

I have a hard time wrapping my brain around how Microsoft's designers were willing to live with this limitation. As it stands I think I'm going to be better off sticking with ASP. Am I missing an obvious solution to doing what I want in ASP.NET?

I really appreciate you taking the time to read my rant and would welcome any advice you may have.

Greg


>Greg,
>
>You can have multiple HTML forms on a page, but only a single ASP.Net Web form.
>
>So if you need a standard HTML form just make sure it lives outside of the main ASP.Net tag. This may not address all cases, but hopefully it might work for you. Usually multiple forms etc. live in adjunct tables that are easy to isolate.
>
>I think the rational is that ASP.Net forms can handle a variety of controls on a single page even the context is apprrently different. I've built some fairly complex forms pretty easily with AsP.Net that would have been an unmanageable nightmare with most other tools...
>
>Hopefully one of these will do the trick for you...
>
>+++ Rick ---
>
>>I've been wanting to utilize ASP.NET for a long time but I have problems with implementing the framework with multiple forms.
>>
>>Apparantly Microsoft has a very unreasonable restriction that there can only be one form that wraps the entire ASPX page. Does Microsoft not know that much HTML content and data streams contain HTML that may contain their own form tags?
>>
>>My problem is that I have several dozen web sites that share advertising content from a 20,000+ record SQL table. Depending upon search results and the category you are in on a site the ASP code selects relevent advertising content for what the user is doing on a specific site. Some of this content is banner ads, some content is text links, others are submit forms like for Overture, Google, domain name registration, etc. Cooking.com for example has a great little advertising search form that we use on dietfacts.com. It converts well because the user types in what they are looking for on dietfacts.com and then the form sends them to cooking.com with our tracking ID.
>>
>>But how can I show any of this content in my ASPX pages if Microsoft's model only allows one form? To make matters worse I'm starting to incorporate some dynamic XML feeds that may one moment contain a banner ad and the next a submit form. This content can be displayed anywhere on the web page... top, bottom, body, or side panels.
>>
>>I was trying a workaround that would parse out the form action in real-time, parse it and use that information to create a server-side re-direct that would send the query to the appropriate URL. This is very clumbsy and after half way through getting it to work I found out a bigger problem. Many affiliate networks like Link Share and some Commission Junction advertisers block re-directing through the server to avoid unwanted pop-up solitations and/or for fraud protection. They implement this my using hidden variables or Javascript in the HTML so that they are only charged for clicks and traffic when the user actually clicks the button in the HTML and goes directly to their site. Otherwise, some shrewd web developers generate money by redirecting through the server even though the end user had no interest in the product. So if you redirect through the server the user ends up at the advertisers site but you don't get any credit for the lead. So I basically have to show the HTML as
>>given from the advertiser.
>>
>>I'm not sure what Microsoft was thinking with the single form restriction. So much content from various sources include forms and as it stands I can't recommend the .NET framework for any application that uses flexible advertising content. It also makes it much more difficult to create flexible/reusable components when you have do design around this limitation.
>>
>>Does Microsoft intend to fix this limitation? Is there a workaround that I'm not aware of? A solution that can work not knowing the exact content ahead of time (except that it may contain a form) and that must function without redirecting through the server?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform