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. Microsoft Could Make it Easier

Microsoft Could Make it Easier

Scheduled Pinned Locked Moved The Lounge
asp-netarchitecture
25 Posts 17 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.
  • R Offline
    R Offline
    realJSOP
    wrote on last edited by
    #1

    In my current MVC project, I wanted to display the last edit date of the view in the footer. It took me about 75 lines of code scattered over three folders and half a dozen files to achieve it, as well as about four hours of research time. There are things MS could have done to make it simpler...

    ".45 ACP - because shooting twice is just silly" - JSOP, 2010
    -----
    You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
    -----
    When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

    N A R M R 8 Replies Last reply
    0
    • R realJSOP

      In my current MVC project, I wanted to display the last edit date of the view in the footer. It took me about 75 lines of code scattered over three folders and half a dozen files to achieve it, as well as about four hours of research time. There are things MS could have done to make it simpler...

      ".45 ACP - because shooting twice is just silly" - JSOP, 2010
      -----
      You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
      -----
      When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      I am sure there's a reason this code won't work, but did you try:

      File.GetLastWriteTime(Request.PhysicalPath)

      If you did, and it failed, sorry - my bad :)

      Nish Nishant Consultant Software Architect Ganymede Software Solutions LLC www.ganymedesoftwaresolutions.com

      R 1 Reply Last reply
      0
      • R realJSOP

        In my current MVC project, I wanted to display the last edit date of the view in the footer. It took me about 75 lines of code scattered over three folders and half a dozen files to achieve it, as well as about four hours of research time. There are things MS could have done to make it simpler...

        ".45 ACP - because shooting twice is just silly" - JSOP, 2010
        -----
        You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
        -----
        When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

        A Offline
        A Offline
        A_Griffin
        wrote on last edited by
        #3

        They already did - and called it ASP.NET Webforms. Then someone decided to make things harder and came up with MVC. I suppose there may be advantages in team environments, but as a sole developer I see no advantage in MVC whatsoever.

        R 1 Reply Last reply
        0
        • A A_Griffin

          They already did - and called it ASP.NET Webforms. Then someone decided to make things harder and came up with MVC. I suppose there may be advantages in team environments, but as a sole developer I see no advantage in MVC whatsoever.

          R Offline
          R Offline
          R Giskard Reventlov
          wrote on last edited by
          #4

          You might like the .Net Core 2 Razor pages.

          Keep your friends close. Keep Kill your enemies closer.

          1 Reply Last reply
          0
          • R realJSOP

            In my current MVC project, I wanted to display the last edit date of the view in the footer. It took me about 75 lines of code scattered over three folders and half a dozen files to achieve it, as well as about four hours of research time. There are things MS could have done to make it simpler...

            ".45 ACP - because shooting twice is just silly" - JSOP, 2010
            -----
            You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
            -----
            When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

            R Offline
            R Offline
            RickZeeland
            wrote on last edited by
            #5

            Didn't you know that MVC stands for: Migraine Vomiting and Constipation :-\

            C 1 Reply Last reply
            0
            • R realJSOP

              In my current MVC project, I wanted to display the last edit date of the view in the footer. It took me about 75 lines of code scattered over three folders and half a dozen files to achieve it, as well as about four hours of research time. There are things MS could have done to make it simpler...

              ".45 ACP - because shooting twice is just silly" - JSOP, 2010
              -----
              You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
              -----
              When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

              M Offline
              M Offline
              Marc Clifton
              wrote on last edited by
              #6

              Thank you for reminding me why I don't use MVC or ASP.NET, just straight Javascript and AJAX calls to a basic web server. ;)

              Latest Article - Code Review - What You Can Learn From a Single Line of Code Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

              R R 2 Replies Last reply
              0
              • M Marc Clifton

                Thank you for reminding me why I don't use MVC or ASP.NET, just straight Javascript and AJAX calls to a basic web server. ;)

                Latest Article - Code Review - What You Can Learn From a Single Line of Code Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                R Offline
                R Offline
                realJSOP
                wrote on last edited by
                #7

                Unfortunately, one must be familiar with MVC in order to remain employable. I'd much rather not have to do any web crap at all...

                ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                -----
                You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                -----
                When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                Z M J 3 Replies Last reply
                0
                • N Nish Nishant

                  I am sure there's a reason this code won't work, but did you try:

                  File.GetLastWriteTime(Request.PhysicalPath)

                  If you did, and it failed, sorry - my bad :)

                  Nish Nishant Consultant Software Architect Ganymede Software Solutions LLC www.ganymedesoftwaresolutions.com

                  R Offline
                  R Offline
                  realJSOP
                  wrote on last edited by
                  #8

                  Even if that does work, I'm using the mechanism I implemented to perform some other functionality that is required in my shared layout file.

                  ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                  -----
                  You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                  -----
                  When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                  O 1 Reply Last reply
                  0
                  • R RickZeeland

                    Didn't you know that MVC stands for: Migraine Vomiting and Constipation :-\

                    C Offline
                    C Offline
                    CodeWraith
                    wrote on last edited by
                    #9

                    Like almost anything Mickeysoft comes up with. Normally I like to use the Model View Controller pattern, actually more the Model View Presenter flavor. I rolled my own for WinForms, WPF and even ASP .Net Webforms and can convert whole applications by simply rewriting the views for another UI. The rest remains as it was. These patterns should make life a little easier, but that is not the Mickeysoft way.

                    I have lived with several Zen masters - all of them were cats.

                    1 Reply Last reply
                    0
                    • M Marc Clifton

                      Thank you for reminding me why I don't use MVC or ASP.NET, just straight Javascript and AJAX calls to a basic web server. ;)

                      Latest Article - Code Review - What You Can Learn From a Single Line of Code Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                      R Offline
                      R Offline
                      raddevus
                      wrote on last edited by
                      #10

                      Marc Clifton wrote:

                      just straight Javascript

                      Not even a little jQuery? jQuery can make AJAX better too.

                      $("#div1").load("localfile.txt");

                      Loads the target txt file into the selected div asynchronously. Quite nice and very simple. "LukeMarc, come to the dark side." :laugh:

                      M 1 Reply Last reply
                      0
                      • R realJSOP

                        Unfortunately, one must be familiar with MVC in order to remain employable. I'd much rather not have to do any web crap at all...

                        ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                        -----
                        You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                        -----
                        When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                        Z Offline
                        Z Offline
                        ZurdoDev
                        wrote on last edited by
                        #11

                        John Simmons / outlaw programmer wrote:

                        I'd much rather not have to do any web crap at all...

                        Just wait it out. This web thing will pass soon. It's just a phase.

                        There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

                        K 1 Reply Last reply
                        0
                        • R realJSOP

                          Unfortunately, one must be familiar with MVC in order to remain employable. I'd much rather not have to do any web crap at all...

                          ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                          -----
                          You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                          -----
                          When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                          M Offline
                          M Offline
                          Marc Clifton
                          wrote on last edited by
                          #12

                          John Simmons / outlaw programmer wrote:

                          one must be familiar with MVC in order to remain employable.

                          This is true. Happily when I write websites for my clients I don't have to adhere to corporate mentality.

                          Latest Article - Code Review - What You Can Learn From a Single Line of Code Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                          1 Reply Last reply
                          0
                          • R raddevus

                            Marc Clifton wrote:

                            just straight Javascript

                            Not even a little jQuery? jQuery can make AJAX better too.

                            $("#div1").load("localfile.txt");

                            Loads the target txt file into the selected div asynchronously. Quite nice and very simple. "LukeMarc, come to the dark side." :laugh:

                            M Offline
                            M Offline
                            Marc Clifton
                            wrote on last edited by
                            #13

                            raddevus wrote:

                            Not even a little jQuery?

                            jQuery is fine. I've even occasionally throw in some knockout, I've been forced to use backbone (not all that bad of an experience), still need to investigate vue.js, won't touch angular, and do a lot of with Bootstrap and jQWidgets. So, I'd say I'm definitely at least a shade of grey. :-D

                            Latest Article - Code Review - What You Can Learn From a Single Line of Code Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                            P 1 Reply Last reply
                            0
                            • R realJSOP

                              Unfortunately, one must be familiar with MVC in order to remain employable. I'd much rather not have to do any web crap at all...

                              ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                              -----
                              You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                              -----
                              When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                              J Offline
                              J Offline
                              Johnny J
                              wrote on last edited by
                              #14

                              John Simmons / outlaw programmer wrote:

                              I'd much rather not have to do any web crap at all...

                              I switched jobs because of that. I was SO tired of web development! X| From building ASP.NET applications, I started doing Dynamics AX development, which (for the uninitiated) is based on a desktop UI. And what the h*ll happens: In the next AX version Microsoft released just after I started my new job, they decided to scrap the desktop UI in favour of a web UI. So now I'm elephanting back in Web development all the same. :mad: Well, well, at least the job change upped my salary slightly. :sigh:

                              Anything that is unrelated to elephants is irrelephant
                              Anonymous
                              -----
                              The problem with quotes on the internet is that you can never tell if they're genuine
                              Winston Churchill, 1944
                              -----
                              I'd just like a chance to prove that money can't make me happy.
                              Me, all the time

                              1 Reply Last reply
                              0
                              • M Marc Clifton

                                raddevus wrote:

                                Not even a little jQuery?

                                jQuery is fine. I've even occasionally throw in some knockout, I've been forced to use backbone (not all that bad of an experience), still need to investigate vue.js, won't touch angular, and do a lot of with Bootstrap and jQWidgets. So, I'd say I'm definitely at least a shade of grey. :-D

                                Latest Article - Code Review - What You Can Learn From a Single Line of Code Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                                P Offline
                                P Offline
                                Peter Shaw
                                wrote on last edited by
                                #15

                                Aurelia for my HTML layer, with C#/MVC running on core 2 providing nothing more than a json/rest api is my drug these days. If I want something like a date/version in my page, I just add a simple ajax call to grab a bit of json from a simple light controller (usually 4 or 5 lines) and add it into the footer class in my front end master template, and hey presto, all automagic :-)

                                M 1 Reply Last reply
                                0
                                • R realJSOP

                                  In my current MVC project, I wanted to display the last edit date of the view in the footer. It took me about 75 lines of code scattered over three folders and half a dozen files to achieve it, as well as about four hours of research time. There are things MS could have done to make it simpler...

                                  ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                                  -----
                                  You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                                  -----
                                  When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                                  R Offline
                                  R Offline
                                  realJSOP
                                  wrote on last edited by
                                  #16

                                  I can't help but think that once I've gotten a job doing MVC, someone at Microsoft will have a monstrous bowel movement, and they'll pushing new sh|t down our throats...

                                  ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                                  -----
                                  You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                                  -----
                                  When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                                  1 Reply Last reply
                                  0
                                  • R realJSOP

                                    In my current MVC project, I wanted to display the last edit date of the view in the footer. It took me about 75 lines of code scattered over three folders and half a dozen files to achieve it, as well as about four hours of research time. There are things MS could have done to make it simpler...

                                    ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                                    -----
                                    You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                                    -----
                                    When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                                    C Offline
                                    C Offline
                                    ClockMeister
                                    wrote on last edited by
                                    #17

                                    Geez Louise! I'll stick with WinForms, myself. 5 or 6 lines of code (depending on how you fetch the last edit date, obviously) max. Even on a WebForm it's pretty simple. Adding to list of technologies to avoid: MVC. Got it.

                                    If you think hiring a professional is expensive, wait until you hire an amateur! - Red Adair

                                    1 Reply Last reply
                                    0
                                    • R realJSOP

                                      In my current MVC project, I wanted to display the last edit date of the view in the footer. It took me about 75 lines of code scattered over three folders and half a dozen files to achieve it, as well as about four hours of research time. There are things MS could have done to make it simpler...

                                      ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                                      -----
                                      You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                                      -----
                                      When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                                      L Offline
                                      L Offline
                                      Lucas Vogel
                                      wrote on last edited by
                                      #18

                                      If you think that's fun, you should try implementing OpenId using Nancy and OWin - I've spent the entire week learning how to implement OpenID authentication in a web app, and after almost a dozen sample projects ended up building a library to simplify everything. Some of the obstacles faced: - The System.IdentityModel.Tokens.Jwt library had an object that other libraries depend on for JWT tokens, but they removed the object almost a year ago, and to this date still haven't brought back, forcing you to use a 'fairly old' version of their library in order to support the dependency, and also forcing you to use the older versions of all of its dependent libraries. DLL hell, in short. - You have to use the 'old' Graph API code to interact with Azure AD B2C if you want to retrieve information about users, groups, group membership, etc.. I say 'old' because everything in Azure is set up to use Microsoft Graph - well, everything except Azure AD B2C. So, shameless plug, I've drastically simplified the process in this handy-dandy repo here: https://github.com/endpointsystems/Nancy.Owin.Security.MSGraph[^]

                                      U 1 Reply Last reply
                                      0
                                      • R realJSOP

                                        In my current MVC project, I wanted to display the last edit date of the view in the footer. It took me about 75 lines of code scattered over three folders and half a dozen files to achieve it, as well as about four hours of research time. There are things MS could have done to make it simpler...

                                        ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                                        -----
                                        You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                                        -----
                                        When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                                        S Offline
                                        S Offline
                                        Steve Naidamast
                                        wrote on last edited by
                                        #19

                                        They did make it easier with ASP.NET WebForms. However, many developers want to be cool and use a more complex implementation with ASP.NET MVC. Such developers wanted more control over your HTML and additional complexity comes with it.

                                        Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com

                                        1 Reply Last reply
                                        0
                                        • L Lucas Vogel

                                          If you think that's fun, you should try implementing OpenId using Nancy and OWin - I've spent the entire week learning how to implement OpenID authentication in a web app, and after almost a dozen sample projects ended up building a library to simplify everything. Some of the obstacles faced: - The System.IdentityModel.Tokens.Jwt library had an object that other libraries depend on for JWT tokens, but they removed the object almost a year ago, and to this date still haven't brought back, forcing you to use a 'fairly old' version of their library in order to support the dependency, and also forcing you to use the older versions of all of its dependent libraries. DLL hell, in short. - You have to use the 'old' Graph API code to interact with Azure AD B2C if you want to retrieve information about users, groups, group membership, etc.. I say 'old' because everything in Azure is set up to use Microsoft Graph - well, everything except Azure AD B2C. So, shameless plug, I've drastically simplified the process in this handy-dandy repo here: https://github.com/endpointsystems/Nancy.Owin.Security.MSGraph[^]

                                          U Offline
                                          U Offline
                                          User 13224750
                                          wrote on last edited by
                                          #20

                                          Nice book out there on OpenID Connection by Vittorio Bertocci. "Modern Authentication with Azure Active Directory for Web Applications" Examples actually work. First chapter has MVC example.

                                          L 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