ASP Snippets

Categories






Alerts

Free Alerts

Your email will always be
private and will not be shared.




Follow us on twitter.


Welcome to

Welcome to ASP Snippets

Featured Snippet


Excel like AutoFilter Feature in ASP.Net GridView Control
Author:Mudassar Khan

Here Mudassar Ahmed Khan has explained how to add Excel like AutoFilter feature in ASP.Net GridView Control using DropDownList
Here I am explaining how to build a feature similar to Microsoft’s Excel AutoFilter in ASP.Net GridView control. Excel AutoFilter allows user to filter the records using the DropDownList in the header, so lets start with the tutorial   GridView Markup <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns = "false" AllowPaging = "true" PageSize = "10"  Font-Names = "Arial" Font-Size = "11pt" AlternatingRowStyle-BackColor = "#C2D69B"  HeaderStyle-BackColor = "green"  OnPageIndexChanging = "OnPaging"> <Columns>     <asp:BoundField DataField="ContactName" HeaderText="Contact Name" />     <asp:BoundField ... [More]

Posted: Nov 26 2009, 23:03 by Mudassar Khan | Comments(3)RSS comment feed | Filed under : ASP.Net | C# | GridView | VB.Net



Recently Added






Most Viewed


Excel like AutoFilter Feature in ASP.Net GridView Control

Here Mudassar Ahmed Khan has explained how to add Excel like AutoFilter feature in ASP.Net GridView Control using DropDownList
Here I am explaining how to build a feature similar to Microsoft’s Excel AutoFilter in ASP.Net GridView control. Excel AutoFilter allows user to filter the records using the DropDownList in the header, so lets start with the tutorial   GridView Markup <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns = "false" AllowPaging = "true" PageSize = "10"  Font-Names = "Arial" Font-Size = "11pt" AlternatingRowStyle-BackColor = "#C2D69B"  HeaderStyle-BackColor = "green"  OnPageIndexChanging = "OnPaging"> <Columns>     ... [More]

Posted: Nov 26 2009, 23:03 by Mudassar Khan | Comments(3)RSS comment feed | Filed under : ASP.Net | C# | GridView | VB.Net

Export GridView To Word/Excel/PDF/CSV in ASP.Net

Here Mudassar Ahmed Khan has explained how to export GridView to Word, Excel, PDF and CSV documents
In this article, I will explain how to export GridView to Word, Excel, PDF and CSV formats. Exporting to Word, Excel and CSV can be easily achieved using ASP.Net without any third party tools, but for exporting GridView to PDF I am using iTextSharp which is a free library for exporting html to PDF.   To start with I have a GridView in which I am showing Customers records from the NorthWind Database. The HTML markup of the GridView is as shown below   <asp:GridView ID="GridView1" runat="server"     AutoGenerateColumns = "false" Font-Names = "Arial"     Font-Size = "11pt" ... [More]

Posted: Mar 14 2009, 23:11 by Mudassar Khan | Comments(185)RSS comment feed | Filed under : ASP.Net | C# | VB.Net | GridView

Save and Retrieve Files from SQL Server Database using ASP.Net

Files can be easily saved in the SQL Server Database Saving it in database makes it easily manageable. Here I will explain how to save and retrieve files from database.   Database Design   Here I have created a Database called dbFiles and it has a table called tblFiles. It has 4 Fields. The complete description is available in the Figure below   As you can see above for the id field I have set Identity Specification true, so that it automatically increments itself.   Field Relevance id Identification Number Name File Name Content ... [More]

Posted: Feb 19 2009, 04:49 by Mudassar Khan | Comments(118)RSS comment feed | Filed under : ADO.Net | C# | SQL Server | VB.Net

Display Images from Database using ASP.Net

How to retreive images saved in database and display them using ASP.net Image Control
In my previous article I explained Save and Retrieve Files from SQL Server Database using ASP.Net. Here I will explain how to display images that are saved in database.   I have saved images of three different formats i.e. JPEG, GIF and PNG in the Database. Refer figure below. Retreive the Images   To retreive pictures from database I have created a Picture Page. The page will receive ImageID as the ID of the Saved image as QueryString Parameter. Based on the QueryString Parameter, the page will retreive the image and write it to the Response. Refer the Code Below   C# [ImageCSharp.aspx]     protected void Page_Load(object sender, EventArgs ... [More]

Posted: Feb 21 2009, 03:39 by Mudassar Khan | Comments(19)RSS comment feed | Filed under : ADO.Net | C# | SQL Server | VB.Net

Send Email using CSharp

Namespaces The following Namespaces need to be imported in order to send emails using System.Net; using System.Net.Mail; MailMessage Class Properties Following are the required properties of the mail message class. From – Sender’s email address To – Recipient(s) Email Address CC – Carbon Copies BCC – Blind Carbon Copies Subject – Subject of the Email  Body – Body of the Email IsBodyHtml – Specify whether body contains text or HTML mark up. Attachments – Attachments if Any. ReplyTo – ReplyTo Email address. Creating a MailMessage Object MailMessage mm = new MailMessage(); mm.From = new MailAddress("username@gmail.com"); ... [More]

Posted: Feb 01 2009, 04:21 by Mudassar Khan | Comments(3)RSS comment feed | Filed under : C#














Community News





Web Hosting SpotLight


Consulting


For consulting and work related queries click here.



Advertise


Advertise with us. For more details click here.


Suggestions


Please provide your valuable suggesstions here.

This Site is hosted on

Lunarpages.com Web Hosting



Getting Started with ASP.NET Core and Entity Framework 6

This article will show you how to use Entity Framework 6 inside an ASP.NET Core application. Sections: Prerequisites Setup connection strings and dependency injection Migrate confi...


How Web Publishing In Visual Studio Works

The web publish experience for ASP.NET Core projects has significantly changed from ASP.NET 4. This doc will provide an overview of the changes and instructions on how to customize the publish proc...


Publishing to IIS

Sections: Supported operating systems IIS configuration Install the .NET Core Windows Server Hosting bundle Application configuration Deploy the application Configure the...


Model Validation

In this article: Sections Introduction to model validation Validation Attributes Model State Handling Model State Errors Manual validation Custom validation Client ...


Safe storage of app secrets during development

This document shows how you can use the Secret Manager tool to keep secrets out of your code. The most important point is you should never store passwords or other sensitive data in source code, an...


ASP.NET 4.5 and Visual Studio 2012

The .NET Framework 4.5 includes enhancements for ASP.NET 4.5. Visual Studio 2012 also includes enhancements and new features for improved web development. This document provides an overview of many...


ASP.NET Identity Tips (Video)

This video contains tips for securing your web app with ASP.NET Identity.


ASP.NET Identity: Two-Factor Authentication (Video)

This video explains how to use Two-Factor Authentication with ASP.NET Identity.


ASP.NET Identity (dotnetConf 2014)

ASP.NET Identity is a totally rewritten framework that brings the ASP.NET membership system into the modern era. ASP.NET Identity makes it easier to integrate different authentication systems such...


Azure Active Directory Video Series

This link opens the first in a series of videos about Azure Active Directory, presented by Scott Hanselman and the Microsoft program manager for Azure Active Directory, Vittorio Bertocci. The video...


Introduction to ASP.NET Identity (Video)

Follow the informative and entertaining team of Adam Tuliper and Jeremy Foster, as they explain everything you need to know to implement, extend, and customize ASP.NET Identity.


Globalization and localization

Rick Anderson , Damien Bowden , Bart Calixto , Nadeem Afana Creating a multilingual website with ASP.NET Core will allow your site to reach a wider audience. ASP.NET Core provides services an...


Using Angular for Single Page Applications (SPAs)

In this article, you will learn how to build a SPA-style ASP.NET application using AngularJS. Sections: What is AngularJS? Getting Started Key Components Angular 2.0 Summar...


Error Handling

When errors occur in your ASP.NET app, you can handle them in a variety of ways, as described in this article. Sections Configuring an Exception Handling Page Using the Developer Excep...


Using Cookie Middleware without ASP.NET Core Identity

ASP.NET Core provides cookie middleware which serializes a user principal into an encrypted cookie and then, on subsequent requests, validates the cookie, recreates the principal and assigns it ...


Logging

ASP.NET Core has built-in support for logging, and allows developers to easily leverage their preferred logging framework&#8217;s functionality as well. Implementing logging in your application req...


Working with Static Files

Static files, such as HTML, CSS, image, and JavaScript, are assets that an ASP.NET Core app can serve directly to clients. View or download sample code Sections Serving static files ...


Introduction to Identity

ASP.NET Core Identity is a membership system which allows you to add login functionality to your application. Users can create an account and login with a user name and password or they can use an ...


Managing Application State

In ASP.NET Core, application state can be managed in a variety of ways, depending on when and how the state is to be retrieved. This article provides a brief overview of several options, and focuse...


Claims-Based Authorization

When an identity is created it may be assigned one or more claims issued by a trusted party. A claim is key value pair, the key being the claim name and the value being the claim value. A claim is w...