Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiple forms in a single ASPX page - BIG limitation?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00833850
Message ID:
00834529
Vues:
35
Thank you very much for assistence. I'll look into those resources.

Greg

>First, Paul Wilson has done some work to allow multiple forms on an asp.net webform. http://authors.aspalliance.com/paulwilson/Articles/Default.aspx?id=4
>
>Second, the architecture of ASP.NET will change somewhat in 2.0 with its support for Masterpages. http://authors.aspalliance.com/paulwilson/Articles/Default.aspx?id=13
>
>With masterpages, a user control is the main template and the asp.net page sits inside it. I don't know if Masterpages will exactly fix your problem, but it will be more flexible than the current approach.
>
>
>
>>I guess what I don't understand is that I don't have control over the HTML content from my advertisers. So one page view could have a 120x60 banner and the very next time it could contain a HTML form provided by the advertiser. They don't necessarily use .NET and are delivering me stock HTML that I 'plug-in' dynamically as needed. From what I understand the .NET web controls only work if they are inside a ASP.NET form wrapper. But if I wrap my page in a ASP.NET form then my dynamic HTML content from advertisers break if the content contains forms.
>>
>>So, can user controls exist outside of a ASP.NET form and work correctly? If they can't, then how can I package up individual .NET forms that have to work along side web pages where I don't control all the content?
>>
>>In my dietfacts.com example my search form starts in my header. Then in left panel further down the page there may be an HTML form from an advertiser. Then in my right panel I have a web poll that is also a form. This works fine in ASP because each module has it's own form. But in .NET you can only have one 'master' .net form. So if I end the .NET master form after my search box so I can show dynamic advertsing HTML, I can't make a new .NET form for the web poll later on.
>>
>>But, if I wrap the whole thing in a .NET form tag, then I'm back to the problem with advertisers forms showing inside the .NET form tag. To make things worse, many advertisers now forbid server side redirects if you are to get credit for the lead. Otherwise webmasters can fraud the advertiser by redirecting when the user never clicked on the form. The advertisers use various HTML and Javascript tricks to make sure that the form is submitted from the browser and not redirected through the server. Linkshare and Commission Junction both have tools that allow advertisers to void any credit through server side redirects. Basically, I can't change the advertisers HTML to redirect through the server so I can use the .NET form wrapper.
>>
>>I guess what I wondering is there a way to have these mini-web forms that inside could have a standard HTML form or basically any HTML that an advertiser may provide INSIDE a ASP.NET form?
>>
>>
>>So my pseduo code for a 'reusable' framework would be??
>>
>><asp.form tag>
>>  <asp.showsearchcontrols>
>>  <arbitrary site specific content with no forms>
>>  <asp.miniform- webcontrol thing I don't understand>
>>       -- advertisers form plugged in dynamically from SQL database
>>       <FORM action=advertisersite.asp?id=trackingcode method=get><input>..etc.</FORM>
>>  </asp.miniform>
>>
>>  <site specific content>
>>  <asp.webpoll controls>
>></asp.form ending tag>
>>
>>- OR -
>>
>>
>><asp.mini-form thing I don't understand>
>>  <asp.showsearchcontrols>
>></asp.mini-form thing I don't understand>
>><arbitrary site specific content with no forms>
>><asp.mini-form thing I don't understand>
>>       -- form below plugged in dynamically from my SQL database
>>       <FORM action=advertisersite.asp method=get><input>..etc.</FORM>
>>       'How to show dynamic advertiser HTML that I have no control over is my problem!
>></asp.mini-form thing I don't understand>
>><site specific content with no forms>
>><asp.mini-form thing I don't understand>
>> <asp.webpoll controls>
>></asp.mini-form thing I don't understand>
>>
>>
>>Obviously there is a way to do this that I'm not getting. Again, I don't think it would be so bad if so much HTML content out there didn't have their own forms already embedded in it.
>>
>>I really appreciate everyone's help on this!!!
>>
>>Greg
>>
>>
>>>Greg,
>>>
>>>>Am I missing an obvious solution to doing what I want in ASP.NET?
>>>
>>>Yes, there is an elegant solution to this. User Controls are designed to do exactly what you are asking for. They are "mini" web forms that can be placed into an existing web form. They have their own events and properties that can be accessed programmatically by declaring a reference to the control in the host web form's class definition.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform