Dynamically Load MVC Partials Using jQuery

Normally I do my examples in C#, but lately I have noticed a lack of VB.NET examples. Therefore, this example is in VB.NET.

I have searched long and hard to find a way to dynamically load MVC partials. I had tried to find a solution a few times, but quickly gave up. I figured there must be a way. Then I remembered how I used to create on the fly images using an HTML image control and simple URL to an ASPX page which served up the image ( another blog topic ). Through this latest realization and a little searching I have pieced together a working model. The piece I was missing was having the controller return a PartialView
. Continue reading Dynamically Load MVC Partials Using jQuery

Cookie Monster Would Be Disappointed

Using localStorage or sessionStorage would disappoint Cookie Monster.

My go to for a website to store data temporary was to use cookies. I would use cookies for storing user preferences, scores, shopping carts and more. Cookies can be a problem though as many people stop excepting cookies and they are difficult to manage. Continue reading Cookie Monster Would Be Disappointed

Simple MVC AJAX GET Method

MVC makes doing AJAX calls simple.  As I have said before, I do not like the AJAX controls and methods that the Microsoft ships with the MVC platform.  I prefer to create my own AJAX methods instead of posting a AJAX form.  I find I can get better control and I can create tighter rules around elements of importance.

The one thing I learned early is when doing a Get Method, you need to ensure that you give permission to the AJAX call to return JSON by adding the following to your JSON return object:

JsonRequestBehavior.AllowGet

This is an easy example of how to use your basic jQuery with your MVC Controller.

Continue reading Simple MVC AJAX GET Method

Which Web Tools – When and How Much

I cannot say enough about learning which tools use when. It is only through experience will you ever learn this discipline. I have learned when to use a handful of tools and how often. I have also learned that sometimes there is overhead that can make your projects bloated; therefore, I often create my own ( although some may argue against it).
Continue reading Which Web Tools – When and How Much

Simple JS Dialog

Keeping in the spirit of using my blog as a quick code repository; sometimes you just need a simple easy to implement dialog box. I have been using the following routine for sometime now. Sometimes you just need a simple piece of code to get the project done. This although is very simple, it does the job perfectly. It is not how I often style it, but you can figure that out.

See Working Copy: view & try Continue reading Simple JS Dialog

February Recap – jQuery Made Simple

February is a month that I made jQuery made Simple examples that helped me at to my library and hopefully will help you.  I typically try not to use jQuery libraries or plugins as I feel it is often easy enough for me to do quickly and allows me stretch my creativity and increase my skill-set.  I fee it is important to practice or you loose it.

You may use all of my examples free with no strings attached.

All of my examples use no additional libraries or plugins.  Just basic jQuery!

Here are the examples created in February: Continue reading February Recap – jQuery Made Simple

jQuery Folder Tree Menu

Folder MenuToday I thought that I would put together a simple jQuery folder menu for myself to use in projects to come.  It is easily modified,   easy to create dynamically and easily styled.  The jQuery script portion is rather simple and has been tested on Chrome, FireFox and IE. This is another step in the direction of building a base library of scripts for me to use.

Download full Sample Code: http://www.unlatched.com/sample/foldertree/FolderView.htm

Run Sample Code:  http://www.unlatched.com/sample/foldertree/foldertree.zip
Continue reading jQuery Folder Tree Menu

Simple jQuery Menu

Now days it seems that there is a plug-in for almost any jQuery task.  The trouble with plug-ins is that they are often not flexible enough and the designer / developer who is using them is not practicing developing their own solution.  It is too easy to Google for a plug-in to do the job.  Googling for the correct solution may take just as long as creating one yourself.   Do not take me wrong; I use plug-ins, but I use plug-ins when it is a more complicated solution and not worth my time or it is just a one-off solution. Continue reading Simple jQuery Menu