G
Guest
Dear Experts,
I'm trying to open a file from my web form. However, when I click on the
button, no action is being performed. I have tried running it in debugging
mode, the file is able to open. Below is the partial of my code
-------------------------------------------------------------------------------------------
<td colspan="1" style="height: 20px">
<asp:Label ID="lblAttachment" runat="server"
Text="Attachment:" Visible="False"></asp:Label></td>
<td colspan="5" style="height: 20px">
<asp:TextBox ID="txtAttachment" runat="server"
BorderStyle="None" ReadOnly="True" Visible="False"
Width="250px"></asp:TextBox>
<asp:Button ID="btnViewAttachment" runat="server"
Text="View" Visible="False" OnClick="ViewDoc" /></td>
---------------------------------------------------------------------------------------------
Public Sub ViewDoc(ByVal Source As Object, ByVal E As EventArgs)
Dim strFilename As String
'Dim blnOpenDoc As Boolean
strFilename = Trim(txtAttachment.Text)
Try
Dim Proc As New System.Diagnostics.Process
Proc.StartInfo.WorkingDirectory =
"C:\Data\Websites\Intranet\TeknionLocal\FrontPage2000\Teknion\ITRS\App_Data\Attachments"
Proc.StartInfo.FileName = strFilename
Proc.Start()
'OpenDocument(strFilename)
'Return True
Catch ex As Exception
End Try
End Su
----------------------------------------------------------------------------------------------
Please advise on what is the mistake I have done or I have not done to put
into the code. The document that I tried to open is Word and Excel.
Many thanks in advance.
Regards,
SB
I'm trying to open a file from my web form. However, when I click on the
button, no action is being performed. I have tried running it in debugging
mode, the file is able to open. Below is the partial of my code
-------------------------------------------------------------------------------------------
<td colspan="1" style="height: 20px">
<asp:Label ID="lblAttachment" runat="server"
Text="Attachment:" Visible="False"></asp:Label></td>
<td colspan="5" style="height: 20px">
<asp:TextBox ID="txtAttachment" runat="server"
BorderStyle="None" ReadOnly="True" Visible="False"
Width="250px"></asp:TextBox>
<asp:Button ID="btnViewAttachment" runat="server"
Text="View" Visible="False" OnClick="ViewDoc" /></td>
---------------------------------------------------------------------------------------------
Public Sub ViewDoc(ByVal Source As Object, ByVal E As EventArgs)
Dim strFilename As String
'Dim blnOpenDoc As Boolean
strFilename = Trim(txtAttachment.Text)
Try
Dim Proc As New System.Diagnostics.Process
Proc.StartInfo.WorkingDirectory =
"C:\Data\Websites\Intranet\TeknionLocal\FrontPage2000\Teknion\ITRS\App_Data\Attachments"
Proc.StartInfo.FileName = strFilename
Proc.Start()
'OpenDocument(strFilename)
'Return True
Catch ex As Exception
End Try
End Su
----------------------------------------------------------------------------------------------
Please advise on what is the mistake I have done or I have not done to put
into the code. The document that I tried to open is Word and Excel.
Many thanks in advance.
Regards,
SB