Thursday, July 30, 2015

Convert text into image and show image preview in asp.net

In this article I am going to explain how to Convert text into image and show image preview in asp.net

Description:
In the previous article I have explained Pass parameter to RDLC report and CreateRDLC report using Store procedure

When users enter text in textbox/input, entered text will be converting into png image and showing its preview.

Tuesday, July 28, 2015

Asp.net: Pass parameter to RDLC report

Sunday, July 26, 2015

Asp.net: Create RDLC report using Store procedure

In this tutorial I am going to explain how to create RDLC report using Store procedure in asp.net

Description:


I have a table Tb_Student and contain the information of student i.e. name, Address(City) and Roll number. In this example I am going to display the all student information in RDLC report.

Implementation:
I have created a table Tb_Student.
Create a store procedure to get data from database table

How to split the string in Asp.net

Saturday, July 25, 2015

Display records in Gridview according to DropDown Selection in Asp.net

In this article I am going to explain how to display records in Gridview according to dropdown Selection in Asp.net

Description:

In this tutorial I am using Gridview and DroDownlist control. Drodown display the name of name of City. When user selects the particular city, detail of students belonging to that (City) will be displayed. E.g. if select the Shimla, student belongs to Shimla city will be displayed.

Friday, July 24, 2015

Asp.net Interview Question: Difference between DataReader and DataAdapter

In this article I am going to differentiate DataReader and DataAdapter


DataReader:
DataReader is a Connection Oriented means require a continuous connection with the data source to accessing it. It is read and forward only. We can’t write/customize the data. It is best choice where we need to display the data only. It is fast as compared to dataset. It stores one row in memory at a time.

Interview Question: Difference between DataTable and dataset in asp.net

In this article I am going to explain the differences between DataTable and dataset in asp.net.


DataTable :
     1.    A DataTable is an in-memory representation of a single database table. It represents a single table and has rows and columns.
     2.      DataTable is less flexible.
     3.      DataTable is lighter because it contains the data of single table only.
     4.      DataTable fetches only one TableRow at a time.
     5.      DataTable , DataSource can’t be serialized.
     6.      There is no DataRelation object in DataTable .
     7.      There is no Unique Constraint and Foreign Key Constraint object available in DataTable.
Example of DataTable:
SqlDataAdapter adp = new SqlDataAdapter("Select * from Tb_Student", con);
        //DataTable  object
        DataTable  dt = new DataTable ();      
        adp.Fill(dt);
        //check the DataTable  contains data or not
        if (dt.Rows.Count > 0)
        {
            grdstudent.DataSource = dt;
            grdstudent.DataBind();
        }

Thursday, July 23, 2015

Select, Edit, update and Delete in Gridview with store procedure using Linq

In this article I will explain how to Select, Edit, update and Delete in Gridview with store procedure using Linq

Description:

I have created a table Tb_Student and having records. To display, Update and Delete the students detail in Gridview create store procedures.

Wednesday, July 22, 2015

Bind Gridview with Stored Procedure using Linq to Sql

In this tutorial I will explain how to bind the Gridview Stored Procedure using Linq to Sql


Implementation:
I have created a table Tb_Student and insert records to it.

Bind Gridview with Stored Procedure using Linq to Sql

Create a store procedure to Get data from database
Create Proc Sp_GetStudentData
As begin
Select * from Tb_Student
end

Add a webform to project/website. Drag and drop the required controls from toolbox to webform.

Tuesday, July 21, 2015

Insert Data into Database using Store procedure in Linq to sql

In this tutorial I will explain how to insert Data into Database using Store procedure in DLINQ ( Linq to Sql)


Implementation:
Create a table Tb_Student

Insert Data into Database using Store procedure in Linq to sql


Create a store procedure to insert data into database
Create Proc Sp_InsertStudents
(
@sname varchar(50),
@saddress varchar(200),
@rollno int
)
As begin
Insert into Tb_Student values(@sname,@saddress,@rollno)
end 

Asp.net: Increase the maximum upload file size

In this article I am going to explain how to Increase the maximum upload file size in Asp.net.

Description:
Default maximum size to upload file is 4 MB (4096KB) and execution time is 110 seconds. if we are uploading files larger than 4 MB we get an error “Maximum request length exceeded.”

Implementation:
Add the below given line in web.config of project/website.

<system.web>
   <httpRuntime maxRequestLength="51200" executionTimeout="9999" />
</system.web>

MaxRequestLength: Maximum file upload size. Here file upload size is increases to 50 MB.
 1 MB = 1024 KB and 50*1024 = 51200

Error: Maximum request length exceeded

In this post I am going to explain how to solve the error Maximum request length exceeded
Error: Maximum request length exceeded

Description:
Default maximum size to upload file is 4 MB (4096KB) and execution time is 110 seconds. This error occurs when we are uploading files larger than 4 MB.

Solution:
To solve this error add the below given line in web.config of project/website.

Asp.net: How to set session timeout using web.config

In this article I am going to explain how to set session timeout in Asp.net application using web.config

Description:

By default session timeout time is 20 minutes but in many cases we have to change (increase or decrease) the session time. In this example I am going to change the session timeout using web.config from 20 minute to 40 minute.

Monday, July 20, 2015

Solution: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jQuery

In this article I am going to explain how to solve the error: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jQuery

Description:
I have faced an error while I am working on Asp.net “WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).

Asp.net: Highlight the selected page number in Gridview Control

In this article I am going to explain how to highlight the selected page number in Gridview Control in Asp.net

Description:

When we select any page number in gridview pager it is highlight as shown attached snapshot.

Asp.net: Highlight the selected page number in Gridview Control

I want to improve the look and feel of Gridview pager. To change it I have add some CSS style and set the CSS class in PagerStyle. 

Asp.net: Enable pagination (Paging) in Gridview control

In this article I will explain How to enable the pagination (paging) in Gridview control in Asp.net.

Description:

Gridview control has the in-built paging functionality. To enable it we have to set the AllowPaging property to true to enable pagination and handle the OnPageIndexChanging event. When we set the AllowPaging property to true by default Numeric paging mode will work. We can customize the paging mode by setting the property PagerSettings-Mode of Gridview. We have four options NextPrevious, NextPreviousFirstLast, Numeric and NumericFirstLast. Don’t forget to assign the Pagesize.

Sunday, July 19, 2015

Set number of rows to display in Gridview according to Dropdown Selection in Asp.net

In this tutorial I am going to explain how to set number of rows to display in Gridview according to Dropdown Selection in Asp.net

Description:

In this tutorial 5 records are displayed in Gridview on page load and pagination is working. I have added a Dropdownlist control to webform and set value 5, 10, 15. When user selects the 10 from dropdown 10 records will be display in Gridview per page and vice versa.

How to protect the content and images from theft using JavaScript and CSS

In this article today I am going to explain How to protect the content and image from theft using JavaScript and CSS

Implementation:

 I have a page and want to disable the right click on it. Add the below given script in head section of page.
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
  <script type="text/javascript">
        $(document).bind("contextmenu", function (e) {
            e.preventDefault();
        });
</script> 

Saturday, July 18, 2015

Easiest way to Disable mouse right click using Javascript

Friday, July 17, 2015

5 simple steps to Create RDLC Report in asp.net

In this article I am going to explain the 5 simple steps to Create RDLC Report in asp.net

Description:
In the previous article I have explained Implement Google like Custom Pagination in Datalist Control in Asp.net and Highlight The Current (selected) Page Number in Repeater Pagination.

Implementation:
I have created a table Student_Detail and having data. I want to display the detail of Students in Report. To create a report using RDLC follow the below given steps.

Wednesday, July 15, 2015

Implement Google like Custom Pagination in Datalist Control in Asp.net

In this tutorial I try to explain how to implement Google like custom pagination in Datalist control in asp.net

Description:

Implementation:
By default Datalist data control doesn’t have paging option. So we have to write the custom code to implement the pagination functionality. In this tutorial I am going to implement the pagination in Datalist data control like Google.
To implement this I am using Two Datalist control (One to display Data and another one for pagination) and two link buttons to go Next and previous page. So drag and drop the required controls from the toolbox to webform.
Add the style to Head section of webform

Tuesday, July 14, 2015

Asp.net: Highlight The Current (selected) Page Number in Repeater Pagination

In this tutorial I will explain how to get highlight the current (selected) page number in repeater pagination in Asp.net

Description:

In this tutorial I am using two repeater control (one to bind the data and 2nd one to display page number) and 4 link buttons (to go page First, Last, Next and Previous page). On page load only 4 page numbers will be visible when user clicks on page number 4 next page numbers will be display and so on. I am using PagedDatasource to do pagination in Repeater control.  When user clicks on any page number its must be highlighted e.g. change in color of selected page number.

Monday, July 13, 2015

Implement Custom Attractive Pagination in Repeater Control in Asp.net Tips & Guide

In this tutorial I will explain how to Implement Custom Attractive Pagination In Repeater Control In Asp.net tips & guide.

Description:
By default Repeater control does not have pagination option. To implement the pagination in Repeater we have to write the custom code for it.
In this tutorial I am using two repeater control (one to bind the data and 2nd one to display page number) and 4 link buttons (to go page First, Last, Next and Previous page). On page load only 4 page numbers will be visible when user clicks on page number 4 next page numbers will be display and so on.

Thursday, July 9, 2015

How to Learn Implement Pagination in Repeater Control in Asp.net

Introduction: In this article I am going to explain how to Learn Implement Pagination in Repeater Control in Asp.net

Description:
In this example I am using the Next, Previous, First and last button in pagination. I have created table Student_Detail and table have data.

As we know repeater control by default does not have pagination option. Hence if we use the repeater control and want pagination in it so we have to write the custom code for it.

Tuesday, July 7, 2015

Swap the images OnClick and zoom on MouseHover using Jquery in asp.net

Introduction: In this article I try to explain how we can swap the images OnClick and zoom on MouseHover using Jquery in asp.net

Description:

In shopping website we saw the image swap functionality. Users click on the product thumbnail image which replaces the main image of product. I am using the Elevate Jquery to implement the swap functionality.

Saturday, July 4, 2015

Change the StyleSheet (CSS) file dynamically in Asp.net

Introduction: In this article I will explain how to how to change the stylesheet (CSS) file dynamically in asp.net

Description:

To implement this functionality in asp.net website/project I have create an example. I have created 3 stylesheet (CSS) files in CSS folder.

How to add Ajax Toolkit to Visual Studio 2012, 2013

Introduction: In this article I will explain how to add Ajax Toolkit to Visual Studio 2012, 2013 from Nuget

Description:

To add the Ajax Toolkit go to Tools>>Library Package manager >> Package Manger Console. Now copy and paste the below given command:
Install-Package AjaxControlToolkit

Friday, July 3, 2015

Swap the image OnClick using Jquery in asp.net

Introduction: In this article I try to explain how we can swap the images OnClick using Jquery in asp.net


Description:

In shopping website we saw the image swap functionality. Users click on the product thumbnail image which replaces the main image of product. I am using the Elevate Jquery to implement the swap functionality.
I have created two table Tb_Products (To store Products information)

Thursday, July 2, 2015

How to Change the image on MouseHover like shopping website using Jquery in asp.net

Introduction: In this article I try to explain how to Change the image on MouseHover like shopping website using Jquery in asp.net dynamically.

Description:

We normally saw change image functionality in E-commerce website E.g. When we see a product on website and product have 2 or 3 images. When we keep pointer on image, displayed image has been changed with hovered image.
I have created two table Tb_Products (To store Products information) 
How to Change the image on MouseHover like shopping website using Jquery in asp.net