How to download file with asp.net on buttton's onClick event?
I think you are looking for something like this.
private void Button1_click(object sender, System.EventArgs e)
{
Response.ContentType = "Application/pdf";
Response.AppendHeader("Content-Disposition", "attachment; filename=help.pdf");
Response.TransmitFile(Server.MapPath("~/doc/help.pdf"));
Response.End();
}
Button disabled but looks active
The :disabled selector can be used with CSS3
input[type="button"]:disabled
{
background:#dddddd;
}
Browser Compatibility:
IE8+ FF1.5+ SA3.1+ OP9.2+ CH2+
For ASP.NET:
Add a CssClass attribute to your server-side button and refer it to the class containing the above CSS.
Related Topics
Httpcontext.Current.Request.Files Is Always Empty
Get All Column Names of a Datatable into String Array Using (Linq/Predicate)
Change Datagrid Cell Colour Based on Values
Check If Database Exists Before Creating
How to Connect to a Database in ASP.NET Core Without Entity Framework
How to Parse Json List or Object in C#
Get and Post Methods With the Same Action Name in the Same Controller
Client Certificate Not Getting Added to the Request (Certificate Verify)
.Net Core - How to Properly Kill Started Process
How to Use Task.Delay as a Timer
C# Lamba With Datetime and Between
Converting a CSV File to Json Using C#
Getting Value of Selected Item in List Box as String
The Ssl Connection Could Not Be Established