TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Prasad Bhagat
NA
516
234.3k
name "Response" does not exist in the current context
Dec 3 2015 6:57 AM
Dear all,
Implemented a method that will export data from html file to excell using asp.net c#.that could working fine .but i need to access that method into windows forms .am adding dll to my windowsforms solution after accessing the method running the freame .trying to call the method where i have implemented method with web responce .there am getting these above error .if i replce with
HttpContext also getting invalid name its showing .please i want to develop a application that was exports the data from html to excell.
here my asp.net c# code bellow.
public void exportOne()
{
string fullPathnew = "D:/WebApplication4/WebApplication4/BOM.htm";
// string html = File.ReadAllText(Server.MapPath("~/" + fullPathnew));
// HttpContext.Current.Response.Clear();.
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.Buffer = true;
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + "Export" + ".xls");
System.Web.HttpContext.Current.Response.ContentType = "application/vnd.xls";
System.Web.HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache); // not necessarily required
System.Web.HttpContext.Current.Response.Charset = "";
// System.Web.HttpContext.Current. this.EnableViewState = false;
System.Web.HttpContext.Current. Response.Output.Write("~/" + fullPathnew);
System.Web.HttpContext.Current.Response.End();
}
Reply
Answers (
1
)
export data from html to excell using winforms?
How to change the location of the Form