|
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
|
|
|
|
|
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
|
|
|
|
|
So it's not entirely a Microsoft issue then. Don't get me wrong, I consider MVP to be an atrocious development model, but it sounds like you contributed to the issue.
|
|
|
|
|
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.
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|
|
JavaScript is now on the very very slow train out of town. Not immediate panic, but the new Web Assembly is lining up to give it the boot over the long haul.
Web Assembly is what should have been around all along. JavaScript suffers from never having been intended as a serious enterprise-grade programming language. It was only intended to do little short script tasks. Even Google came face-to-face with that reality when they realized a large code base like Angular was totally irresponsible to try and maintain in JavaScript thus leading to their adoption of arch-enemy Microsoft's TypeScript.
Web Assembly is machine readable pseudo-code (similar concept to Microsoft's CIL for .NET). Use the disciplined typed language of your choice and have the compiler output Web Assembly code. Same concept as C#.NET, VB.NET, and F#.NET all compiling to processor independent CIL.
The CPU-independent Web Assembly code gets (ideally) compiled into the browser host CPU's machine code upon loading.
Compiling existing JavaScript to Web Assembly will certainly be possible and largely desirable. No doubt Google is focused on making sure Angular can be compiled into Web Assembly. (TypeScript to JavaScript to Web Assembly.) Thus JavaScript won't be going anywhere anytime soon.
However, very large project code bases are extremely inefficient to maintain in JavaScript. There is a large collection of far better languages that exist to choose from. So new development will migrate to using other languages, and that will be a very large positive for both companies and developers.
The potential for a .NET Standard/Core framework targeting Web Assembly would be a huge development for enterprise-class developers. The ability to use existing .NET (C#, VB, F#) business logic libraries, etc, as part of browser client apps means serious new benefits.
In the long run it can be envisioned Web Assembly might further unify client app development with mobile apps, desktop apps, and browser apps coming closer and closer to using more and more shared code. There are frameworks for accomplishing much of this already for mobile and desktop. Web Assembly may be the key to bringing browser apps into this realm as well.
|
|
|
|
|
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
|
|
|
|
|
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!
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.
Well, well, at least the job change upped my salary slightly.
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
modified 12-Jan-18 9:48am.
|
|
|
|
|
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."
|
|
|
|
|
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.
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
|
|
|
|
|
Peter Shaw wrote: Aurelia
Aurelia looks interesting. It really is a free-for-all out there though when it comes to Javascript frameworks.
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
|
|
|
|
|
Couldn't agree more Marc, which is why I stick with Aurelia these days.
It's 3yrs old now, stable, very mature and not going anywhere soon.
It might not have the hype, marketing and glory that the Likes or Angular, Vue & React have (Basically Goggles and/or Facebork), but it is maintained by a principle program manager at MS, and is included in the MS Dotnet Core command line SPA templates.
As for the free for all... hell where not even out of January yet, and I'm already aware of 4 new JS application frameworks... sigh
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|
|
They might work with Active Directory but in my experience, they only get you so far. There are many differences between the products and with Microsoft Graph coming online and maturing, the differences are only getting greater. The book does help understand the trajectory, but the point really boils back down to - Microsoft really could be making things easier for all of us.
|
|
|
|
|
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
|
|
|
|
|
If it's impeccable, is it chicken proof?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|