Microsoft Could Make it Easier
-
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 -
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, 2013I 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
-
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 -
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.
You might like the .Net Core 2 Razor pages.
Keep your friends close. Keep Kill your enemies closer.
-
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, 2013Didn't you know that MVC stands for: Migraine Vomiting and Constipation :-\
-
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, 2013Thank 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
-
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
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 -
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
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 -
Didn't you know that MVC stands for: Migraine Vomiting and Constipation :-\
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.
-
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
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:
-
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, 2013John 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.
-
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, 2013John 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
-
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:
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
-
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, 2013John 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 -
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
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 :-)
-
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, 2013I 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 -
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, 2013Geez 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
-
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, 2013If 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[^]
-
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, 2013They 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
-
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[^]
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.