Skip to main content

Posts

Showing posts from April, 2011

Display parent child data in GridView using usercontrol

In this post I am going to show how to display parent child data in gridview using usercontrol.




Open Visual studio and create a new websiteRight click on App_Code folder ,and add new class named Customer and add following code
using System; using System.Collections.Generic; using System.Linq; using System.Web; publicclass Customer {     public Customer()     {             }     public Customer(int id, string name)     {         this.CustomerID = id;         this.CustomerName = name;         PhoneList = new List<PhoneNumber>();     }     publicint CustomerID { get; set; }     publicstring CustomerName { get; set; }     public List<PhoneNumber> PhoneList { get; set; } } Right click on App_Code folder and add a new class PhoneNumber and add following code into it
using System; using System.Collections.Generic; using System.Linq; using System.Text; publicclass PhoneNumber {     publicint ID { get; set; }     publicstring Number { get; set; }     public PhoneNumber()     {  …

How to download file asynchronously from webserver in asp.net

In this post I am going to show how to download file asynchronously from server using asp.net.
 Open Visual Studio and create a new WebApplication or WebSite Open Default.aspx page and paste following code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"     Async="true" %><htmlxmlns="http://www.w3.org/1999/xhtml"><headid="Head1"runat="server"><title></title><scriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> </head> <body>     <script type="text/javascript">         function WaitProgress() {             $("#Indicator").text("please wait...");         }         function FinishProgress(contentState) {             $("#Indicator").text(contentState);         }     </script><formid="form1"runat="server&q…