Skip to main content

Posts

Showing posts from August, 2013

Multiple File Upload in Asp.net c#

Default.aspx <div>         <input type="file" id="FileUpload1" multiple="multiple" runat="server" />         <asp:Button runat="server" ID="btnupload" Text="Upload" OnClick="btnupload_Click" />&nbsp;<br/>         <asp:Label runat="server" ID="Label1"></asp:Label>     </div> Default.aspx.cs protected void btnupload_Click(object sender, EventArgs e)         {                       string savepath = Server.MapPath("FolderName");             for (int i = 0; i < Request.Files.Count; i++)             {                 HttpPostedFile hpf = Request.Files[i];                 string filename = hpf.FileName;                               hpf.SaveAs(savepath + @"\" + filename);             }         } 

Create ZIP Files in Asp.net C#, VB.NET | ZIP Files Archive in ASP.Net

To implement this first we need to get  Ionic.Zip.dll   from DotnetZIP Library for that check this link   Ionic.Zip.dll   or you can get it from attached downloadable code. Now you need to add that dll to your application bin folder for that check below steps Go to Solution Explorer --> Right click on it and go to Add ASP.NET folder --> click on Bin Now bin folder added to our application and place   Ionic.Zip.dll   in that folder and add another folder in your application (Right click on your application -à Select New folder) and give name as SampleFiles Default.aspx: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Create ZIP Files in Asp.net using c#,vb.net</title> </head> <body> <form id="form1" runat="server"> <div> <asp:FileUpload ID="fileUpload1" runat="server" /> <asp:Button ID="btnUpload" runat="server" Text="Upload

Highlight gidview rows on mouseover using JavaScript

Default.aspx: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Gridview onmouseover and onmouseout</title> <script type="text/javascript"> var oldgridcolor; function SetMouseOver(element) { oldgridcolor = element.style.backgroundColor; element.style.backgroundColor = '#ffeb95'; element.style.cursor = 'pointer'; element.style.textDecoration = 'underline'; } function SetMouseOut(element) { element.style.backgroundColor = oldgridcolor; element.style.textDecoration = 'none'; } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:GridView runat="server" ID="gvrecords"  AutoGenerateColumns="false" HeaderStyle-BackColor="#7779AF" HeaderStyle-ForeColor="White" onrowdatabound="gvrecords_RowDataBound"> <Columns> <a