Dec 7, 2012

How to fix Column of Gridview or scrollable grid in Asp.net


Jquery plugin js file for scrollable grid



=========================================================
1. ScrollableGridPlugin.js


(function ($) {
    $.fn.Scrollable = function (options) {
        var defaults = {
            ScrollHeight: 300,
            Width: 0
        };
        var options = $.extend(defaults, options);
        return this.each(function () {
            var grid = $(this).get(0);
            var gridWidth = grid.offsetWidth;
            var gridHeight = grid.offsetHeight;
            var headerCellWidths = new Array();
            for (var i = 0; i < grid.getElementsByTagName("TH").length; i++) {
                headerCellWidths[i] = grid.getElementsByTagName("TH")[i].offsetWidth;
            }
            grid.parentNode.appendChild(document.createElement("div"));
            var parentDiv = grid.parentNode;

            var table = document.createElement("table");
            for (i = 0; i < grid.attributes.length; i++) {
                if (grid.attributes[i].specified && grid.attributes[i].name != "id") {
                    table.setAttribute(grid.attributes[i].name, grid.attributes[i].value);
                }
            }
            table.style.cssText = grid.style.cssText;
            table.style.width = gridWidth + "px";
            table.appendChild(document.createElement("tbody"));
            table.getElementsByTagName("tbody")[0].appendChild(grid.getElementsByTagName("TR")[0]);
            var cells = table.getElementsByTagName("TH");

            var gridRow = grid.getElementsByTagName("TR")[0];
            for (var i = 0; i < cells.length; i++) {
                var width;
                if (headerCellWidths[i] > gridRow.getElementsByTagName("TD")[i].offsetWidth) {
                    width = headerCellWidths[i];
                }
                else {
                    width = gridRow.getElementsByTagName("TD")[i].offsetWidth;
                }
                cells[i].style.width = parseInt(width - 3) + "px";
                gridRow.getElementsByTagName("TD")[i].style.width = parseInt(width - 3) + "px";
            }
            parentDiv.removeChild(grid);

            var dummyHeader = document.createElement("div");
            dummyHeader.appendChild(table);
            parentDiv.appendChild(dummyHeader);
            if (options.Width > 0) {
                gridWidth = options.Width;
            }
            var scrollableDiv = document.createElement("div");
            if (parseInt(gridHeight) > options.ScrollHeight) {
                gridWidth = parseInt(gridWidth) + 17;
            }
            scrollableDiv.style.cssText = "overflow:auto;height:" + options.ScrollHeight + "px;width:" + gridWidth + "px";
            scrollableDiv.appendChild(grid);
            parentDiv.appendChild(scrollableDiv);
        });
    };
})(jQuery);


=========================================================
2. Default page with GridView

 <script src="../App_Themes/Theme1/ScrollableGridPlugin.js" type="text/javascript"></script>

 <script type="text/javascript" language="javascript">
    
     $(document).ready(function () {
        $('#<%=gridview1.ClientID %>').Scrollable({
            ScrollHeight: 300
        });
    });

</script>
=========================================================

Nov 26, 2012

My Login Page

I have create login page by altering in PSD file 


-------------------------------------

Nov 20, 2012

How To do Shopping CART In asp.net

There are some links i found on internet for shopping cart website.

http://www.codeproject.com/Articles/17674/GridView-Order-Page-Shopping-Cart-Page-ASP-NET-SQL

http://net.tutsplus.com/tutorials/other/build-a-shopping-cart-in-aspnet/

(free and open source shopping cart )
http://www.nopcommerce.com/default.aspx



( some helpfull code )
http://howtouseasp.net/how-to-do-shopping-cart-in-asp-net-c/

http://www.codeproject.com/Tips/403267/ShoppingCart-using-Gridview-in-ASP-NET

http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=423

http://my.safaribooksonline.com/book/web-development/microsoft-aspdotnet/0957921861/building-an-aspdotnet-shopping-cart/aspnet-chp-12

( download ER-Diagrams of Ecommerce website )
http://www.uml-diagrams.org/examples/online-shopping-example.html

(Download Sample)
http://csharpdotnetfreak.blogspot.com/2009/05/aspnet-creating-shopping-cart-example.html

http://www.aboutmydot.net/web-development/shopping-cart-in-aspnet.html

( LIVE  DEMO )
http://www.dotnetcart.com/livedemo.htm

( Demo and Source code)
http://www.znode.com/asp-net-shopping-cart-source-code.aspx

(Sample and Source code)
http://www.codeproject.com/Articles/3765/Easy-ASP-NET-Shopping-Cart

(sample and source code )
http://www.c-sharpcorner.com/UploadFile/ShrutiShrivastava/ASPNetShoppingCart11262005063508AM/ASPNetShoppingCart.aspx


(Sample , source code and link )
http://www.c-sharpcorner.com/forums/thread/160928/developing-a-shopping-cart-in-asp-net.aspx

(download source sample )
http://www.aspfree.com/c/a/c-sharp/creating-an-online-shopping-cart-and-paypal-system/

(Nope commerce free open source)
http://www.nopcommerce.com/default.aspx

Show HTML REPORT in asp.net



------------------------------------------------------------------------------------------------------------

Nov 17, 2012

pivot tables in sql server tutorial

Click on below link

http://www.kodyaz.com/articles/t-sql-pivot-tables-in-sql-server-tutorial-with-examples.aspx

Jun 27, 2012

How to Search Duplicate Records in SQL



SELECT catrefcode, COUNT(*) TotalCount
FROM importedcatref
GROUP BY catrefcode
HAVING COUNT(*) > 1
ORDER BY COUNT(*) DESC


Jun 8, 2012

Handle Error on Web.Config file.

I prefer to use a generic error page, and redirect from there :

<system.web>
<customErrors mode="On" defaultRedirect="Errors.aspx"/>
</system.web>

And, in errors.aspx :

errors.aspx
-----------------
<html>
<script language="VB" runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 
MyBase.Load
Dim errMessage As String = ""
Dim appException As System.Exception = Server.GetLastError()
If (TypeOf (appException) Is HttpException) Then
Dim checkException As HttpException = CType(appException, HttpException)
Select Case checkException.GetHttpCode
Case 400
errMessage &= "Bad request. The file size is too large."
Case 401
errMessage &= "You are not authorized to view this page."
Case 403
errMessage &= "You are not allowed to view that page."
Case 404
errMessage &= "The page you have requested can't be found."
Case 408
errMessage &= "The request has timed out."
Case 500
errMessage &= "The server can't fulfill your request."
Case Else
errMessage &= "The server has experienced an error."
End Select
Else
errMessage &= "The following error occurred<BR>" & appException.ToString
End If
ErrorMessage.Text = errMessage & "<BR>We're sorry for the inconvenience."
Server.ClearError()
End Sub
</script>
<body>
<hr>
<asp:label id="ErrorMessage" font-size="12" font-bold="true" runat=server/>
<hr>
<p>Return to <a href=http://yourserver.com/>our entry page</a>
</body>
</html>
---------------



May 11, 2012

how to Set Character Limit for TextArea and TextBox

This script allows you to set a limit on the number of characters a user can enter into a textarea or text field, like so:
Step 1 - Create Function

Insert the following code into the page head:
<script language="javascript" type="text/javascript">
if (limitField.value.length > limitNum) 
        {
            
            limitField.value = limitField.value.substring(0, limitNum);
            limitCount.value = limitNum - limitField.value.length;
        }
        else 
        {
            limitCount.value = limitNum - limitField.value.length;
        }
}
</script>

Step 2 - For Text Area

Use the following code to create the form and text area (if necessary, change the name of the form and text area to suit your needs):
<form name="myform">
<textarea name="limitedtextarea" onKeyDown="limitText(this,countdown,100);" 
onKeyUp="limitText(this,countdown,100);">
</textarea><br>
<font size="1">(Maximum characters: 100)<br>
You have <input readonly type="text" name="countdown" size="3" value="100"> characters left.</font>
</form>

Step 2 - For Text Box

<form name="myform">
<input name="limitedtextfield" type="text" onKeyDown="limitText(this,countdown,15);" 
onKeyUp="limitText(this.form.limitedtextfield,this.form.countdown,15);" maxlength="15"><br>
<font size="1">(Maximum characters: 15)<br>
You have <input readonly type="text" name="countdown" size="3" value="15"> characters left.</font>
</form>

May 4, 2012

Simple Crystal reports In ASP.net


 Dim ObjDb As New DBAccess

    Dim objRptDoc As New ReportDocument
    Dim myDiscreteValue As New ParameterDiscreteValue

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        FunGenerateReport()

    End Sub
    Protected Sub FunGenerateReport()
        Dim strRptFile As String
        strRptFile = Server.MapPath("rptFaapBudget.rpt")
        objRptDoc.Load(strRptFile)


        objRptDoc.SetDatabaseLogon("MyUserName", "PWD", "192.168.1.192", ObjDb.GetConnection().Database.ToString())

        myDiscreteValue = New ParameterDiscreteValue
        myDiscreteValue.Value = Convert.ToString(Request.QueryString("strYear"))
        objRptDoc.ParameterFields("@finYear").CurrentValues.Add(myDiscreteValue)

        myDiscreteValue = New ParameterDiscreteValue
        myDiscreteValue.Value = Convert.ToString(Request.QueryString("strCompCode"))
        objRptDoc.ParameterFields("@CompCode").CurrentValues.Add(myDiscreteValue)

        CrystalReportViewer1.ReportSource = objRptDoc
        CrystalReportViewer1.HasExportButton = True
        'CrystalReportViewer1.HasToggleGroupTreeButton = False

    End Sub

Apr 28, 2012

How to show fileupload on apple browser

Recently i was facing problem in fileupload on ipad or Apple OS , i searched a lot on the net., but did not get any solution. The only answer which i got was that Apple file System doesn't allow access to fileupload control.

So finally i checked my asp.net Web Application on apple's macbook and it's supports and allow to upload files.


During the search i found that may be usefull link for file upload on iPhone.

http://picupapp.com/scratchpad.html
http://asp.net.bigresource.com/Mobiles-upload-file-not-working-for-IPad-IPhone--mbuXPbNLH.html

----------------------------------------------------------------------------------

Apr 17, 2012

Simply Hide and show in javascript








Use below images ..




====================== ASPX Script =======================



<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">

    <table style="width: 308px; background-color: cadetblue">
        <tr>
            <td style="height: 30px">
                <img id="img1" src="Images/gvCollapsedButton.png" onClick="return Fun1();" />
                <asp:Label  ID="Button1" runat="server" Text="click on me to Expand / Collapse" OnClientClick="return Fun1();" /></td>
        </tr>
        <tr>
            <td>
     
     
    <div id ="MyDiv" style="background-color: #ccffff; width: 300px; height: 59px; display: none;">
        <br />
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UserName : &nbsp;
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></div>
            </td>
        </tr>
    </table>


</form>
</body>


<script type="text/javascript" language="javascript" >

// global variable
var status= "close";


// ============== Script to hide and show ....
function Fun1()
{
    if (status=="close")
    {
        document.getElementById("MyDiv").style.display = 'block';
        document.getElementById("img1").src= 'Images/gvExpandedButton.png';
        status="open";
    }
    else
    {      
        document.getElementById("MyDiv").style.display = 'none';
         document.getElementById("img1").src= 'Images/gvCollapsedButton.png';
        status="close";
    }
 
    return false;  
}

//=====================
</script>

</html>
==============================================================


Apr 2, 2012

Show Images dynamically in asp.net


<asp:sqlDataSource ID="ImgSqlDataSource" SelectCommand="SELECT imageName, 
imageUrl FROM tblImages" />

<asp:Repeater id="cdcatalog" runat="server">
    <HeaderTemplate>
        <table>
    </HeaderTemplate>
    <ItemTemplate>
        <tr>
            <td><img src="<%#Container.DataItem("imageUrl")%>" /></td>
        </tr>
        <tr>
             <td><%#Container.DataItem("imageUrl")%></td>
        </tr>
    </ItemTemplate>
    <FooterTemplate>
        </table>
    </FooterTemplate>
</asp:Repeater>

============================
IN Source Code PAge...

onPageLoad provide ImgSqlDataSource to the repeter Control.

Mar 10, 2012

VistaDB is an Embedded SQL Database Engine for .Net

VistaDB is the only .Net embedded database that allows you to Xcopy a single DLL for both 32 and 64 bit runtime support.  Want ClickOnce deployment for your .Net application?  VistaDB requires zero config on the client.  No more worries about COM deployment for the database engine!  Even our database files are built for ease of deployment - a single database file with no external logs or complex permissions.

No need to bother your hosting provider for special access, no services to run.



Full integration within Visual Studio Standard or Higher



Work with Visual Studio 2008 and 2010


VistaDB has full Visual Studio integration giving you the familiar tools you need to be productive quickly, including full Server Explorer integration.   Developers who have used other desktop databases in Visual Studio will be able to immediately start working with VistaDB.

Feb 13, 2012

Add Row Number in Query

SELECT ROW_NUMBER () OVER ( ORDER BY com_code )
       ,*
FROM   Mcompany

How to add Nested repeter controls and create Dynamic own view template



===================== Design Page ==========================

 <TABLE style="WIDTH: 500px"><TBODY><TR><TD align=left><DIV align=center><asp:Label id="lblMsg" runat="server" SkinID="msgerror"></asp:Label> </DIV></TD></TR><TR><TD align=left></TD></TR><TR><TD colSpan=2><DIV style="DISPLAY: none" id="grid"><asp:Repeater id="parentRepeater" runat="server" __designer:dtid="3377699720527899" __designer:wfdid="w1">
                                        <ItemTemplate __designer:dtid="3377699720527900">
                                            <table style="border-right: #66cc66 1px solid; border-top: #66cc66 1px solid; border-left: #66cc66 1px solid;
                                    border-bottom: #66cc66 1px solid" cellspacing="0" cellpadding="0" width="100%">
                                            <tr __designer:dtid="3377699720527901"  class="collapsible-item">

                                                <td __designer:dtid="3377699720527902" class="collapsible-item-title" align="left" colspan="4" style="border-right: gainsboro 2px solid;
                                                    border-top: gainsboro 2px solid; border-left: gainsboro 2px solid; border-bottom: gainsboro 2px solid;
                                                    color: #0190D0; font-family: Verdana; font-size: 8.5pt; font-weight: bold; height: 20px;
                                                    background-color: gainsboro;">                                                 
                                                 
                                                    <div class="item-title-header">  </div> &nbsp;
                                                    <img src="../../App_Themes/images/gvCollapsedButton.png" alt="Expand this section" class="toggle-button">
                                                      
                                                         <b>&nbsp; &nbsp;
                                                              <asp:Hyperlink runat= "server" ForeColor="#0190D0" Text='<%# DataBinder.Eval(Container.DataItem,"vProductName").tostring%>'
                                                              NavigateUrl='<%# "FrmMarketCompet.aspx?ProjectID=" & DataBinder.Eval (Container.DataItem,"nProjectId").tostring & _
                                                              "&ProductID=" & DataBinder.Eval(Container.DataItem,"nMarketProdId").tostring %>' ID="ProductName" ToolTip="Click to see products details."/>
                                                        </b>
                                                 
                                                  
                                                 
                                                </td>
                                            </tr>
                                            <tr style="display: none;" class="togglethis">
                                            <td>
                                            <asp:Repeater __designer:dtid="3377699720527904" ID="childRepeater" runat="server"
                                                DataSource='<%# Container.DataItem.Row.GetChildRows("myrelation") %>'>
                                                <ItemTemplate __designer:dtid="3377699720527905">
                                                                 <TABLE style="WIDTH: 100%;BORDER-BOTTOM: lightgrey 1px solid; font-family: Verdana; font-size: 8pt;" cellSpacing=0 cellPadding=3><TBODY>
                                                                 <TR>
                                                                 <TD><asp:Label id="LblYear" runat="server" Text='<%#Container.DataItem("vMarketProdYear") %>' SkinID="Heading" Width="150px"></asp:Label></TD>
                                                                 <TD style="BORDER-LEFT: lightgrey 1px solid" align=center><asp:Label id="Label1" runat="server" Text="Market " SkinID="Heading"></asp:Label></TD>
                                                                 <TD style="BORDER-LEFT: lightgrey 1px solid; BORDER-BOTTOM: lightgrey 1px solid" align=right><asp:Label id="Label7" runat="server" Text="Qty :" SkinID="Heading"></asp:Label></TD>
                                                                 <TD><asp:Label style="TEXT-ALIGN: right" width="80px" id="txtMarketQty"  runat="server" Text='<%#Container.DataItem("fMarketQty") %>'></asp:Label></TD>
                                                                 </TR>
                                                                 <TR>
                                                                 <TD></TD>
                                                                 <TD style="BORDER-LEFT: lightgrey 1px solid; BORDER-BOTTOM: lightgrey 1px solid" align=right></TD>
                                                                 <TD style="BORDER-LEFT: lightgrey 1px solid; BORDER-BOTTOM: lightgrey 1px solid" align=right><asp:Label id="Label4" runat="server" Text="Value :" SkinID="Heading"></asp:Label></TD>
                                                                 <TD style="BORDER-BOTTOM: lightgrey 1px solid"><asp:Label style="TEXT-ALIGN: right" id="txtMarketValue"  width="80px" runat="server" Text='<%#Container.DataItem("fMarketValue") %>'></asp:Label></TD>
                                                                 </TR>
                                                                 <TR>
                                                                 <TD ></TD>
                                                                 <TD style="BORDER-LEFT: lightgrey 1px solid" align=center><asp:Label id="Label8" runat="server" Text="CGL Share" SkinID="Heading" Width="78px"></asp:Label></TD>
                                                                 <TD style="BORDER-LEFT: lightgrey 1px solid; BORDER-BOTTOM: lightgrey 1px solid" align=right><asp:Label id="Label6" runat="server" Text="Value :" SkinID="Heading" Width="80px"></asp:Label></TD>
                                                                 <TD><asp:Label  style="TEXT-ALIGN: right" id="TxtCglValue"  width="80px" runat="server"  Text='<%#Container.DataItem("fCGValue") %>'></asp:Label></TD>
                                                                 </TR>
                                                                 <TR>
                                                                 <TD style="BORDER-BOTTOM: lightgrey 1px solid;"></TD>
                                                                 <TD style="BORDER-LEFT: lightgrey 1px solid; BORDER-BOTTOM: lightgrey 1px solid" align=right></TD>
                                                                 <TD style="BORDER-LEFT: lightgrey 1px solid; BORDER-BOTTOM: lightgrey 1px solid" align=right><asp:Label id="Label5" runat="server" Text="% :" SkinID="Heading"></asp:Label></TD>
                                                                 <TD style="BORDER-BOTTOM: lightgrey 1px solid;"><asp:Label style="TEXT-ALIGN: right" id="txtCGLPercent"  width="80px" runat="server" Text='<%#Container.DataItem("fCGPercentage") %>'></asp:Label></TD>
                                                                 </TR></TBODY>
                                                                 </TABLE>                                         
                                                   
                                                    
                                                
                                                </ItemTemplate>
                                            </asp:Repeater>
                                              </td>
                                              </tr>
                                              </table>
                                        </ItemTemplate>
                                    </asp:Repeater> </DIV></TD></TR><TR><TD align=center colSpan=2><asp:Button accessKey="s" id="btnAddnew" tabIndex=11 onclick="btnAddnew_Click" runat="server" Text="Add New" ToolTip="Add New"></asp:Button>&nbsp;<asp:Button id="BtnContinue" onclick="BtnContinue_Click" runat="server" Text="Continue" __designer:wfdid="w2"></asp:Button></TD></TR></TBODY>
                                  
                                    </TABLE>



 <script language="text/javascript" src="../../Common/jquery-1.6.2.min.js" type="text/javascript"></script>

    <script type="text/javascript">
    $(document).ready(function () {

    $.fn.toggleTo = function( options ) {
        options = $.extend( options, {
        containerClass:'collapsible-item',
        speed:'slow',
        collapse:'../../App_Themes/images/gvExpandedButton.png',
        expand:'../../App_Themes/images/gvCollapsedButton.png',
        toggleClass:'togglethis'
        });

        return this.each(function() {

        var p = $(this).closest('.' + options.containerClass);

        $(this).toggle(function() {
            $(p).find('.toggle-button').attr('src', options.collapse);
            $(p).next('.' + options.toggleClass).slideToggle('slow');
        }, function() {
            $(p).find('.toggle-button').attr('src', options.expand);
            $(p).next('.' + options.toggleClass).slideToggle('slow');
        });
        });
    }

    $('.item-title-header, .toggle-button').toggleTo();
   });




function pageLoad(sender, args)
{
    if (args.get_isPartialLoad())
    {
        //alert('Ajax call');
     
        $("#grid").show("fast");
        $(".Child").hide("fast");
       
    }
    else
    {
        //alert('PostBack or initial load');
    
        $("#grid").show("fast");
        $(".Child").hide("fast");
      
    }
}




function HideAll(obj)
{
    //alert('call');
   
    var obj2=obj.parentElement.children(1);
    $(obj2).slideToggle("slow");
  
    //$("#A").animate({width: "200px" , height: "10px"}, "200");  
}



    </script>
======================= Code Behind ===========================


 Private Sub GetBusEvaGrid()
        Try

     Dim ds As DataSet = objProd.GetAllProducts(HiddenProjectId.Value)
            ds.Relations.Add("myrelation", ds.Tables(0).Columns("nMarketProdId"), ds.Tables(1).Columns("nMarketProdId"))
            parentRepeater.DataSource = ds.Tables(0)
            parentRepeater.DataBind()


        Catch ex As Exception

        End Try



' SAVE Code

Protected Sub BtnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Try


            lblMsg.Text = ""

            If Session("Userid") = Nothing Or Session("Userid") = "" Then
                lblMsg.Text = "login user id not found"
                Return
            End If

            If Not HiddenProjID.Value = "" And Not HiddenPreqDetailsID.Value = "" Then
                For i As Integer = 0 To parentRepeater.Items.Count - 1
                    ObjBusEva.ProjectID = Int32.Parse(HiddenProjID.Value)
                    ObjBusEva.PreqDetailsID = Int32.Parse(HiddenPreqDetailsID.Value)

                    Dim ChildRep As Repeater = TryCast(parentRepeater.Controls(i).Controls(1), Repeater)

                    If IsNothing(ChildRep) = False Then
                        For Each item As RepeaterItem In ChildRep.Items


                            Dim HidSecId As HiddenField = DirectCast(item.FindControl("HidSecId"), HiddenField)
                            ObjBusEva.SectionId = HidSecId.Value

                            Dim HidPartId As HiddenField = DirectCast(item.FindControl("HidPartId"), HiddenField)
                            ObjBusEva.ParticularsId = HidPartId.Value

                            Dim txtVal As TextBox = DirectCast(item.FindControl("TxtVal"), TextBox)
                            ObjBusEva.Value = txtVal.Text

                            ObjBusEva.SaveBusAnalys()
                        Next

                    End If

                Next

                lblMsg.Text = "Data save successfully."
            End If




        Catch ex As Exception
            lblMsg.Text = ex.Message
        End Try
    End Sub




Jan 31, 2012

Fileupload browse button without accompanying textbox



<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
        <title>Test - file upload trick</title>
    <script type="text/javascript">
    function CallUpload()    
    {
        if(document.getElementById("FileUpload1").value=='')
        {
            document.getElementById("FileUpload1").click();
        }
        else if(document.getElementById("FileUpload2").value=='')
        {
            document.getElementById("FileUpload2").click();        
        }
        else if(document.getElementById("FileUpload3").value=='')
        {
            document.getElementById("FileUpload3").click();        
        }        
     
        return false;
    }
    function AddToList(evt)
    {
         var myOption; 

            myOption = document.createElement("Option"); 
            myOption.text = evt;
            myOption.value = evt;
            document.getElementById("lstFiles").add(myOption);
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
         <br />
    add upto 3 files<br />
    
    <asp:FileUpload ID="FileUpload1" runat="server" Width="514px" onchange="javascript:AddToList(this.value);" style="display:none;"/>
    <asp:LinkButton ID="q0" runat="server" Text="link1" OnClientClick="return CallUpload();"></asp:LinkButton>
    <br />
    
    <asp:FileUpload ID="FileUpload2" runat="server" Width="514px" 
        onchange="javascript:AddToList(this.value);" style="display:none;"/>
    <br />
    
    <asp:FileUpload ID="FileUpload3" runat="server" Width="514px" 
        onchange="javascript:AddToList(this.value);" style="display:none;"/>
    <br />
    <asp:ListBox ID="lstFiles" runat="server" Width="221px"></asp:ListBox>
         <br />
         <br />
         <asp:Button ID="Upload" runat="server" Text="Button" />
    <br />
    
    </div>
    </form>
</body>
</html>
 
 
 
 
 
 
 
 
 
---------------------------In Code ------------------
 
 
 
    Protected Sub Upload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Upload.Click
        If Not FileUpload1.PostedFile.FileName = "" Then
            FileUpload1.PostedFile.SaveAs("file save path goes here")
        End If
        If Not FileUpload2.PostedFile.FileName = "" Then
            FileUpload2.PostedFile.SaveAs("file save path goes here")
        End If
        If Not FileUpload3.PostedFile.FileName = "" Then
            FileUpload3.PostedFile.SaveAs("file save path goes here")
        End If
    End Sub
  
 
 

What is the use of n-tier architecture and 3-tier architecture?

how to implement 3-tier architecture in asp.net using c#. 3-Tier architecture is also called layered architecture. Some people called it ...