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
nandini charla
NA
3
524
Open a spread sheet document after downloading automatically
Dec 16 2016 2:12 AM
I need to open an open office word document on clicking a button in the browser.To do this what i have done is i had taken a open office spread sheet document in my application folder and i am trying to open that document on button click i had used this code but what happens is it is downloading the document instead i need to open that document.How can i do this.
<asp:ImageButton id="imagebutton1" runat="server"
AlternateText="ImageButton 1"
Image
ImageUrl="images/pict.jpg"
OnClick="imagebutton1_Click"/>
protected void Page_Load(object sender, EventArgs e)
{
}
protected void imagebutton1_Click(object sender, ImageClickEventArgs e)
{
Response.Clear();
Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
Response.AddHeader("Content-disposition", "inline; filename=TestDoc.docx");
String path = Server.MapPath("TestDoc.docx");
Response.WriteFile(path);
Response.End();
}
Reply
Answers (
1
)
post on facebook
how to generate a autoincreament value serially in a textbox