If you read a lot of industry magazines and ASP.NET code samples, you may find that, although the majority use Response.Redirect to send the user to another page, some seem to prefer the rather mysterious-sounding Server.Transfer. So, what's the difference?
Well, Response.Redirect simply sends a message down to the browser, telling it to move to another page. So, you may run code like:
Response.Redirect("WebForm2.aspx")
or...>
Read more...
2/26/2008 9:33:30 PM
Published by
FengLiN
Category
ASP.NET
Views (635)
Recently, a friend mentioned that someone had told him that writing a try...catch block in C# (or substitute some other .Net language here) resulted in a " huge penalty " in terms of performance compared to if you had not written it. That is, merely writing such a block actually hurt program performance, even if an exception was never thrown. He didn't believe this was true, and rightly so - it's completely wrong. This post is a tidied up...>
Read more...
2/25/2008 12:55:59 AM
Published by
FengLiN
Category
C Sharp(C#)
Views (624)
Have you ever seen a file with a pretty icon you wanted to use but you couldn't get a similar one in your program? If yes, try this method >> Icon.ExtractAssociatedIcon here is the code I wrote that works fine, you will also find the sample attached Icon ico; public Form1() { InitializeComponent(); ico = this.Icon; } private void btnGetIcon_Click(object sender, EventArgs e) { if(dlgOpen.ShowDialog() ==...>
Read more...
2/25/2008 12:47:00 AM
Published by
FengLiN
Category
C Sharp(C#)
Views (673)
In this article, I will cover at a glance the new features of C# 3.0. I have been working with this new development environment for several days and want to share my experience with you Implicit typed local variables Local variables can be declared as type var, whose actual type of the variable is determined by the compiler based on the data schema (see Listing 1). It's mainly used to store anonymous types in LINQ. ...>
Read more...
2/13/2008 10:26:00 PM
Published by
FengLiN
Category
C Sharp(C#)
Views (707)
This guide covers Microsoft's recommended approach for implementing performance testing for Web applications. These provide steps for managing and conducting performance testing. For simplification and tangible results, they are broken down into activities with inputs, outputs, and steps. You can use the steps as a baseline or to help you evolve your own process. The performance-testing approach used in this guide consists of the following activities...>
Read more...
2/13/2008 9:02:10 AM
Published by
FengLiN
Category
ASP.NET
Views (674)
We all know the term compilation in Asp.Net. But do you know what is the order of compilation in an asp.net project. Do you know which folder in the application structure gets compiled first and which when get compiled last?
Here is the compilation life cycle of an Asp.Net project in the order they get compiled.
App_GlobalResources: First of all the global resources are compiled and the resource assembly is built. All the assembly's in...>
Read more...
2/5/2008 10:54:23 PM
Published by
FengLiN
Category
ASP.NET
Views (771)
1. using + namespace:
So you can use the type under the namespace directly, without type in the full namespace name. similar with Jave's Import.
Example: using System.Data;
2. using + Alias Name = full type name.
when to use: You can use this when you using 2 different namespaces in 1 cs file. but these 2 different namespaces contains a type with same name.
example:
using aClass = NameSpace1.MyClass;
using bClass = NameSpace2.MyClass;...>
Read more...
2/5/2008 3:51:23 AM
Published by
FengLiN
Category
C Sharp(C#)
Views (768)