by justin
27. July 2008 07:51
If you're interested in the new Microsoft MVC framework but you're a little skeptical about going back to a classic ASP Tag Soup rendering system, you should check out the Spark View Engine.
It has a very interesting way of allowing you to write your view with some simple string replacements and also specialized tags that appear to be actual HTML. The general idea is basically the same but visual appeal is quite a bit better.
Here is an example:
|
<var names="new [] {'alpha', 'beta', 'gamma'}"/>
<for each="var name in names">
<test if="name == 'beta'">
<p>beta is my favorite.</p>
<else/>
<p>${name} is okay too I suppose.
</test>
</for>
|
In this case your “foreach” loop appears to actually be part of the html. The code inside of the each attribute is compiled as C#. The system it uses is pretty straightforward and easy to understand which gives me a lot of confidence in it already.
I have been having problems getting NVelocity to work properly so I am going to try to use Spark as the default NBusiness code generation tool. We’ll see how intuitive it is to have this pseudo-html markup inside of code but I suspect this tool will work much better for NBusiness.
by justin
7. April 2008 21:08
I was reading an article by Jeff Perrin about how ASP.NET attempts to abstract web development and came across this phrase:
Now the first problem with Webforms is not that it's an abstraction, or even that it's a leaky one (they all are). The problem is that what Webforms attempts to abstract away is actually simpler than the abstraction!
The second "problem" with Webforms is that not very many people know the first problem. I know I didn't, until I saw how Rails, Monorail, and other frameworks are able to work with the underlying model of the Web, while still being terribly simple to understand and develop on top of. Making it easier to program for the Web is a laudable goal, I'm just not so sure that abstracting the technology that it's built on top of to the point where it's unrecognizable is the way to go about doing it.
To me this rings very true. I have been following the progress of the Microsoft MVC framework a lot lately and I can't tell you how excited about it I am. It will be a giant relief to finally be rid of postbacks and viewstates!
by justin
8. March 2008 01:04
I just got done deploying a site to a GoDaddy hosted site only to find that one page where I had an ASP.NET Ajax UpdatePanel was throwing a MethodAccessException during the process of databinding to my object. After trying a bunch of things it turned out that I needed to switch my objects from internal to public. Normally you should be able to do reflection on a public member of an internal object in Medium Trust but GoDaddy must have unusual security settings for ASP.NET Ajax libraries.
This is an unfortunate thing to have to do but after messing around with this for an hour or so I'm just glad something will work. I'm not exactly sure why this is happening on GoDaddy because in my test environment I have <trust level="Medium" /> set so that I can debug issues like this as they come up but they must have some restricted settings on the ajax permissions.