Posted by Igor Moochnick on 08/20/2012
The brute force solution of using the T4 templating engine to emit both the client-side and the server side data models didn’t look that appealing to me. Primarily due to a simple fact that it’s not that easy to refactor the T4 templates. And, the ReSharper junkie like me, can’t tolerate this fact.
Note: all of the code is an intermediate solution that was answering my personal needs for the project I was running. It is in no-way represent the full fledge solution. If you want something bigger and more feature-reach, you can either contribute to my solution or look into projects like Script# or SharpKit.
Read the rest of this entry »
Posted by Igor Moochnick on 07/20/2012
I had a blast presenting for ASPConf 2012. I want to thank all the organizers, presenters and attendees. Without you it wouldn’t have been possible.
One of the questions from one of the attendees during my “Building complex Single Page Application should be as enjoyable as visit to a SPA” talk was:
Q: Is it possible to bring on-demand portions of the application that will be emitted by the Asp.Net MVC Views (aka: dynamic views generation)
A: Sure (see Picture #3).
But when, in fact, I’ve tried to demonstrate it right away – I hit a snag.
What happened is: my implementation was correct but Google Chrome was too smart for me to handle it and wrapped the partial HTML with the full “HEAD” and “BODY” tags [See Picture #1].
I’ve assumed that my server was returning more than the generated by the Raw view content itself. If I would’ve checked a network stream [See Picture #2] (or Fiddler) I would’ve seen another result – the correct one.
So, this is a simple example how you can import a dynamically generated content from an Asp.Net Mvc view into a SPA application:
1. Create a view
2. Create a Controller entry (when you’ll navigate to this view you should see a result on Picture #2)
3. Change a dependency path in your SPA view to point to the new content (and the final result should look like Picture #3)
Posted by Igor Moochnick on 06/09/2012
It’s better to follow the best practices from the beginning to reduce the weight of the complexity and enable easy extensibility of your code. Here are a couple of links that may put you on a good path:
Here is an entry list of frameworks to know about:
I’m not afraid to admit that I’m not a web designer and I struggle with building good-looking sites, but there are a couple of tricks that I use to make sure that I’m not stuck:
Tips for VisualStudio–devoted crowd:
Here are a couple of more helpful ones:
- async.js – Async utilities for node and the browser
Posted by Igor Moochnick on 04/08/2012
There is an issue adding Nancy to the ASP.Net MVC site due to a simple fact that MVC controls the routes not through the web.config but through the routing table.
If you adding Nancy to the existing MVC site – make sure to remove the sub-route that controlled by Nancy from the routing table.
Here how it works:
1. Follow all the steps from the Nancy Documentation Wiki
2. Add your module and make sure that it has an “offset” path (via inheritance)
public Module() : base("/nancy")
3. Remove the “nancy” route from the Routing table in the Global.asax.cs
Posted in C#, Web | 5 Comments »
Posted by Igor Moochnick on 10/26/2011
With the recently released project Roslyn (or alternatively Mono Compiler Services) it is possible to have a clean solution to the problem: I write my data and data model in a language and an environment that allow solid validation and refactoring.
I’m ironing out some kinks in my implementation and, as soon as it’ll be in a stable state, I’m going to release a NWT (NeWT) project that will provide a similar to GWT (Google Web Toolkit) functionality.
Posted by Igor Moochnick on 09/09/2009
Now I own the full deck of the Microsoft certifications and I can sit back and relax (beer is in order ;-). Unfortunately, in the startup world that I operate most of the time, it’s not very recognizable achievement, but it’s nice to put these logos on my presentation slide decks and, especially now, I have a very powerful bragging rights – I have ALL of the Microsoft developers certifications !!!
It was a lengthy path and, I should add, a very confusing one. It wasn’t very obvious what certification is a prerequisite to which one and, I must add, I’ve made a couple of mistakes on the road until I’ve discovered a developer’s certification map by Jorgen Thelin that put everything in order and cleared all the confusions.
Posted in .NET, ADO.Net, ASP.NET, C#, Community, Thoughts, WCF, Workflows, WPF | 6 Comments »
Posted by Igor Moochnick on 07/09/2009
Great article about forms and ways of implementing data validation for the web applications.
Highly advised to read.
Posted in Tutorials, Web | 3 Comments »
Posted by Igor Moochnick on 06/30/2009
Let’s see how we can improve our UI by adding some watermarked “spice”:
Let’s define the primary style for the text box (textInput) and the dependent style for the watermark (textInput-watermark):
border: 1px solid #C9C7BA;
font-family:Tahoma, Verdana, Arial, Helvetica, sans-serif;
/* background-image: url('images/overlay.gif');
vertical-align: middle; */
Note that the watermark style can contain images as well (see the commented out piece).
After the styles were defined we need to add some code that will apply it to the text box. To do this I’m going to extend the default GWT TextBox. The trick is to hijack the OnBlur and OnFocus events. When the OnBlur is occurring, we’re going to show the watermark and OnFocus – hide it:
public class WatermarkedTextBox extends TextBox implements BlurHandler, FocusHandler
public WatermarkedTextBox( )
public WatermarkedTextBox(String defaultValue)
public WatermarkedTextBox(String defaultValue, String watermark)
* Adds a watermark if the parameter is not NULL or EMPTY
* @param watermark
public void setWatermark(final String watermark)
this.watermark = watermark;
if ((watermark != null) && (watermark != ""))
blurHandler = addBlurHandler(this);
focusHandler = addFocusHandler(this);
// Remove handlers
public void onBlur(BlurEvent event)
String text = getText();
if ((text.length() == 0) || (text.equalsIgnoreCase(watermark)))
// Show watermark
public void onFocus(FocusEvent event)
// Hide watermark
Posted in Design, GWT, Java, Tutorials, Web | 10 Comments »
Posted by Igor Moochnick on 06/11/2009
Gotta love this …
Posted in GWT, jQuery | Leave a Comment »