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. General Programming
  3. C#
  4. Why Can't I use asp.net controls with mvc?

Why Can't I use asp.net controls with mvc?

Scheduled Pinned Locked Moved C#
asp-netcsharparchitecturehelpquestion
6 Posts 4 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.
  • D Offline
    D Offline
    Dolly Nimavat
    wrote on last edited by
    #1

    In mvc asp.net controls are not working. Is it my error or we can't use it with mvc?

    D F L 3 Replies Last reply
    0
    • D Dolly Nimavat

      In mvc asp.net controls are not working. Is it my error or we can't use it with mvc?

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      ASP.Net controls makes use of ViewState and PostBack. These work along side the standard event handling concepts used in web forms based applications. MVC, on the other hand, makes use of Controller which is responsible for handling handling user actions.

      1 Reply Last reply
      0
      • D Dolly Nimavat

        In mvc asp.net controls are not working. Is it my error or we can't use it with mvc?

        F Offline
        F Offline
        F ES Sitecore
        wrote on last edited by
        #3

        It's just a different technology based on a different framework, it's like asking "Why can't I use Spanish in Russia?" If you want to use webform controls then use a webforms project. If you want to use mvc you'll need to the Html helper classes to do basic things like textboxes, checkboxes, dropdowns etc, and for more advanced things like "webgrid" etc there are some off-the-shelf mvc plug-ins you can use, or you'll just need to get familiar with html\http and implement it all yourself.

        1 Reply Last reply
        0
        • D Dolly Nimavat

          In mvc asp.net controls are not working. Is it my error or we can't use it with mvc?

          L Offline
          L Offline
          L Viljoen
          wrote on last edited by
          #4

          in one word Viewstate you can still use to controls on an asp.net (not razor version) MVC does give you the advantage of super light postbacks and responses but has. Where in mvc your information is being contained in the model (which obviously excludes ajax calls creates) But in my personal opinion asp.net does seem to take more of an object oriented approach to reusing controls , which makes developing massive information system a lot less painful and quicker ; but the tradeoff is a lot of information being parsed back and forth that you are most likely not going to use every time a button is clicked which is bad for high traffic sites.

          Chona1171 Web Developer (C#), Silverlight

          F 1 Reply Last reply
          0
          • L L Viljoen

            in one word Viewstate you can still use to controls on an asp.net (not razor version) MVC does give you the advantage of super light postbacks and responses but has. Where in mvc your information is being contained in the model (which obviously excludes ajax calls creates) But in my personal opinion asp.net does seem to take more of an object oriented approach to reusing controls , which makes developing massive information system a lot less painful and quicker ; but the tradeoff is a lot of information being parsed back and forth that you are most likely not going to use every time a button is clicked which is bad for high traffic sites.

            Chona1171 Web Developer (C#), Silverlight

            F Offline
            F Offline
            F ES Sitecore
            wrote on last edited by
            #5

            The first thing I have done on any webforms site I've built in the last 15 years is to disable viewstate globally so that it has to be explicitly enabled on any controls that need it. People keep bringing up viewstate as if it is a decisive issue, completely ignoring the fact that it can easily be turned off. People who go to MVC because of "viewstate" are simply bad webforms programmers and they will go on to be bad MVC programmers. Not a dig at you personally, it just gets my goat when people talk about viewstate as if it was some insurmountable evil.

            L 1 Reply Last reply
            0
            • F F ES Sitecore

              The first thing I have done on any webforms site I've built in the last 15 years is to disable viewstate globally so that it has to be explicitly enabled on any controls that need it. People keep bringing up viewstate as if it is a decisive issue, completely ignoring the fact that it can easily be turned off. People who go to MVC because of "viewstate" are simply bad webforms programmers and they will go on to be bad MVC programmers. Not a dig at you personally, it just gets my goat when people talk about viewstate as if it was some insurmountable evil.

              L Offline
              L Offline
              L Viljoen
              wrote on last edited by
              #6

              Hi I agree with you completely , what I normally do is put my viewstate in a session to avoid the big back and forth , and if you read my posts you'll find that they are completely pro ASP.Net over MVC All I am saying is if you are hell bend on squeezing the very last bit of performance out of your app MVC would be the way to go (it would take you way longer to code and you'll most likely get lazy debugging front end code and just start implementing bad practices) but I still prefer ASP.NET using N-Tier Architecture and good practices over MVC any day

              Chona1171 Web Developer (C#), Silverlight

              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