S
sunil
Hi,
I have to open a word document from my aspx page.The Page_Load method
contains the following code
System.IO.TextWriter tx = Response.Output;
System.IO.StreamReader sr = new System.IO.StreamReader(this.Path);
Response.ContentType = "application/msword";
tx.Write(sr.ReadToEnd());
sr.Close();
Just to give more information, I have a First.aspx page which contains
a link to the Second.aspx page passing the complete path value. The
Page_Load method of Second.aspx page was shown above.
If I click the link, FileOpen dialog comes up and asks me for open,save
and cancel options. If I click Open, Microsoft Word opens and greets me
with a message: "Microsoft word needs a converter to display this file
correctly".If I click Cancel, then it is asking for me to select an
encoder.
What is the error? Am I doing the right thing in the Page_Load method.
I have MS Office 2003 installed and my IIS version is 5.1
I would be grateful for any help
I have to open a word document from my aspx page.The Page_Load method
contains the following code
System.IO.TextWriter tx = Response.Output;
System.IO.StreamReader sr = new System.IO.StreamReader(this.Path);
Response.ContentType = "application/msword";
tx.Write(sr.ReadToEnd());
sr.Close();
Just to give more information, I have a First.aspx page which contains
a link to the Second.aspx page passing the complete path value. The
Page_Load method of Second.aspx page was shown above.
If I click the link, FileOpen dialog comes up and asks me for open,save
and cancel options. If I click Open, Microsoft Word opens and greets me
with a message: "Microsoft word needs a converter to display this file
correctly".If I click Cancel, then it is asking for me to select an
encoder.
What is the error? Am I doing the right thing in the Page_Load method.
I have MS Office 2003 installed and my IIS version is 5.1
I would be grateful for any help