Friday, November 14, 2008

Microsoft Most Valuable Professionals (MVPs)

Microsoft Most Valuable Professionals (MVPs) are exceptional technical community leaders from around the world who are awarded for voluntarily sharing their high quality, real world expertise in offline and online technical communities. Microsoft MVPs are a highly select group of experts that represents the technical community's best and brightest, and they share a deep commitment to community and a willingness to help others.
for more details about MVP plez follow this link
Read More

Wednesday, November 12, 2008

Unable to connect to the Asp.net development Server

Many of times developer of Asp.net face problem that when they run web application they got this error message "Unable to connect to the Asp.net development Server" and their application not run..so to solve such a problem.
Precaution Points:
- when you install microsoft .NET first or still u not got such a error.then first copy following files from this path and save it in a folder
so that when ever u get such error then just copy it and overwrite it on existing corrupt files
path : C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0
Files:
1.WebDev.WebServer.EXE
2.WebDev.WebServer.exe.manifest

Solution:
If you r already faceing this problem then go to your friend's home and copy these (WebDev.WebServer.EXE, WebDev.WebServer.exe.manifest)
files and paste on this path
path : C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0
because this file not contain user or system specific information so..u can copy and paste for any other system.
Read More

Saturday, November 8, 2008

What is new in ASP.NET 3.5


 
Microsoft released ASP.NET 3.5 on November 19, 2007. Along with it, was released Visual Studio 2008. This evolution from ASP.NET 2.0 to ASP.NET 3.5 is quiet gradual. ASP.NET 3.5 uses the same engine as that of ASP.NET 2.0, with some extra features added on top of it. In this article, we will explore the new features added to ASP.NET 3.5. This article assumes that you have been working on ASP.NET 2.0.
New Features in ASP.NET 3.5
 
ASP.NET AJAX
In ASP.NET 2.0, ASP.NET AJAX was used as an extension to it. You had to download the extensions and install it. However in ASP.NET 3.5, ASP.NET AJAX is integrated into the .NET Framework, thereby making the process of building cool user interfaces easier and intuitive.
The integration between webparts and the update panel is much smoother. Another noticeable feature is that you can now add ASP.NET AJAX Control Extenders to the toolbox in VS2008. Even though this is an IDE specific feature, however I feel it deserves a mention over here for developers, who had to add extenders using source view earlier. It is also worth noting that Windows Communication Foundation (WCF) now supports JSON along with other standard protocols like  SOAP, RSS and POX.
New Controls
The ListView and DataPager are new controls added along with a new datasource control called the LinqDataSource.
ListView
The ListView control is quiet flexible and contains features of the Gridview, Datagrid, Repeater and similar list controls available in ASP.NET 2.0. It provides the ability to insert, delete, page (using Data Pager), sort and edit data. However one feature of the ListView control that stands apart, is that it gives you a great amount of flexibility over the markup generated. So you have a complete control on how the data is to be displayed. You can now render your data without using the tag. You also get a rich set of templates with the ListView control.
DataPager
DataPager provides paging support to the ListView control. The best advantage is that you need not have to keep it ‘tied’ with the control on which the paging is being done. You can keep it anywhere on the page.
DataPager gives you a consistent way of paging with the controls that support it. Currently only ListView supports it as it implements the IPageableItemContainer. However support is likely to be added to other List controls as well.
LINQ
LINQ (Language Integrated Query) adds native data querying capability to C# and VB.NET along with the compiler and Intellisense support. LINQ is a component of .NET 3.5. LINQ defines operators that allow you to code your query in a consistent manner over databases, objects and XML.  The ASP.NET LinqDataSource control allows you to use LINQ to filter, order and group data before binding to the List controls.

ASP.NET Merge Tool
ASP.NET 3.5 includes a new merge tool (aspnet_merge.exe). This tool lets you combine and manage assemblies created by aspnet_compiler.exe. This tool was available earlier as an add-on.
New Assemblies
The new assemblies that would be of use to ASP.NET 3.5 developers are as follows:
·         System.Core.dll - Includes the implementation for LINQ to Objects
·         System.Data.Linq.dll - Includes the implementation for LINQ to SQL
·         System.Xml.Linq.dll - Includes the implementation for LINQ to XML
·         System.Data.DataSetExtensions.dll - Includes the implementation for LINQ to DataSet
·         System.Web.Extensions.dll: Includes the implementation for ASP.NET AJAX (new enhancements added) and new web controls as explained earlier.
Some Other Important Points
1.    ASP.NET 3.5 provides better support to IIS7. IIS7 and ASP.NET 3.5 modules and handlers support unified configuration.
2.    You can have multiple versions of ASP.NET on the same machine.
3.    For those who are wondering what happened to ASP.NET 3.0, well there isn’t anything called ASP.NET 3.0.
4.    VS 2002 worked with ASP.NET 1.0, VS 2003 worked with ASP.NET 1.1, and VS 2005 worked with ASP.NET 2.0. However VS 2008 supports multi-targeting, i.e it works with ASP.NET 2.0, and ASP.NET 3.5. 

if u want to know more about multi-targeting feature of visual studio...plez follow this link
http://weblogs.asp.net/scottgu/archive/2007/06/20/vs-2008-multi-targeting-support.aspx
Read More
What is new in ASP.NET 3.5
 
Microsoft released ASP.NET 3.5 on November 19, 2007. Along with it, was released Visual Studio 2008. This evolution from ASP.NET 2.0 to ASP.NET 3.5 is quiet gradual. ASP.NET 3.5 uses the same engine as that of ASP.NET 2.0, with some extra features added on top of it. In this article, we will explore the new features added to ASP.NET 3.5. This article assumes that you have been working on ASP.NET 2.0.
New Features in ASP.NET 3.5
 
ASP.NET AJAX
In ASP.NET 2.0, ASP.NET AJAX was used as an extension to it. You had to download the extensions and install it. However in ASP.NET 3.5, ASP.NET AJAX is integrated into the .NET Framework, thereby making the process of building cool user interfaces easier and intuitive.
The integration between webparts and the update panel is much smoother. Another noticeable feature is that you can now add ASP.NET AJAX Control Extenders to the toolbox in VS2008. Even though this is an IDE specific feature, however I feel it deserves a mention over here for developers, who had to add extenders using source view earlier. It is also worth noting that Windows Communication Foundation (WCF) now supports JSON along with other standard protocols like  SOAP, RSS and POX.
New Controls
The ListView and DataPager are new controls added along with a new datasource control called the LinqDataSource.
ListView
The ListView control is quiet flexible and contains features of the Gridview, Datagrid, Repeater and similar list controls available in ASP.NET 2.0. It provides the ability to insert, delete, page (using Data Pager), sort and edit data. However one feature of the ListView control that stands apart, is that it gives you a great amount of flexibility over the markup generated. So you have a complete control on how the data is to be displayed. You can now render your data without using the tag. You also get a rich set of templates with the ListView control.
DataPager
DataPager provides paging support to the ListView control. The best advantage is that you need not have to keep it ‘tied’ with the control on which the paging is being done. You can keep it anywhere on the page.
DataPager gives you a consistent way of paging with the controls that support it. Currently only ListView supports it as it implements the IPageableItemContainer. However support is likely to be added to other List controls as well.
LINQ
LINQ (Language Integrated Query) adds native data querying capability to C# and VB.NET along with the compiler and Intellisense support. LINQ is a component of .NET 3.5. LINQ defines operators that allow you to code your query in a consistent manner over databases, objects and XML.  The ASP.NET LinqDataSource control allows you to use LINQ to filter, order and group data before binding to the List controls.

ASP.NET Merge Tool
ASP.NET 3.5 includes a new merge tool (aspnet_merge.exe). This tool lets you combine and manage assemblies created by aspnet_compiler.exe. This tool was available earlier as an add-on.
New Assemblies
The new assemblies that would be of use to ASP.NET 3.5 developers are as follows:
·         System.Core.dll - Includes the implementation for LINQ to Objects
·         System.Data.Linq.dll - Includes the implementation for LINQ to SQL
·         System.Xml.Linq.dll - Includes the implementation for LINQ to XML
·         System.Data.DataSetExtensions.dll - Includes the implementation for LINQ to DataSet
·         System.Web.Extensions.dll: Includes the implementation for ASP.NET AJAX (new enhancements added) and new web controls as explained earlier.
Some Other Important Points
1.    ASP.NET 3.5 provides better support to IIS7. IIS7 and ASP.NET 3.5 modules and handlers support unified configuration.
2.    You can have multiple versions of ASP.NET on the same machine.
3.    For those who are wondering what happened to ASP.NET 3.0, well there isn’t anything called ASP.NET 3.0.
4.    VS 2002 worked with ASP.NET 1.0, VS 2003 worked with ASP.NET 1.1, and VS 2005 worked with ASP.NET 2.0. However VS 2008 supports multi-targeting, i.e it works with ASP.NET 2.0, and ASP.NET 3.5. 

if u want to know more about multi-targeting feature of visual studio...plez follow this link

Read More

Friday, November 7, 2008

Using Extension Methods

How often do you want to modify existing classes to have extra methods? Quite often. Right? When you have source code of the classes under consideration at your hand then things are easy. You probably just add the extra methods to those classes. What if you don't have source code? Well. In such cases one approach is to inherit the existing classes and add extra methods to the child classes. However, this way may not be always correct and possible in terms of your application design and OO principles. Luckily, C# offers a quick way to extend your class functionality through a feature known as Extension Methods. Extension methods allow you to extend existing types without inheriting them. This article is going to throw some light on this handy feature.

Let's try to undertand what extension methods are with an example.
Assume that you are developing a discussion forum application. The forum displays date and time at which posts and replies are made. The discussion will be used primarily in India and hence you wish to show these timestamps in Indian Standard Time (IST). However, your servers are hosted in some different geographical region (and hence date-time offset) and hence you must do some adjustment to display all the times in IST.

You then decide to get the IST using the following lines of code:

DateTime dt=DateTime.Now;
DateTime utc = dt.ToUniversalTime();
DateTime ist = utc.AddMinutes(330);

The above code calls ToUniversalTime() method of the DateTime structure that returns date and time in Universal Standard Time (earlier known as GMT). You then add 330 minutes (5 hrs. 30 min.) to the UTC and get IST. Though the code is simple enough and your team can call it wherever they need, won't it be nice if you can have this functionality to DateTime structure itself? That way all team members will find it convenient to quickly get the IST from a specified time. This is where we will use a C# extension method to get our job done.



Creating Extension Methods

Have a look carefully at the following class that defines two extension methods:

namespace Utils
{
public static class DateTimeHelper
{
  public static DateTime ToIST(this DateTime dt)
  {
    DateTime utc = dt.ToUniversalTime();
    return utc.AddMinutes(330);
  }

  public static bool IsDate(this string s)
  {
    DateTime dt;
    return DateTime.TryParse(s, out dt);
  }
}
}


The above code defines a static class named DateTimeHelper. All the extension methods must reside inside a static class. The extension methods themselves must be static (In fact that is why compiler forces you to declare the class as static).

The ToIST() static method is an extension method that returns a DateTime instance. Observe how the parameter of the method is specified. An extension method can have any number of parameters but the first parameter indicates the data type to which that extension is applicable. In case of ToIST() method we specify that this method is an extension method of DateTime structure. The ToIST() method simply adjusts the date and time with required offset.

The IsDate() method is another extension method that will be applicable to string data type. Inside it checks if the supplied string is a valid date and returns a Boolean value.

Now, if you use DateTime structure then the Visual Studio will show you ToIST() method in the IntelliSense. Similarly, IsDate() method will be shown for string class.



More about extension methods

Though extension methods allow you to quickly extend an existing type this feature should not be used extensively as a replacement to other elegant approaches. Additionally, the following points about extension methods are worth noting.

Extension methods can chain themselves. For example you may write something like this:
dt.ToIST().ToDDMMYYYY()
The ToIST() and ToDDMMYYYY() are assumed to be extension methods.
Extension methods can be accessed only when its namespace is in scope
If an extension method has the same signature as any of the instance method of the class it extends then the instance methods take precedence
If two extension methods of a type have same signature them they must be called like normal static methods. For example, if you define two extension methods with same name and signature in two classes say DateTimeHelper1 and dateTimeHelper2, then they can be called  like this - DateTimeHelper1.ToIST(dt)
That's it! Will be back with something interesting. Till then keep coding!
Read More

Thursday, November 6, 2008

RSS (How to use RSS in ASP.NET)

RSS stands for (Really Simple Syndication). Basically RSS feeds are xml files which are provided by many websites so you can view their contents on your own websites rather than browsing their site. Suppose you are a movie lover and you want to get the list of top 5 movies from 10 websites. One way will be to visit all 10 websites and see the top 5 list. This method though is used in general by lot of people but its quite tiring method. It will take you 10-15 minutes to browse all the websites and see the top 5 list of movies. One easy way will be if those movie websites provides RSS feeds to be used by the users. If they provide RSS feeds you can embed them in your page and now you don't have to browse all the websites since the information is available on a single page. Hence, this saves you a time and a lot of browsing.

Most of the Blogs websites provide RSS feeds so you can embed your or someone's else latest entries of blog on your website. In this article we will see how we can embed RSS feeds to our webform using Asp.net.

create a gridview and a button on page and write following code...u will be able to access RSS of MSDN

you can replace this link with any other link of RSS of any other site...
just go to site and click on RSS link then that link will take u to a xml file for that RSS then copy that address and paste in XmlTextReader (  ...link) code.

using System.Xml;

protected void Button1_Click(object sender, EventArgs e)
    {
  XmlTextReader reader = new XmlTextReader("http://www.microsoft.com/feeds/MSDN/en-gb/rss.xml");  //this is address of RSS xml file
        DataSet ds = new DataSet();
        ds.ReadXml(reader);
        GridView1.DataSource = ds.Tables[2];
        GridView1.DataBind();
}
Read More
Powered By Blogger · Designed By Seo Blogger Templates