Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. ASP.NET MVC: For Those Who Dislike Reusability

ASP.NET MVC: For Those Who Dislike Reusability

Scheduled Pinned Locked Moved The Lounge
asp-netcsharpjavascriptwinformscom
71 Posts 22 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Matthew Dennis

    I think you will get the functionality you want if you modify the \Views\Shared\_LogOnPartial.cshtml to look like the following code. I haven't done any styling but it works. The partial renders a form which posts to AcccountController.Logon. I started with the default MVC 3 Internet App VS template.

    @if(Request.IsAuthenticated) {
    Welcome @User.Identity.Name!
    [ @Html.ActionLink("Log Off", "LogOff", "Account") ]
    }
    else {
    using (Html.BeginForm("Logon", "Account"))
    {

                @Html.Label("Name:") @Html.TextBox("UserName")
    			@Html.Label("Password:") @Html.Password("Password")
    			@Html.CheckBox("RememberMe") @Html.Label("Remember Me")
    		<input type="submit" value="Login" />
    		<input type="hidden" name="returnUrl" value="@Request.Url.PathAndQuery" />
    	
    }
    

    }

    A Offline
    A Offline
    AspDotNetDev
    wrote on last edited by
    #33

    Nope. When I filled in a fake name/password and clicked "Login", I was redirected to http://localhost:61526/Account/Logon. What I want is, when I click "Login", I stay on http://localhost:61526/ and get a validation summary right on the page rather than being redirected to a page dedicated to logging in.

    Thou mewling ill-breeding pignut!

    M 1 Reply Last reply
    0
    • A AspDotNetDev

      After reading an 800-page book on MVC and just now starting to get my hands dirty, I still have seen no clear way to make reusable user controls in MVC. Sure, one can create a partial view and use some AJAX so that the view can update itself by calling the appropriate controller/action. But if the user doesn't have JavaScript enabled, they're screwed. And I could pass around the main view name to the partial view, but then I'm either passing more details than I'd like to the client or I'm using session, which is best to avoid in a server farm situation (not to mention instantiating the proper model could prove troublesome). And I could have the partial view post to an action method on the parent view's controller, but then I have to do that for every page that makes use of the partial view. What a nightmare. I think I'll go back to ASP.NET web forms. :|

      Thou mewling ill-breeding pignut!

      R Offline
      R Offline
      Roger Wright
      wrote on last edited by
      #34

      Which book?

      Will Rogers never met me.

      A 1 Reply Last reply
      0
      • R Roger Wright

        Which book?

        Will Rogers never met me.

        A Offline
        A Offline
        AspDotNetDev
        wrote on last edited by
        #35

        Pro ASP.NET MVC 3 Framework.

        Thou mewling ill-breeding pignut!

        R 1 Reply Last reply
        0
        • A AspDotNetDev

          Pro ASP.NET MVC 3 Framework.

          Thou mewling ill-breeding pignut!

          R Offline
          R Offline
          Roger Wright
          wrote on last edited by
          #36

          Ah, I see. I was just curious, since last year I reviewed a book on MVC 3 for Manning. I understand that the book was never published because MS introduced MVC 4 before it was done, but the authors have revised and released it for the newer version.

          Will Rogers never met me.

          A 1 Reply Last reply
          0
          • R Roger Wright

            Ah, I see. I was just curious, since last year I reviewed a book on MVC 3 for Manning. I understand that the book was never published because MS introduced MVC 4 before it was done, but the authors have revised and released it for the newer version.

            Will Rogers never met me.

            A Offline
            A Offline
            AspDotNetDev
            wrote on last edited by
            #37

            I have a few MVC 4 books that are not yet released in my Amazon wish list. If you let me know which you reviewed (in its MVC 3 incarnation), I'd give that one priority :-)

            Thou mewling ill-breeding pignut!

            R 1 Reply Last reply
            0
            • A AspDotNetDev

              I have a few MVC 4 books that are not yet released in my Amazon wish list. If you let me know which you reviewed (in its MVC 3 incarnation), I'd give that one priority :-)

              Thou mewling ill-breeding pignut!

              R Offline
              R Offline
              Roger Wright
              wrote on last edited by
              #38

              I don't know for sure that it's been released yet, but I assume so. When I inquired about the MVC 3 book I was supposed to receive for reviewing it, I learned that it was superseded by the MVC 4 version, and received a pdf of that book. The title is "ASP.NET MVC 4 in Action, Third Edition" and it's offered by Manning Publications (www.manning.com). I haven't yet had time to read the new version, but I found the MVC 3 version to be very informative, and the examples used to be practical. That's fairly rare in the programming text world. It was also rather entertaining, in that the authors are obviously not native speakers of English, and the phrasing and diction were sometimes rather quaint. I didn't have any trouble at all reading it; more of a Balkan slant than Indian - I think they said that they're from Romania or somewhere nearby. I dunno... I found the original book quite useful and informative, and I expect the new version to be equally as useful. Since I'm not a web developer, my opinion is about as valuable as a bus token in an airport, but I liked the book. I suggested that they change a few terms - the authors used the term "hydrate" when the accepted term is "instantiate," for instance, and I think they made the change. I found it amusing, but not at all distracting, while reading the text. If it's available, and not too expensive, I'd give it a try. I'd send you a copy of the pdf version I have, knowing that you would buy a hard copy if you found it useful, but that would violate my agreement with them. Sorry about that, but I take those things seriously... :)

              Will Rogers never met me.

              A 1 Reply Last reply
              0
              • R Roger Wright

                I don't know for sure that it's been released yet, but I assume so. When I inquired about the MVC 3 book I was supposed to receive for reviewing it, I learned that it was superseded by the MVC 4 version, and received a pdf of that book. The title is "ASP.NET MVC 4 in Action, Third Edition" and it's offered by Manning Publications (www.manning.com). I haven't yet had time to read the new version, but I found the MVC 3 version to be very informative, and the examples used to be practical. That's fairly rare in the programming text world. It was also rather entertaining, in that the authors are obviously not native speakers of English, and the phrasing and diction were sometimes rather quaint. I didn't have any trouble at all reading it; more of a Balkan slant than Indian - I think they said that they're from Romania or somewhere nearby. I dunno... I found the original book quite useful and informative, and I expect the new version to be equally as useful. Since I'm not a web developer, my opinion is about as valuable as a bus token in an airport, but I liked the book. I suggested that they change a few terms - the authors used the term "hydrate" when the accepted term is "instantiate," for instance, and I think they made the change. I found it amusing, but not at all distracting, while reading the text. If it's available, and not too expensive, I'd give it a try. I'd send you a copy of the pdf version I have, knowing that you would buy a hard copy if you found it useful, but that would violate my agreement with them. Sorry about that, but I take those things seriously... :)

                Will Rogers never met me.

                A Offline
                A Offline
                AspDotNetDev
                wrote on last edited by
                #39

                I've got to say, I don't have high hopes. It's listed on Amazon as ASP.NET MVC 3 in Action even though the cover image shows it as "ASP.NET MVC 4 in Action". The book description on Amazon also says 3 instead of 4. :laugh:

                Thou mewling ill-breeding pignut!

                R 1 Reply Last reply
                0
                • A AspDotNetDev

                  I've got to say, I don't have high hopes. It's listed on Amazon as ASP.NET MVC 3 in Action even though the cover image shows it as "ASP.NET MVC 4 in Action". The book description on Amazon also says 3 instead of 4. :laugh:

                  Thou mewling ill-breeding pignut!

                  R Offline
                  R Offline
                  Roger Wright
                  wrote on last edited by
                  #40

                  Well, they're furriners... What can we expect? :-D

                  Will Rogers never met me.

                  1 Reply Last reply
                  0
                  • L Lost User

                    Pete O'Hanlon wrote:

                    Why do I get the feeling that there's a huge boot waiting to kick me?

                    Because you know me, that's why. Lucky for you, I haven't been able to afford a ticket to fly to Pommyland to deliver said kick from the huge boot.

                    Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004

                    P Offline
                    P Offline
                    Pete OHanlon
                    wrote on last edited by
                    #41

                    Ahh yes. I'd forgotten the mutual ass-kicking contest; all because of a typo.

                    *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                    "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                    CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                    1 Reply Last reply
                    0
                    • K Keith Barrow

                      OK, deliberately polemic/provocative title ;) . ASP.NET is really a semi-coercion of Winforms type development into a web context. Quite often it fights the web paradigm and hides stuff from the developer, in some cases this is a good thing, but in others it isn't. I know I've learnt more about the web part of web development more in the few months I've been using MVC3 than in a good few years of ASP.NET "Forms".

                      AspDotNetDev wrote:

                      After reading an 800-page book on MVC and just now starting to get my hands dirty, I still have seen no clear way to make reusable user controls in MVC.

                      My emphasis is important here. We've just spent the last x years (in my case 10, on and off) in the same way of working: "winforms" (For want of a better way of putting it) but across a client server architecture. MVC3 requires time to get to grips with, it is a different way of working (and much more harmoniously with http). Obviously the learning curve is there, and you'll spend a lot of time thinking in ASP.NET "Forms" I could just do x,y or z. Obviously this is because you've got the x years experience in ASP.NET, but less than one in MVC3. I know this as I had exactly the same thoughts when I started using MVC3 last summer. Now I prefer it for sites that aren't just "Winforms type Web apps", and even on those I'm increasingly 50:50 about. I seriously suggest you spend the time to get to know MVC3 Properly, I think it is really fantastic, when applied to the correct things. To look at your specific point about controls, let's say you want to create the Equivalent of an "Address Control": 1. Use the MVVM pattern, don't try and bind the business model directly unless it is a very good fit. The idea is to "bind" the [View]Model to the UI, by providing templates Dependency Injection becomes a breeze too. 2. Create an AddressViewModel class and any converters from the business model you want. 3. In the relevant folder (possibly views/shared) Create two folders "DisplayTemplates" and "EditorTemplates". These must be called this by convention to these add your markup in files called Address.cshtml (assuming razor view engine). 4. Let's suppose you put the Address object you want to display in a parent View-Modelunder the a property called CustomerAddress. 5. Where you want to display the Address you just put @Html.DisplayFor(model => model.CustomerAddress) editing is pretty much the same:

                      B Offline
                      B Offline
                      BobJanova
                      wrote on last edited by
                      #42

                      I'd give this post a 10 if I could. Very informative.

                      K 1 Reply Last reply
                      0
                      • A AspDotNetDev

                        After reading an 800-page book on MVC and just now starting to get my hands dirty, I still have seen no clear way to make reusable user controls in MVC. Sure, one can create a partial view and use some AJAX so that the view can update itself by calling the appropriate controller/action. But if the user doesn't have JavaScript enabled, they're screwed. And I could pass around the main view name to the partial view, but then I'm either passing more details than I'd like to the client or I'm using session, which is best to avoid in a server farm situation (not to mention instantiating the proper model could prove troublesome). And I could have the partial view post to an action method on the parent view's controller, but then I have to do that for every page that makes use of the partial view. What a nightmare. I think I'll go back to ASP.NET web forms. :|

                        Thou mewling ill-breeding pignut!

                        B Offline
                        B Offline
                        BobJanova
                        wrote on last edited by
                        #43

                        I think Keith has got the correct solution for you already. But, not knowing that, when I came across this problem I created some control classes which implemented an interface with one method – Render, which generated HTML. Then you can do

                        Response.Write(new PartialWhateverControl(Model.DataObject).Render());

                        ... in the view. I think I'll go back to ASP.NET web forms. Noooooooooo ...

                        A 1 Reply Last reply
                        0
                        • B BobJanova

                          I'd give this post a 10 if I could. Very informative.

                          K Offline
                          K Offline
                          Keith Barrow
                          wrote on last edited by
                          #44

                          Thanks!

                          Sort of a cross between Lawrence of Arabia and Dilbert.[^]
                          -Or-
                          A Dead ringer for Kate Winslett[^]

                          1 Reply Last reply
                          0
                          • A AspDotNetDev

                            Nope. When I filled in a fake name/password and clicked "Login", I was redirected to http://localhost:61526/Account/Logon. What I want is, when I click "Login", I stay on http://localhost:61526/ and get a validation summary right on the page rather than being redirected to a page dedicated to logging in.

                            Thou mewling ill-breeding pignut!

                            M Offline
                            M Offline
                            Matthew Dennis
                            wrote on last edited by
                            #45

                            The problem with what you want is a matter of real estate. There is little room to show validation results without popping up another window. By going to the login page when there is an error, the user can either correct their input and submit, or register an account if they don't have one. This is how it work on The Code Project. However, if you want it your way, you would need to modify the Logon method, or create a similar one that redirects on errors as well as successful login. It would need to populate the ModelState errors collection and place values for UserName, Passwordm and redirectUrl in the ViewData or ViewBag. Additionally, you would need to modify the _LogonPartial.cshtml to include the validation stuff similar to the Logon.cshtml page. The ViewData or ViewBag is a great place to put data that might be needed by multiple pages, but really doesn't belong in the View's Model. Matthew Dennis Senior Architect The CodeProject

                            A 1 Reply Last reply
                            0
                            • M Matthew Dennis

                              The problem with what you want is a matter of real estate. There is little room to show validation results without popping up another window. By going to the login page when there is an error, the user can either correct their input and submit, or register an account if they don't have one. This is how it work on The Code Project. However, if you want it your way, you would need to modify the Logon method, or create a similar one that redirects on errors as well as successful login. It would need to populate the ModelState errors collection and place values for UserName, Passwordm and redirectUrl in the ViewData or ViewBag. Additionally, you would need to modify the _LogonPartial.cshtml to include the validation stuff similar to the Logon.cshtml page. The ViewData or ViewBag is a great place to put data that might be needed by multiple pages, but really doesn't belong in the View's Model. Matthew Dennis Senior Architect The CodeProject

                              A Offline
                              A Offline
                              AspDotNetDev
                              wrote on last edited by
                              #46

                              Matthew Dennis wrote:

                              The problem with what you want is a matter of real estate.

                              Perhaps on Code Project, but humor me would you. :)

                              Matthew Dennis wrote:

                              create a similar one that redirects on errors as well as successful login

                              So, create a response that asks the client to make another request to serve up another response? I just puked in my mouth a little bit. I think I'll just stick with the AJAX technique. :) Thanks for trying to help, but really MVC is not built to handle this type of modularity out of the box. :sigh:

                              Thou mewling ill-breeding pignut!

                              1 Reply Last reply
                              0
                              • B BobJanova

                                I think Keith has got the correct solution for you already. But, not knowing that, when I came across this problem I created some control classes which implemented an interface with one method – Render, which generated HTML. Then you can do

                                Response.Write(new PartialWhateverControl(Model.DataObject).Render());

                                ... in the view. I think I'll go back to ASP.NET web forms. Noooooooooo ...

                                A Offline
                                A Offline
                                AspDotNetDev
                                wrote on last edited by
                                #47

                                BobJanova wrote:

                                I think Keith has got the correct solution for you already.

                                I'm not so sure about that (and your solution doesn't seem to apply either). And don't worry, I'll stick with MVC despite its flaws. It's just too darn powerful otherwise. :)

                                Thou mewling ill-breeding pignut!

                                1 Reply Last reply
                                0
                                • A AspDotNetDev

                                  I don't follow exactly. I'll assume you are talking about the situation without AJAX. What I'd do on my partial view is have a form which submits to a particular controller/action specific to that partial view (say, the LogIn action on the Account controller). The problem is that that LogIn action would have to return a view. If it returns a the partial view, the URL changes (to, say, site.com/Account/LogIn). Now, if I were to pass in the name of the parent view to the partial view, I could use the overload of the View method that accepts the view name. So I could return View("~/Views/Home/Index.cshtml"), but then I couldn't really pass it a model, as the only model I have access to in the LogIn action is the model for that specific task rather than the entire model for the Home.Index action. Not to mention all this passing around of view locations makes me nervous (I don't want the client being able to hack the postback to specify their own view, and I don't want to store that in session, as that screws up a load balanced architecture if every user control needs to use the session). There are ways of getting around this. For example, the view name passed to the client could be encrypted. However, I'm then basically recreating web forms from scratch.

                                  Thou mewling ill-breeding pignut!

                                  A Offline
                                  A Offline
                                  Alberto Biasiutti
                                  wrote on last edited by
                                  #48

                                  I don't know the structure of your home page, but consider this.. You can have an "index" action that returns an "home" view.. the index view can cointains a "render partial" for your login control. As long as any partial has an "isolated" form (nested forms are obviously not supported), you can actually make it post to any specific controller/action, posting only the values effectively required for the specific action. From that action, for example "AccountController/Login", you return as result a RedirectToAction to "HomeController/Index" (or you could resend the user to the last request url). You could pass an optional "LoginResult" in your ViewData or ViewBag, and use it in the "login Partial" to check if the user is logged and/or display a message if login failed. I hope that it can give you my opinion about reusability of mvc actions. In this way, you can have a login form in wherever you want.. it will always post to the same actions, which will just have to set a ViewData and redirect you to referrer url. Hope this can help

                                  A 1 Reply Last reply
                                  0
                                  • A Alberto Biasiutti

                                    I don't know the structure of your home page, but consider this.. You can have an "index" action that returns an "home" view.. the index view can cointains a "render partial" for your login control. As long as any partial has an "isolated" form (nested forms are obviously not supported), you can actually make it post to any specific controller/action, posting only the values effectively required for the specific action. From that action, for example "AccountController/Login", you return as result a RedirectToAction to "HomeController/Index" (or you could resend the user to the last request url). You could pass an optional "LoginResult" in your ViewData or ViewBag, and use it in the "login Partial" to check if the user is logged and/or display a message if login failed. I hope that it can give you my opinion about reusability of mvc actions. In this way, you can have a login form in wherever you want.. it will always post to the same actions, which will just have to set a ViewData and redirect you to referrer url. Hope this can help

                                    A Offline
                                    A Offline
                                    AspDotNetDev
                                    wrote on last edited by
                                    #49

                                    I'm afraid that was already suggested, and I already replied. Thanks for trying to help though. :)

                                    Thou mewling ill-breeding pignut!

                                    1 Reply Last reply
                                    0
                                    • A AspDotNetDev

                                      After reading an 800-page book on MVC and just now starting to get my hands dirty, I still have seen no clear way to make reusable user controls in MVC. Sure, one can create a partial view and use some AJAX so that the view can update itself by calling the appropriate controller/action. But if the user doesn't have JavaScript enabled, they're screwed. And I could pass around the main view name to the partial view, but then I'm either passing more details than I'd like to the client or I'm using session, which is best to avoid in a server farm situation (not to mention instantiating the proper model could prove troublesome). And I could have the partial view post to an action method on the parent view's controller, but then I have to do that for every page that makes use of the partial view. What a nightmare. I think I'll go back to ASP.NET web forms. :|

                                      Thou mewling ill-breeding pignut!

                                      A Offline
                                      A Offline
                                      Adam Tibi
                                      wrote on last edited by
                                      #50

                                      Here are some thoughts to promote reusability: Consider a Facebook page that has 3 sections: - Your friends status updates - Friendship suggestions - Chat Rather than thinking of construction this page from one controller, think of more than one, for example: - Controller responsible for all updates - Controller responsible for all suggestions - Controller responsible for chat - Controller responsible on rendering a page (like the home page) The idea is that, the main view, like the home page, will be able to construct itself by "mixing and matching" what it needs to display from different controllers, in partial views or JSON format, using front-end frameworks e.g. jQuery maybe with conjunction with an MVVM framework like Knockout.js. Advantages: 1 - A controller will be serving a unique business case 2 - There is less dependencies in each controller, so a controller won't rely on the "UpdatesService", "SuggestionsService" and "ChatService" but will rely on smaller set of dependencies which promotes decoupling. 3 - You could change your controllers into RESTfull API services with less effort. 4 - An action method can be reused as it is doing a small and specific job. Disadvantages: 1 - Pushing more power to the JavaScript and the browser (that disadvantage might vary depending on your audience). 2 - More sophisticated JavaScript while JavaScript is not as mature as C# (unit testing frameworks for JS are not main stream yet, intellisense support is flaky (even with the latest Resharper), compile time checking doesn't exist, cross-browsers compatibility, etc...). 3 - A change in the controller affects more than one page, that means wider regression testing scope. I hope this helps.

                                      Make it simple, as simple as possible, but not simpler.

                                      A 1 Reply Last reply
                                      0
                                      • A AspDotNetDev

                                        After reading an 800-page book on MVC and just now starting to get my hands dirty, I still have seen no clear way to make reusable user controls in MVC. Sure, one can create a partial view and use some AJAX so that the view can update itself by calling the appropriate controller/action. But if the user doesn't have JavaScript enabled, they're screwed. And I could pass around the main view name to the partial view, but then I'm either passing more details than I'd like to the client or I'm using session, which is best to avoid in a server farm situation (not to mention instantiating the proper model could prove troublesome). And I could have the partial view post to an action method on the parent view's controller, but then I have to do that for every page that makes use of the partial view. What a nightmare. I think I'll go back to ASP.NET web forms. :|

                                        Thou mewling ill-breeding pignut!

                                        B Offline
                                        B Offline
                                        bmac
                                        wrote on last edited by
                                        #51

                                        B/c there's no escaping jQuery and its excellent client-side unobtrusive validation, you may as well go ahead and bite the bullet and go full-out jQueryUI (which appears to have consistent and well-thought-out styling). My perspective on MVC3 is that it's best to avoid its ASP.NET underpinnings unless absolutely necessary and using ASP.NET custom controls is nas-ty by all accounts. Regardless, in the web app world, we can run but Javascript will track us down and make us do its bidding but I'm not going back to that miserable, back-stabbing, sloppy-a$$ terd ASP.NET. No way, Jose! That said, I'm not real happy with Razor, either. I mean, MS already had C#, T4 and J(ava)script (already used for their VS project and item template code), but I guess the syntax wasn't fsckd-up enough and the VS Editor didn't choke on them enough. Sheez. :-) Robert W. McCall execNext.com DONE := "Lasting peace & happiness for *ALL* human beings."

                                        A 1 Reply Last reply
                                        0
                                        • A AspDotNetDev

                                          I don't follow exactly. I'll assume you are talking about the situation without AJAX. What I'd do on my partial view is have a form which submits to a particular controller/action specific to that partial view (say, the LogIn action on the Account controller). The problem is that that LogIn action would have to return a view. If it returns a the partial view, the URL changes (to, say, site.com/Account/LogIn). Now, if I were to pass in the name of the parent view to the partial view, I could use the overload of the View method that accepts the view name. So I could return View("~/Views/Home/Index.cshtml"), but then I couldn't really pass it a model, as the only model I have access to in the LogIn action is the model for that specific task rather than the entire model for the Home.Index action. Not to mention all this passing around of view locations makes me nervous (I don't want the client being able to hack the postback to specify their own view, and I don't want to store that in session, as that screws up a load balanced architecture if every user control needs to use the session). There are ways of getting around this. For example, the view name passed to the client could be encrypted. However, I'm then basically recreating web forms from scratch.

                                          Thou mewling ill-breeding pignut!

                                          D Offline
                                          D Offline
                                          dave dolan
                                          wrote on last edited by
                                          #52

                                          The url doesn't change. What are you talking about? The thing you MIGHT be passing around through those massive security holes called URL's is the route to the controller actions. GASP! People who are complaining about MVC are probably the same ones who have not really figured out how it works. Personally, the biggest benefit of MVC for me is that I get to work with regular html and javascript. It's not like you have to know two ways of looking at the world anymore: one, the rendered way (what it looks like on the browser) and two the web forms markup way. The C# code just wires up the markup with minimal template like instructions versus an entirely new 'dialect' of xml elements you must memorize. Granted it's not so hard once you get used to web forms to remember these xml thingies, but, the black boxy-ness sometimes is an issue. For example, simple things that are heavily abstracted so that the developer never thinks about it, like control extenders, you may never know just wtf is wrong with your auto-complete extender inside a tab panel under lock and key of an update panel, so when troubleshooting it you start doing things like digging into the embedded resource javascript files (which are kindly minified for performance) from the extenders and want to puke all over yourself. IF you are going to use a lot of ajax I think you're crazy if you don't go with MVC. If you're only using a lot of datagrids and I can why you like webforms better. The webforms grids with entity data sources are easier for quick and dirty deployments. I'm going to hammer this again: People don't pass the name of the view to the client. I have no idea where people get this insane idea. The ViewBag is ONLY alive during the execution of the request. It never makes it to the client, kids. It's not ViewState. That's the dangerous bit, ViewState.

                                          A 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups