J
j.t.w
Hi everyone,
I am trying to error trap for an invalid file name. When an invalid
file name is given, a message box saying "Cannot find
'file:///F:/Invoice/111.tif'. Make sure the path of Internet address is
correct.".
How can I go about redirecting to another page should an invalid file
name be given? Or can I run some other code to go look up in a database
the location of the file?
Here is the code I am working with...
Protected Sub SearchButton_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SearchButton.Click
Dim ImageString As String
Select Case ImageTypeRadioButtonList.SelectedItem.ToString
Case "AWB"
ImageString = "<script>window.open('F:/AWB/" +
ImageTextBox.Text + ".tif', '_blank');</script>"
Case "Invoice"
'ImageString = "<script>window.open('F:/Invoice/" +
ImageTextBox.Text + ".tif', '_blank');</script>"
Case "Voucher"
ImageString = "<script>window.open('F:/Voucher/" +
ImageTextBox.Text + ".tif', '_blank');</script>"
End Select
ImageTextBox.Text = ""
ImageTextBox.Focus()
Try
Response.Write(ImageString)
Response.Write("<script
language='javascript'>history.back()</script>")
Catch ex As Exception
Response.Redirect("http://www.google.com")
Finally
End Try
End Sub
Thanks for your help in this matter.
j.t.w
I am trying to error trap for an invalid file name. When an invalid
file name is given, a message box saying "Cannot find
'file:///F:/Invoice/111.tif'. Make sure the path of Internet address is
correct.".
How can I go about redirecting to another page should an invalid file
name be given? Or can I run some other code to go look up in a database
the location of the file?
Here is the code I am working with...
Protected Sub SearchButton_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SearchButton.Click
Dim ImageString As String
Select Case ImageTypeRadioButtonList.SelectedItem.ToString
Case "AWB"
ImageString = "<script>window.open('F:/AWB/" +
ImageTextBox.Text + ".tif', '_blank');</script>"
Case "Invoice"
'ImageString = "<script>window.open('F:/Invoice/" +
ImageTextBox.Text + ".tif', '_blank');</script>"
Case "Voucher"
ImageString = "<script>window.open('F:/Voucher/" +
ImageTextBox.Text + ".tif', '_blank');</script>"
End Select
ImageTextBox.Text = ""
ImageTextBox.Focus()
Try
Response.Write(ImageString)
Response.Write("<script
language='javascript'>history.back()</script>")
Catch ex As Exception
Response.Redirect("http://www.google.com")
Finally
End Try
End Sub
Thanks for your help in this matter.
j.t.w