[Solved] ASP.Net Error: System.Net.Mime.ContentType is a type but is used like a variable

Last Reply 9 months ago By pandeyism

Posted 9 months ago


i am using this snippet 

Download Files from GridView using LinkButton Click Event in ASP.Net using C# and VB.Net

it works find when i add the code on page, but when i use user control and use this code here error is coming

Response.ContentType = ContentType;


Error	2	'System.Net.Mime.ContentType' is a 'type' but is used like a 'variable'	D:\Projects\VirtualEstimatorV1\VirtualEstimatorV1\usercontrol\project-files.ascx.cs	245	36	VirtualEstimatorV1
Posted 9 months ago


nauna says:
Response.ContentType = ContentType;

 Change with below code.

Response.ContentType = "text/html";