Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stefan Ekman 18 posts 37 karma points
    Sep 20, 2011 @ 12:31
    Stefan Ekman
    0

    Where should the FORM tag be placed?

    Hi,

    I have been looking around for a while and I can't find any clear documentation and the videos have not made it clear either (still great thou!) and there are some inconsistencies in the Starter Packs.

    Some usercontroles seem to have the form tag in the ascx file but in other places people recommend to have them surronding the added macro.. So what should it be? I can see some issues here mixing my own controls..

    Cheers,

    Stefan

     

  • Rich Green 2246 posts 4008 karma points
    Sep 20, 2011 @ 12:38
    Rich Green
    0

    Hey Stefan,

    Easiest to place them right after the body tag in your Master template.

    Rich

  • Stefan Ekman 18 posts 37 karma points
    Sep 20, 2011 @ 12:44
    Stefan Ekman
    0

    Hi Rich,

    Thanks for the help.. Thats looks like the easiest thing to do, but what to do with "not mine" usercontrols that have a form tag? Also for pages that don't have any controls, will this affect performance and memory usage by always loading it when not really needed(Not sure about the overhead)? 

    I'm just trying to get this right from start and want to try follow "best practice" :)

  • Rich Green 2246 posts 4008 karma points
    Sep 20, 2011 @ 12:48
    Rich Green
    0

    Hey Stefan,

    I would take them out of the user controls, an ASP.NET site can only have *ONE* form tag with runat="server"

    Unless you only have one usercontrol it's going to be tricky to only include it when needed (if you have two on one page the site won't run)

    The overhead is a little bit of viewstate that gets added to the page, I wouldn't worry too much about this.

    Regards

    Rich

  • Stefan Ekman 18 posts 37 karma points
    Sep 20, 2011 @ 12:49
    Stefan Ekman
    0

    Thanks a lot Rich!

Please Sign in or register to post replies

Write your reply to:

Draft