|
Way to tell him! Put 'im in his place!
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
It is fascinating how many people do NOT like the MVC implementation of Microsoft (and how Microsoft still push it AS IS)...
I'm working on the new engine for our next generation web application (in this step we will move all the functionality to the web and close the desktop app) and me too taking only parts of the MVC...
However until now I hadn't come to do my own DSL...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
|
The fact itself that you had to create such builder says everything...
Not MVC as idea, but the implementation of Microsoft lacks a lot of, otherwise you would write HTML as HTML and wouldn't bother yourself with such builders like yours and the one Marc looking for...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
It wasn't created for MVC, it was used to send generate HTML emails from a WPF application.
In MS MVC, you can write everything as plain HTML if you want. You don't need to use any builders.
|
|
|
|
|
Kornfeld Eliyahu Peter wrote: It is fascinating how many people do NOT like the MVC implementation of Microsoft (and how Microsoft still push it AS IS)...
The problem as I see it is that Microsoft (but they are not unique in this) create monolithic solutions rather than lightweight components that you can plug together for the desired behaviors. The website on Rails is another good example, but at least they are transparent about their intention when they write "Rails is opinionated software. It makes the assumption that there is the "best" way to do things."
ASP.NET MVC, like so many other "cool technologies" that Microsoft produces, often strikes me as the work of high school students with real world experience.
Marc
|
|
|
|
|
Why not use XDocument, XElement and XAttribute from Sytem.Xml.Linq namespace?
|
|
|
|
|
Quote: C# is an extremely expressive language, so it turned out to be very easy.
Apart from the 90 bajillion edge cases the code doesn't cover, which are handled quite nicely in the HTML Agility Pack[^] for example.
|
|
|
|
|
JMK-NI wrote: Apart from the 90 bajillion edge cases the code doesn't cover
But which can be covered with general purpose "tag" and "attribute" functions. I thought HTML Agility Pack was for parsing?
Marc
|
|
|
|
|
HAP is read/write. You can create documents with it as well.
What do you get when you cross a joke with a rhetorical question?
---
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
---
Do questions with multiple question marks annoy you???
|
|
|
|
|
With or without nasal fitment?
|
|
|
|
|
I believe you can use/extend TagBuilder[^] class. It's handy and very helpful.
WARNING: It is highly required to like ASP.NET MVC
Wonde Tadesse
|
|
|
|
|
Wonde Tadesse wrote: I believe you can use/extend TagBuilder[^] class. It's handy and very helpful.
Interesting, but it's not exactly a fluent class (ie, it returns itself)
Marc
|
|
|
|
|
Ya. That is why I said extend
Wonde Tadesse
|
|
|
|
|
Wonde Tadesse wrote: Ya. That is why I said extend
Ah.
Marc
|
|
|
|
|
|
Yes, I have written a HTML 5 boilerplate using a fluent interface which generates the HTML on the server side. What I like about it is that it is strongly typed and I can use inheritance etc.
|
|
|
|
|
BlueMerc wrote: Yes, I have written a HTML 5 boilerplate using a fluent interface which generates the HTML on the server side.
Would the code be available?
Marc
|
|
|
|
|
Well, I thought of creating an open source project for it, but I would need to refactor the code first. I never got to it.
|
|
|
|
|
|
|
The docs are available from the link, but here is the direct one for you [^]
|
|
|
|
|
carbonrobot wrote: The docs are available from the link, but here is the direct one for you [^]
Ack. I looked and didn't see it. Thanks for hand-holding me.
OK, I think we have a winner! This reads like what I was wanting to write (in terms of using it) and produces what I would expect. Very nice! And yay, a zip file rather than a NuGet package. Kudos also for commented code! I'm not being sarcastic, it's so discouraging when I come across code that completely lacks comments. I think you just saved me a few days of effort.
Marc
|
|
|
|
|
|