Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening word document in seperate web page.

Status
Not open for further replies.

sreeramnavale

Programmer
Feb 18, 2004
40
US
I use the following code to open a word document from ASP.NET and this code opens the word document on the current web page.

myExportFileOnline = mergeDocumentOnlinePath & "FNC_Commercial_Release_of_Assignment.doc"
Response.Redirect(myExportFileOnline)

I would like to open word document in a seperate new web page, instead of opening it on the current web page as I am doing right now.
Basically I would like to leaving the current web page AS IT IS.

Can some one help me?

Thanks,
SPN
 
You could create a second ASP.NET page, called "DisplayDoc.aspx", which accepted the name of a word file to display in a query-string parameter.

Then, in your current page, use a HyperLink control to link to DisplayDoc.aspx?fileName=yourWordFile.doc, setting the Target attribute to "_blank" which will cause a new window to open.

Greetings,
Dragonwell
 
Thank you for the suggestion Dragonwell, Your suggestion can work if yourWordFile.doc were a file which already exists on the server.

But yourWordFile.doc is getting created in the program which is there in the CODE BEHIND code(i.e ABC.aspx.vb file). Once the yourWordFile.doc is generated I immediately want to display it from the CODE BEHIND code itself on a seperate web page(say DisplayDoc.aspx). Moreover I do not want to add any hyperlink on the current web page.

I tried using something like Window.open but I really do not know the whole syntax of using it to open a new web page from the code behind. Or is there any other way better then use of Window.open.

SPN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top