Monday, August 28, 2017

Asp.net : Live preview of Text typed in textbox using Jquery

In this article I am going to explain how to show live preview of text typed/enter in textbox using jquery.

Description:
I want to show the preview of text while type in textbox. I am using jquery

Implementation:
I have create Jquery function. On keyup function preview will be show.

Sunday, August 27, 2017

How to pass parameter to RDLC report in MVC

In this article I am going to explain how to create and pass parameter to RDLC report in MVC application.

Description:
I want to show report of State population and users can filter the search for particular state. I am going to use RDLC report to create and Reportviewer to show report.

Implementation:
Follow the below given steps to create RDLC report in MVC application:

MVC : Create RDLC report

In this article I am going to explain how to create RDLC report in MVC application

Description:
I want to show report of State population. I am going to use RDLC report to create and Reportviewer to show report.

Implementation:
Follow the below given steps to create RDLC report in MVC application:

Saturday, August 26, 2017

Javascript : Show and hide div

In this article I am going to explain how to show and hide DIV using Javascript.

Description:
I want to hide and show the div on button click using Javascript.

Implementation:

Here is the example:

Complete HTML markup:

Friday, August 25, 2017

Real time preview of Html code textarea in asp.net using jquery

In this article I am going to explain how to see real time preview of Html code from textarea in asp.net using jquery.


Description:
I want to display real time preview of HTML code/text entered in text area. I am using Jquery to implement this.

Implementation:
Create a jquery Keyup function.

Thursday, August 24, 2017

Asp.net : How to remove special character’s from string

In this article I am going to explain how to remove special character’s from string or  text typed/entered in Textbox in asp.net.

Description:
I want to remove special characters from text typed/entered in Textbox or string using RegularExpressions.


Implementation:

Complete Html markup of webform:

Sunday, August 20, 2017

Avoid special characters and space to enter in textbox using Jquery

In this article I am going to explain how to avoid special characters and space to enter (type) in textbox using Jquery

Description:
In application I am validating username. I want to avoid entering space and special characters in username. I am going to do this using jquery.

Implementation:
We have to create Keypress method. Here is jquery code that I am using:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
            <script type="text/javascript">
                $(document).ready(function () {
                    // restrict special characters
                    $('#TextBox1').keypress(function (key) {
                        var regexpns = new RegExp("^[a-zA-Z0-9]+$");
                        var key = String.fromCharCode(event.charCode ? event.which : event.charCode);
                        if (!regexpns.test(key)) {
                            event.preventDefault();
                            document.getElementById("message").style.display = 'block';
                            return false;                       
                        }
                        else
                        {
                            document.getElementById("message").style.display = 'none';
                        }
                    });
                });
            </script>

Complete HTML Markup of webform:

Saturday, August 19, 2017

Asp.net : Display tooltip in Gridview column on mouseover

In this article I am going to explain how to display tooltip in Gridview column on mouseover in asp.net. 

Description:
I am displaying employee’s information in Gridview and want to display each column data when placed mouse on column. We have 2 options 1st write  code on RowDataBound event of Gridview and 2nd use the label control’s tooltip property.

Implementation:
Method 1:

Complete source of webform

Friday, August 18, 2017

How to show tooltip on entire Gridview row hover in asp.net

In this article I am going to explain how to show tooltip on entire Gridview row mouse hover in asp.net.


Description:
I am displaying employees information in Gridview and want to display name & phone no. when mouse is hovered on row. To fulfill this requirement we have write code on RowDataBound event of Gridview.

Implementation: 

Complete source of webform

Thursday, August 17, 2017

Asp.net Adrotator : Display ads without page refresh

In this article I am going to explain how to show ads without page refresh using Sql server database in asp.net Adrotator control.

Description:
Adrotator control is used to show custom Ads (advertisements) on asp.net build websites. When users click on any ad they will be redirect to link assign for that. We can use both Xml and database as data source. Xml and database table must have following properties and columns: ImageUrl, NavigateUrl, AlternateText, Impressions, Keyword, Width and Height.

Implementations:
In this example I am going to use sql server database as adrotator data source. I have create a table Ads and insert some dummy records into it. To show ads without page refresh I am going to use Updatepanel and Timer control.

Asp.net Adrotator : Display ads without page refresh


Complete source of webform

ASP.NET MVC : Get IP address of users

In this article I am going to explain how to get IP address of users using asp.net mvc.

Description:
I want to get the IP address of visitors.

Implementations:
Add controller

Add an empty controller to project. Create an actionresult to get IP address.

Complete code of controller

Tuesday, August 15, 2017

How to Freeze Gridview’s (Scrollable) column and header using Jquery in asp.net

In this article I am going to explain how to freeze Gridview’s (Scrollable) column and header using Jquery in asp.net.

Description:
I have populate the gridview with employee’s information. I want to freeze the first column (name of employee) and header of Gridview (Scrollable). I am using GridviewScroll Jquery to implement this.

Implementation:
Complete Source of Webform

Monday, August 14, 2017

How to show rotating ads using Sql server database in asp.net

In this article I am going to explain how to show rotating ads using Sql server database in asp.net without page refresh.

Description:
Adrotator control is used to show custom Ads (advertisements) on asp.net build websites. When users click on any ad they will be redirect to link assign for that. We can use both Xml and database as data source. Xml and database table must have following properties and columns: ImageUrl, NavigateUrl, AlternateText, Impressions, Keyword, Width and Height.

Implementations:
In this example I am going to use sql server database as adrotator data source. I have create a table Ads and insert some dummy records into it.


How to show rotating ads using Sql server database in asp.net



Complete source of webform

Implementing Asp.net Adrotator control

In this article I am going to explain how to implement AdRotator control of asp.net.

Description:
Adrotator control is used to show custom Ads (advertisements) on asp.net build websites. When users click on any ad they will be redirect to link assign for that. We can use both Xml and database as data source. Xml and database table must have following properties and columns: ImageUrl, NavigateUrl, AlternateText, Impressions, Keyword, Width and Height.

Implementations:
I am using Xml to implement this example. I have add Xml File.

Sunday, August 13, 2017

Freeze columns of Gridview in asp.net

In this article I am going to explain how to freeze the columns of Gridview in asp.net.

Description:
I have populate the gridview with employee’s information. I want to freeze the first column (name of employee) of Gridview. I am using GridviewScroll Jquery to implement this.

Implementation:

Complete Source of Webform

Sunday, August 6, 2017

MVC : Create text file and download

In this article I am going to explain how to create text file and download using asp.net MVC.

Description:
I want to write text enter in textbox to Text file and download that text file.

Implementations:

Add controller
First of all add an empty controller to project. Create Action to create text file and download.