내 웹 페이지에 버튼이 있습니다. 클릭하면 브라우저로 문서를 보내고 싶습니다.버튼을 통해 파일 다운로드
Private Sub btMNCgetTemplate_Click(sender As Object, e As EventArgs) Handles btMNCgetTemplate.Click
Dim MNCid As Integer = Me.cbMNCrequestType.SelectedValue
Dim mncRT As New MinorNetworkChangeTypeOfRequests
Dim MNCrq As New MNCTypeOfRequestItem
MNCrq = mncRT.Find(MNCid)
If MNCrq IsNot Nothing Then
If MNCrq.Form.ToLower.EndsWith(".doc") Or
MNCrq.Form.ToLower.EndsWith(".docx") Then
Response.ContentType = "Application/msword"
Else
Response.ContentType = "Application/x-msexcel"
End If
Response.AppendHeader("Content-Disposition", String.Format("attachment; filename={0}", MNCrq.Form))
Response.TransmitFile(Server.MapPath(String.Format("~/forms/{0}", MNCrq.Form)))
Response.End()
End If
End Sub
MNCrq 개체 양식 속성은 파일의 이름이 : 여기
는 클릭 이벤트에서 코드입니다.처음에는 제대로 작동했지만 파일 저장 창이있었습니다. 하지만 이제는 더 이상 작동하지 않습니다. Chrome에서 웹 사이트를 실행할 때 아무런 변화가 없습니다. 내가 잘못 여기서 뭐하는 거지
Unhandled exception at line 940, column 13 in http://localhost:29226/ScriptResource.axd?
d=DbqlGCg_y1TWNdNykQXSWTqf7VMHZvfOOc8W9SvKy5VJEvrKhkNOK5JNcaIC4d76X42JcWSxljh5epK1GqlRC4_NnfoLlKD1PfZ2-dNg98DHOKlBmICo8PKGlg73PqEQJR5AdM_sf6udu_6Vkp3cg9MicDI1&t=7c776dc1
0x800a139e - Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.
: 나는 IE9에서 웹 사이트를 실행하면 , 나는 내되지 않습니다 일부 파일에 다음 오류 메시지가?
RG, 에릭
FYI : 귀하의 docx MIME 형식이 올바르지 않습니다. 그것은'application/vnd.openxmlformats-officedocument.wordprocessingml.document'이어야합니다 – Win