3 Comments

iFrame: How to show specific part of a webpage using iframe

Someone ask me “how can i display a specific area of a website using iframe ?” So today I’m going to show a way to display specific area/portion of a webpage using iframe tag. Iframing an external webpage is not so tough. We just need a little knowledge about basic HTML and CSS to do that.
The <iframe width="300" height="150"> tag specifies a floating inline frame, used to embed external content in a webpage. Using ifrmae easily we could display an external webpage including text, images, and videos etc. But here we’re going to see “how to display a specific part of a website using <iframe>

Continue Reading »

Leave a comment

Jquery Dialog – prevent page behind dialog from Scrolling

Introduction : 

It is annoying when you open a jquery dialog and when scrolling the page behind scrolls.

So, say we have a long page(with scroll) and when a user opens a dialog on anchor click we show an iframe inside the dialog. By default when the dialog is shown when user scrolls the page will scroll hiding our dialog.

To solve this simply on open event of dialog we will set the body’s overflow to hidden and on beforeclose event of dialog we will reset it back to inherit. see below :

Continue Reading »

Leave a comment

WebApi Delete/Put method not working

Introduction : 

When using Visual Studio 2013 that comes with IIS Express, I created a web api and tried put a breakpoint in Delete/Put method. Surprisingly I had an error “The file or directory does not exist on the server.”.

After researching found out that some web servers do not allow put or delete by default, and IIs express is one of them.

Continue Reading »

Leave a comment

Jquery – Add Anchor Tag to Dynamicly Created Table

Introduction : 

When creating a table on runtime (dynamically) using JQuery, I had an anchor tag with “href” attribute set to a website (see below sample).

When clicking, the page would refresh and the anchor would not navigate to the URL.

Continue Reading »

Leave a comment

Tablesorter Dynamic Data and Custom Sorting

Introduction : 

Today I was facing an issue of sorting a dynamically created table with tablesorter. I tried many suggestion and none was working for me e.g. to trigger update and trigger
appendCache :

   $(table).trigger("update");
   $(table).trigger("appendCache");

but none of these worked, so in this post I will show you how to sort dynamic table and also write your own custom sort.

Continue Reading »

Leave a comment

Creating Fake Optional Parameters in .NET 2.0

Optional parameters enables you to assign default values to your method’s arguments. It is also useful when you want to omit arguments for some of your methods’ parameters.
With latest releases of .NET you have a lot of extra features such as linq, optional parameters etc. But in 2.0 you cannot have optional parameters.

Continue Reading »

Leave a comment

JQuery Validation And Eventhandlers

Introduction:

If you are creating an ASP.NET application, you may know that it is better to do validations in client side.

This is why there is a JQuery plugin to validate each element on the form and place an icon next to the valid/invalid element. In this article I will show you how to use this plugin.

The other interesting point I will be covering is the use of “handlers” to achieve a specific task. For example if I wanted to know number of elements that failed validation or if I wanted to log to database once certain element in my form fails, I would have to use handlers.

Continue Reading »

Leave a comment

Reset SQL Server SA Password

Introduction:

I had to search a lot when I wanted to create a test database in my local machine and had forgotten my “sa” password.

Finally I came across an article that showed how to reset SQL server “sa” password using configuration tools.

The first thing you need for this to work is an administrator account/login on the computer and for me the it was SQL Server 2008.

Continue Reading »

5 Comments

Creating JsTree Using MVC Pattern

Introduction : 

Recently I worked on a project in MVC4 that involved using JsTree. The requirement was to create a tree so a “category” of objects could be managed by users.

In this tutorial I will show you a brief usage of JsTree using MVC4 and how to drag and drop nodes or Create and Rename a “category” using context menu option of JsTree.

Code Snippets:

The first thing you require are the Jquery and  JsTree plugin so go ahead and download them from here.

Continue Reading »