|
Not sure if I was using ajax in that way I would be using MVC at all, just use cshmtl pages in a asp.net app
sounds like you have found a way of using MVC that it was not design to do but in a way that works, no problem with that, however I do find it a bit harsh to condemn the technology just because you are using it differently to they way it was originally designed to work
You cant outrun the world, but there is no harm in getting a head start
Real stupidity beats artificial intelligence every time.
|
|
|
|
|
I'm not condemning it - it does at least provide a mechanism whereby you can "fix" this issue.
Bergholt Stuttley Johnson wrote: sounds like you have found a way of using MVC that it was not design to do but in a way that works
Just using plain old ASP.NET MVC with Microsoft WebAPI, TypeScript and KnockoutJS.. pretty much standard fare these days
..and I usually plug this in to make actions/controllers optional unless I actually need to write specific code for them..
https://github.com/brentj73/ControllerLess[^]
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
SPA's are to MVC as WPF is to Windows Forms.
Can you combine the two in a single application? Sure. If you want to have lots of headaches and duplicated code.
It's much simpler to do one or the other. In my SPA's I have exactly one web page: index.html, and zero page controllers. Everything is webapi and javascript. Then I'm not trying to do mental gymnastics around partial pages vs. partial views vs. shared views, or api controllers vs. page controllers (routing gets to be a mess when you go down this road).
|
|
|
|
|
Vark111 wrote: Sure. If you want to have lots of headaches and duplicated code.
Hey, that's my point Standard ASP.NET MVC means you end up with code in WebAPI and in the view controller for the same view.
I'd disagree about the headaches though - a single page app may only have one URL to a view, but depending how it's configured it could well be returning partial views as a HTML response to an AJAX call, as opposed to JSON encoded data (I've developed systems that do both). You can get just as many issues using ASP.NET MVC and Razor without AJAX or WebAPI once an application gets complex enough.
A SPA with only a few different HTML elements can be done without using partial views, but if you're working on a large-scale application it's just not practical to try and load every possible combination of HTML elements the first time you hit the page. One system I recently worked on (not my design) had over 6,000 views/partial views.
I really hate duplicated or unnecessary code, that's why I'm talking here about actually removing actions from view controllers that only return a view leaving only code that actually performs a logical function (or even better, removing the controller completely where only static content is contained in a view).
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
I noticed earlier in the thread you mention using Knockout etc as your spa framework, and maybe that's where my disconnect is as I don't use knockout. I use angular, so all of my "partial views" are actually "partial html", which doesn't need a view controller.
|
|
|
|
|
If you're not running the views through ASP.NET MVC then you're right, there's no need for a view controller.
My point was more about having views where ASP.NET insists on me having to write a view controller with an action that simply returns the view. In those cases, the code I'm forced to write..
protected ActionResult Index()
{
return View();
}
..seems extraneous and is often found duplicated, even multiple times in individual view controllers at times.
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
I don't know enough about jquery or bootstrap to form an opinion one way or the other. At the point I'm at, it would certainly be easy to abandon jquery-ui since the MVC5 template I'm using uses bootstrap (terrible name, btw) by default.
".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
|
|
|
|
|
You get a lot more bang for your buck with Bootstrap as you get all the responsive helpers and layout classes.
It's easy to customise too, so long as you get the LESS source (available on NuGet) rather than just including the Boootstrap CSS file (you'll end up unpicking loads of CSS in your own CSS file if you just use that).
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
John Simmons / outlaw programmer wrote: I still am not a fan or advocate of web development.
That attitude will get you far. News flash!! The web is the future.
Oh wait that statement is so last century.
Once you lose your pride the rest is easy.
In the end, only three things matter: how much you loved, how gently you lived, and how gracefully you let go of things not meant for you. – Buddha
Simply Elegant Designs JimmyRopes Designs
|
|
|
|
|
I thought this was the year of Linux?
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Simon_Whale wrote: the year of Linux
Is it? Well pass the bread knife then...
veni bibi saltavi
|
|
|
|
|
I'd rather use a chainsaw on it personally, last time I used it was attempting to deploy it in Senelager, Germany as a spotty youth.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
The year of Linux is OR'ed to whatever the actual year-of is; in the hope that there's somewhere a .HasFlag(YearOf.Linux)
|
|
|
|
|
no this is the year of the Dodo (or Windows 8 as its officially called)
You cant outrun the world, but there is no harm in getting a head start
Real stupidity beats artificial intelligence every time.
|
|
|
|
|
No whats a poor Dodo done to be tarnished with that monstrosity?
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
It was tasty
You cant outrun the world, but there is no harm in getting a head start
Real stupidity beats artificial intelligence every time.
|
|
|
|
|
JimmyRopes wrote: News flash!! The web is the future. No, no, no!
Now is the era of web apps that run full screen outside the browser!
Do try to keep with the times!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Using MVC or MVP (or MVVM) patterns for desktop applications has been quite an improvement over putting everything into the codebehind. This way I had a big increase in maintainability of the frontends.
Web development is so unbelievably slow, awkward and clumsy that I also can't see why somebody would really like doing it. The best web applications are those that need no browser.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
modified 14-Apr-15 2:32am.
|
|
|
|
|
Wow, 100% spot on. Perfect post
If it's not broken, fix it until it is
|
|
|
|
|
I had a hell of a time with datepicker and the formatting of it.
I'm sure you already know about display templates but this[^] is a pretty good source.
New version: WinHeist Version 2.1.1 new web site.
When you are dead you don't know it, it's only difficult for others.
It's the same when you're stupid.
|
|
|
|
|
Yeah, I encountered display templates while trying to finger out my datepicker issues. Now that I have datepicker fingered out, I'm gonna try using the bootstrap version - not because I think it will be better, but because I like fighting the same freakin battles over and over again.
".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 found bootstrap widgets easier to work with but some like the datepicker are a pain in the ass.
New version: WinHeist Version 2.1.1 new web site.
When you are dead you don't know it, it's only difficult for others.
It's the same when you're stupid.
|
|
|
|
|
It's Spring and time to jettison items I have not used in years. A long, long time ago, I had my first contact with Windows, ActiveX controls and Microsoft's incessant renaming of tech items. Sitting on my desk are two books about COM and COM+ development (MS books). I also have one for C# 2.0, and an original Code Complete. Now I know the last one is somewhat of a collector's item, but I barely if ever cracked open the COM books.
Anyone else here have trouble letting go of books? Anyone interested in these books?
Trying to apply the three rules of clutter management:
1) Are you using it?
2) If not, is it making money?
3) If not, do you love it?
No? Time to toss it.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
I have a copy of DOS 4 user manual, but if I get rid my desk will wobble again
You cant outrun the world, but there is no harm in getting a head start
Real stupidity beats artificial intelligence every time.
|
|
|
|
|
I have that and the manual of the Amstrad 386 PC that had it on board, both of them with the same cover design. I'll never let go of them... as I still have a battered copy of PC No Problem, year 1995.
Geek code v 3.12
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++*
Weapons extension: ma- k++ F+2 X
I use 1TBS
|
|
|
|