R
Richard
On my dev PC the website that i wrote auto creates a word document and it
auto-opens in my webbrowser.
Whenever i visit the site with another PC the website ask if the user wants
to download the .doc document of open it.
Why is this and how can i make sure it opens in the browser only.
my code:
---------------------------------------------
Sub butMaakWord_OnClick(Sender as Object, e as EventArgs)
Dim myConnection As OleDBConnection = New
OleDBConnection(AppSettings("DigifanDatabaseCon"))
myConnection.Open()
Dim ds As DataSet
Dim sXSL As String
ds = New DataSet("klantenkaart")
Dim ContactsDA As OleDBDataAdapter = New OleDBDataAdapter("SELECT *
FROM Klantenbestand WHERE klantnummer="& Request.QueryString("ID") & "",
myConnection)
ContactsDA.Fill(ds, "Klantenbestand")
' XSLT to use for transforming this dataset.
sXSL = "klantenkaart.xslt"
' Close the connection to the data source.
myConnection.Close()
' Transform the dataset by using the appropriate stylesheet.
Dim xmlDoc As XmlDataDocument = New XmlDataDocument(ds)
Dim xslTran As XslTransform = New XslTransform
xslTran.Load(Server.MapPath(sXSL))
' Stream the results of the transformation to Word.
Response.ContentType = "application/msword"
Response.Charset = ""
Response.ContentEncoding = System.Text.Encoding.Default
xslTran.Transform(xmlDoc, Nothing, Response.Output)
End Sub
auto-opens in my webbrowser.
Whenever i visit the site with another PC the website ask if the user wants
to download the .doc document of open it.
Why is this and how can i make sure it opens in the browser only.
my code:
---------------------------------------------
Sub butMaakWord_OnClick(Sender as Object, e as EventArgs)
Dim myConnection As OleDBConnection = New
OleDBConnection(AppSettings("DigifanDatabaseCon"))
myConnection.Open()
Dim ds As DataSet
Dim sXSL As String
ds = New DataSet("klantenkaart")
Dim ContactsDA As OleDBDataAdapter = New OleDBDataAdapter("SELECT *
FROM Klantenbestand WHERE klantnummer="& Request.QueryString("ID") & "",
myConnection)
ContactsDA.Fill(ds, "Klantenbestand")
' XSLT to use for transforming this dataset.
sXSL = "klantenkaart.xslt"
' Close the connection to the data source.
myConnection.Close()
' Transform the dataset by using the appropriate stylesheet.
Dim xmlDoc As XmlDataDocument = New XmlDataDocument(ds)
Dim xslTran As XslTransform = New XslTransform
xslTran.Load(Server.MapPath(sXSL))
' Stream the results of the transformation to Word.
Response.ContentType = "application/msword"
Response.Charset = ""
Response.ContentEncoding = System.Text.Encoding.Default
xslTran.Transform(xmlDoc, Nothing, Response.Output)
End Sub