Copied to clipboard

Flag this post as spam?

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


  • gilpt 33 posts 53 karma points
    May 30, 2011 @ 11:13
    gilpt
    0

    hi ... razor scripts vs usercontrols

    hi ...  is anybody knows the difference between razor script and usercontrol??

    when it os better to prefer one on another .. which one has better performane ...

    how is it evaluates ??

     

    thanks

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jun 01, 2011 @ 09:53
    Tim
    0

    User controls are asp.net code, written in C#/VB.Net (and can obviously be compiled). A Razor Macro is just a script file, written using the Razor syntax.

    Which you use is really a matter of preference. You need to know C#/ASP.Net to code a user control, whereas with Razor, it's a simpler syntax to learn. With Razor, you can also edit the file through the Umbraco UI (whereas with User Controls you need notepad or an IDE).

    I'm not sure how much of a difference there is in performance though, I haven't seen any tests to be able to say which is fastest. In most practical terms though, unless you're doing something crazy, the difference between the two should be fairly negligible.

    Hope that helps!

Please Sign in or register to post replies

Write your reply to:

Draft