qTip Implementation in MVC Partial View

Recently, I came across a task wherein I had to show a list of dynamic information in a tooltip in a MVC project. So, I started playing around with qTip. My intent was to load the dynamic information within partial view and to load that partial view inside a qTip tooltip.

This article outlines the steps to show partial view in a tooltip using qTip. For demonstration purpose, we will create a list of events and will show the event details in the tooltip.

1. Create a MVC application.  The first step would be to download the necessary javascript files and css files to implement qTip2. This can be done by either using CDN from http://qtip2.com/download or by installing the Nuget Package using the following command. This will install the necessary jquery dependencies, script files and css files.

Nuget_Package

Continue reading

Advertisements

Render MVC partial view inside bootstrap modal dialog

In this article, I am going to show you how to create a modal dialog using bootstrap and then load a MVC partial view in the dialog.

The steps are explained below with screenshots.

1. We need to have a modal container in the main layout page. All the dialogs will be loaded inside this container. I have hardcoded the styles for now. It is recommended that all the styles be put in a separate stylesheet file.

11

2. Now, we need to add the needed javascript. This script will make an internal Ajax call and will inject the content of the partial view inside the modal container div.

22

Continue reading

Pass Multiple Models in a View in ASP.NET MVC

I came across this very intuitive article in CodeProject. This article explains how to pass multiple models in a view using ASP.NET MVC4, describing the pros and cons of these approaches and with a sample demo project as well.

  1. ViewModel
  2. Partial View
  3. ViewBag
  4. ViewData
  5. TempData
  6. Tuple

Link to Code Project Articles:

I found it very helpful as I am on the verge of building a ASP.NET MVC project and am diving into its nitty-gritty details.

Hope it helps you too! 🙂