Browsing all articles from February, 2010
Feb
23

To create directory on application server with ASP.NET server side code

Here is the code to creating the directory at application with ASP.NET

using System;
using System.Data;
using System.Configuration;
// We  need this namespace to create directory
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void  Page_Load(object sender, EventArgs e)
{
string NewDir = Server.MapPath("New  Folder");
// Call function for creating a directory
MakeDirectoryIfExists(NewDir);
}
private void  MakeDirectoryIfExists(string NewDirectory)
{
try
{
// Check if directory exists
if (!Directory.Exists(NewDirectory))
{
// Create the directory.
Directory.CreateDirectory(NewDirectory);
}
}
catch (IOException  _ex)
{
Response.Write(_ex.Message);
}
}
}
Feb
22

Gridview custom paging in asp.net 3.5 with SQL Server Sproc

GridView — Displays a set of data items in an HTML table. ASP.NET GridView control enables you to display, sort, page, select, and edit data.

Default gridview paging works best when you deal with limited pages. If there are more pages then, the performance suffers. In this case direct jump to desire page is a good alternative.

I have deal with a problem on GridView while working on user control (.ascx). I have a user control (.ascx) with GridView in it. I have used Stored Procedure to retrieve data. Bounding data to gridview display all the records and Default paging setting not work for me. Here Custom Paging helps me and only those database records that need to be displayed get retrieved. Using GridView Custom Paging solve the Issue for me.

Here, I am going to demonstrate a sample on GridView Custom Paging. I want to display records from two different tables depending on search pattern, let’s consider, I have student table contain sName, sAddress, ClassId and class table contain classId and ClassName. Now I want to display Name, Address and ClassName based on string pattern. Here I will get Ramdom Records based on search pattern. In this example we are going to use ASP.Net DropDownList along with ASP.Net GridView for Pagination to provide Jump To Page Number facility to the user.

read more

Feb
20

New Features in the .NET Framework version 3.5

Microsoft released ASP.NET 3.5 on November 19, 2007. Along with it, was released Visual Studio 2008. In this version Microsoft enhanced features of .NET Framework Version 3.0 and add some new too. Now we will take a look at new and enhanced features in the .NET Framework version 3.5. The which get updated or added by Microsoft are:

  • .NET Compact Framework
  • ASP.NET
  • Add-Ins and Extensibility
  • Common Language Runtime
  • Cryptography
  • Networking
  • Windows Communication Foundation
  • Windows Presentation Foundation
  • Windows Workflow Foundation
  • Windows Forms
  • LINQ
  • Expression Trees
  • Programming Languages
Follow us on Twitter! Follow us on Twitter!
FoxSparrow Tweets

Categories