Home » Archive

Articles in the ASP.Net Category

ASP.Net, GridView Tips, Tech Corner »

[1 Dec 2009 | No Comment | Posted By:Vivek]

Binding Images to a Gridview has been explained in this article. For this , first start a new application with ASP.NET and drop a GridView control onto the aspx page.Now add a new template Column to the GridView.In addition,if you want to display anything else, add bound fields or template fields according to your needs.In here, i have used a bound fied to display the image Id and the template field to display the Image.Now In the template field,add an Image control as the item template.For this just click on …

Read the full Post »

ASP.Net, C# Codes, Tech Corner »

[27 Oct 2009 | No Comment | Posted By:Vivek]

Here i will explain the binding of a treeview from the Database.This can be a tricky task since we may have to build a parent-child relationship here.So first thing you would need is a table in the database where we actually have the parent-child relationship.
An Example
Table Name: Category
CategoryId  INT
CategoryName  Varchar(50)
ParentCategoryId INT
NodeLevel  INT
Suppose we have Data in the Table named Category as follows

1
Root
NULL
0

2
Child
1
1

3
Child2
1
1

4
grandChild
2
2

5
grandChild2
2
2

6
grandChild3
3
2

//

Now to bind this to the tree,we will use a recursive function.Also for better performance,we will bind the database results into a global DataTable first and then apply filtering.
Here is the Code …

Read the full Post »

ASP.Net, Tech Corner »

[21 Oct 2009 | No Comment | Posted By:Vivek]

This is a very common error that is encountered.This is because Response.End ends the Page Execution and transfers the execution to Application_EndRequest event and the line following the Response.End is not executed.
This problem occurs for the Response.Redirect method also as when this method is used, an internal call to Response.End is made.
//

How to resolve it?
Instead of Response.End,use HttpContext.Current.ApplicationInstance.CompleteRequest method.
For Response.Redirect,set the endResponse parameter in the method to false.It indicates that the execution of the current page should not terminate.
Eg:

Response.Redirect(”~/Default.aspx”,false);
This error also happens when Server.Transfer method is called.Just use Server.Execute …

Read the full Post »

ASP.Net, Tech Corner »

[20 Oct 2009 | No Comment | Posted By:Vivek]

THe Visual Studio 2010 Beta and the .Net Framework 4.0 were launched by Microsoft Corporation this week.With the launch comes many new features that will sure take applicatipn and web development to new heights.The basic structure still quite remains the same but still the product does come with many new exciting features.The changes have come mainly in the core services,Ajax,Web Forms etc.
//

The core services like Output caching and session state storage makes a significant improvement.One of these is the Web.Configminification.The introduction of new features meant that the web.config was …

Read the full Post »

ASP.Net, Tech Corner »

[19 Oct 2009 | No Comment | Posted By:Vivek]

Now that we have learnt some basic stuff about about what web services are  and how they communicate,lets build our first webservice using Visual Studio.I have done this in VS 2008.
First Step: Open Visual Studio.Click on File and then select “New WebSite”.From the Next Window that appears,click ASP>NET Web Service.Select your language and then click OK.
By Default,VS 2008 will automatically create your first WebService “Hello World”.Notice that the Class inherits the System.Web.Services.WebService Class.
public class Service : System.Web.Services.WebService
Also,before the method “Hello World”,a [WebMethod] attributed has been specified.This basically tells the compiller …

Read the full Post »