473,466 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Load file

I am trying to load a file from a dropdownlist, however I get a error saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)
Nov 19 '05 #1
26 2578
A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It's 'something' and not 'sumfin' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
I am trying to load a file from a dropdownlist, however I get a error
saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)

Nov 19 '05 #2
Try using Server.MapPath(bString)

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
I am trying to load a file from a dropdownlist, however I get a error saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)

Nov 19 '05 #3
Try using Server.MapPath(bString)

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
I am trying to load a file from a dropdownlist, however I get a error saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)

Nov 19 '05 #4
I have tried response.redirect and the following, which generates "Invalid
path for child request 'c:\inetpub\wwwroot\4900\Framework.doc'. A virtual
path is expected."

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = Server.MapPath("..\" &
sumfin.Substring(3, pos - 3))
Server.Transfer(bString)

Any other suggestions welcome. Thanks.

"Grant Merwitz" wrote:
A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It's 'something' and not 'sumfin' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
I am trying to load a file from a dropdownlist, however I get a error
saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)


Nov 19 '05 #5
You won't need the "..\" when you do MapPath(). It takes care of that
for you. The string input would look something like "/Directory/" or
"/Directory/SomeFile.aspx".

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
I have tried response.redirect and the following, which generates "Invalid
path for child request 'c:\inetpub\wwwroot\4900\Framework.doc'. A virtual
path is expected."

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = Server.MapPath("..\" &
sumfin.Substring(3, pos - 3))
Server.Transfer(bString)

Any other suggestions welcome. Thanks.

"Grant Merwitz" wrote:

A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It's 'something' and not 'sumfin' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@micros oft.com...
I am trying to load a file from a dropdownlist, however I get a error
saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)


Nov 19 '05 #6
Forget the MapPath

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos as Integer = sumfin.Legth
Dim bString as String = "/" & sumfin.Substring(3, pos - 3))
Server.Transfer(bString)
or, unless you dead set on Server.Transfer

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Response.Redirect(cString)

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:B9**********************************@microsof t.com...
I have tried response.redirect and the following, which generates "Invalid
path for child request 'c:\inetpub\wwwroot\4900\Framework.doc'. A virtual
path is expected."

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = Server.MapPath("..\" &
sumfin.Substring(3, pos - 3))
Server.Transfer(bString)

Any other suggestions welcome. Thanks.

"Grant Merwitz" wrote:
A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It's 'something' and not 'sumfin' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
>I am trying to load a file from a dropdownlist, however I get a error
>saying
> a virtual path is required. An example selected value would be
> "../4900/myfile.doc". Any ideas - my code is.
>
> Dim sumfin As String = DropDownList1.SelectedValue.ToString
> Dim pos As Integer = sumfin.Length
> Dim bString As String = sumfin.Substring(3, pos - 3)
> Dim cString As String = "http://localhost/" & bString
> Server.Transfer(cString)


Nov 19 '05 #7
I have tried response.redirect and the following, which generates "Invalid
path for child request 'c:\inetpub\wwwroot\4900\Framework.doc'. A virtual
path is expected."

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = Server.MapPath("..\" &
sumfin.Substring(3, pos - 3))
Server.Transfer(bString)

Any other suggestions welcome. Thanks.

"Grant Merwitz" wrote:
A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It's 'something' and not 'sumfin' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
I am trying to load a file from a dropdownlist, however I get a error
saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)


Nov 19 '05 #8
You won't need the "..\" when you do MapPath(). It takes care of that
for you. The string input would look something like "/Directory/" or
"/Directory/SomeFile.aspx".

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
I have tried response.redirect and the following, which generates "Invalid
path for child request 'c:\inetpub\wwwroot\4900\Framework.doc'. A virtual
path is expected."

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = Server.MapPath("..\" &
sumfin.Substring(3, pos - 3))
Server.Transfer(bString)

Any other suggestions welcome. Thanks.

"Grant Merwitz" wrote:

A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It's 'something' and not 'sumfin' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@micros oft.com...
I am trying to load a file from a dropdownlist, however I get a error
saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)


Nov 19 '05 #9
Forget the MapPath

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos as Integer = sumfin.Legth
Dim bString as String = "/" & sumfin.Substring(3, pos - 3))
Server.Transfer(bString)
or, unless you dead set on Server.Transfer

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Response.Redirect(cString)

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:B9**********************************@microsof t.com...
I have tried response.redirect and the following, which generates "Invalid
path for child request 'c:\inetpub\wwwroot\4900\Framework.doc'. A virtual
path is expected."

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = Server.MapPath("..\" &
sumfin.Substring(3, pos - 3))
Server.Transfer(bString)

Any other suggestions welcome. Thanks.

"Grant Merwitz" wrote:
A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It's 'something' and not 'sumfin' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
>I am trying to load a file from a dropdownlist, however I get a error
>saying
> a virtual path is required. An example selected value would be
> "../4900/myfile.doc". Any ideas - my code is.
>
> Dim sumfin As String = DropDownList1.SelectedValue.ToString
> Dim pos As Integer = sumfin.Length
> Dim bString As String = sumfin.Substring(3, pos - 3)
> Dim cString As String = "http://localhost/" & bString
> Server.Transfer(cString)


Nov 19 '05 #10
I'm curious. Why would you "forget MapPath"?

Grant Merwitz wrote:
Forget the MapPath

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos as Integer = sumfin.Legth
Dim bString as String = "/" & sumfin.Substring(3, pos - 3))
Server.Transfer(bString)
or, unless you dead set on Server.Transfer

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Response.Redirect(cString)

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:B9**********************************@microsof t.com...
I have tried response.redirect and the following, which generates "Invalid
path for child request 'c:\inetpub\wwwroot\4900\Framework.doc'. A virtual
path is expected."

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = Server.MapPath("..\" &
sumfin.Substring(3, pos - 3))
Server.Transfer(bString)

Any other suggestions welcome. Thanks.

"Grant Merwitz" wrote:

A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It's 'something' and not 'sumfin' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@micro soft.com...

I am trying to load a file from a dropdownlist, however I get a error
saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)


Nov 19 '05 #11
No suggestions have worked so far - anything else, weird isn't it.

"Clint Hill" wrote:
Try using Server.MapPath(bString)

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
I am trying to load a file from a dropdownlist, however I get a error saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)

Nov 19 '05 #12
I dunno, being in the virtual directory (http://localhost) i though it
unnecessary
Also, he's redirecting to it, not writing it to screen, so physical path
seemed unnecessary.

Sorry, didn't mean to diss your answer or anything, just trying to simplify
it

"Clint Hill" <cl********@nospamath3osoftware.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I'm curious. Why would you "forget MapPath"?

Grant Merwitz wrote:
Forget the MapPath

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos as Integer = sumfin.Legth
Dim bString as String = "/" & sumfin.Substring(3, pos - 3))
Server.Transfer(bString)
or, unless you dead set on Server.Transfer

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Response.Redirect(cString)

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:B9**********************************@microsof t.com...
I have tried response.redirect and the following, which generates
"Invalid
path for child request 'c:\inetpub\wwwroot\4900\Framework.doc'. A virtual
path is expected."

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = Server.MapPath("..\" &
sumfin.Substring(3, pos - 3))
Server.Transfer(bString)

Any other suggestions welcome. Thanks.

"Grant Merwitz" wrote:
A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It's 'something' and not 'sumfin' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@micr osoft.com...

>I am trying to load a file from a dropdownlist, however I get a error
>saying
>a virtual path is required. An example selected value would be
>"../4900/myfile.doc". Any ideas - my code is.
>
>Dim sumfin As String = DropDownList1.SelectedValue.ToString
> Dim pos As Integer = sumfin.Length
> Dim bString As String = sumfin.Substring(3, pos - 3)
> Dim cString As String = "http://localhost/" & bString
> Server.Transfer(cString)


Nov 19 '05 #13
What happens if you just paste the URL into your browser?
http://localhost/4900/myfile.doc
Do you still get an error message?

Doesn't look like a problem with the code but maybe with the web server
setup.

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
No suggestions have worked so far - anything else, weird isn't it.

"Clint Hill" wrote:
Try using Server.MapPath(bString)

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
> I am trying to load a file from a dropdownlist, however I get a error
> saying
> a virtual path is required. An example selected value would be
> "../4900/myfile.doc". Any ideas - my code is.
>
> Dim sumfin As String = DropDownList1.SelectedValue.ToString
> Dim pos As Integer = sumfin.Length
> Dim bString As String = sumfin.Substring(3, pos - 3)
> Dim cString As String = "http://localhost/" & bString
> Server.Transfer(cString)

Nov 19 '05 #14
I'm curious. Why would you "forget MapPath"?

Grant Merwitz wrote:
Forget the MapPath

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos as Integer = sumfin.Legth
Dim bString as String = "/" & sumfin.Substring(3, pos - 3))
Server.Transfer(bString)
or, unless you dead set on Server.Transfer

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Response.Redirect(cString)

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:B9**********************************@microsof t.com...
I have tried response.redirect and the following, which generates "Invalid
path for child request 'c:\inetpub\wwwroot\4900\Framework.doc'. A virtual
path is expected."

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = Server.MapPath("..\" &
sumfin.Substring(3, pos - 3))
Server.Transfer(bString)

Any other suggestions welcome. Thanks.

"Grant Merwitz" wrote:

A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It's 'something' and not 'sumfin' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@micro soft.com...

I am trying to load a file from a dropdownlist, however I get a error
saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)


Nov 19 '05 #15
No suggestions have worked so far - anything else, weird isn't it.

"Clint Hill" wrote:
Try using Server.MapPath(bString)

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
I am trying to load a file from a dropdownlist, however I get a error saying
a virtual path is required. An example selected value would be
"../4900/myfile.doc". Any ideas - my code is.

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Server.Transfer(cString)

Nov 19 '05 #16
I dunno, being in the virtual directory (http://localhost) i though it
unnecessary
Also, he's redirecting to it, not writing it to screen, so physical path
seemed unnecessary.

Sorry, didn't mean to diss your answer or anything, just trying to simplify
it

"Clint Hill" <cl********@nospamath3osoftware.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I'm curious. Why would you "forget MapPath"?

Grant Merwitz wrote:
Forget the MapPath

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos as Integer = sumfin.Legth
Dim bString as String = "/" & sumfin.Substring(3, pos - 3))
Server.Transfer(bString)
or, unless you dead set on Server.Transfer

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = sumfin.Substring(3, pos - 3)
Dim cString As String = "http://localhost/" & bString
Response.Redirect(cString)

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:B9**********************************@microsof t.com...
I have tried response.redirect and the following, which generates
"Invalid
path for child request 'c:\inetpub\wwwroot\4900\Framework.doc'. A virtual
path is expected."

Dim sumfin As String = DropDownList1.SelectedValue.ToString
Dim pos As Integer = sumfin.Length
Dim bString As String = Server.MapPath("..\" &
sumfin.Substring(3, pos - 3))
Server.Transfer(bString)

Any other suggestions welcome. Thanks.

"Grant Merwitz" wrote:
A virtual path would be:

Dim cString As String = "/" & bString

Try that.

Alternately you could go:
Response.Redirect(cString)

P.S.

It's 'something' and not 'sumfin' ;)
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:73**********************************@micr osoft.com...

>I am trying to load a file from a dropdownlist, however I get a error
>saying
>a virtual path is required. An example selected value would be
>"../4900/myfile.doc". Any ideas - my code is.
>
>Dim sumfin As String = DropDownList1.SelectedValue.ToString
> Dim pos As Integer = sumfin.Length
> Dim bString As String = sumfin.Substring(3, pos - 3)
> Dim cString As String = "http://localhost/" & bString
> Server.Transfer(cString)


Nov 19 '05 #17
What happens if you just paste the URL into your browser?
http://localhost/4900/myfile.doc
Do you still get an error message?

Doesn't look like a problem with the code but maybe with the web server
setup.

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
No suggestions have worked so far - anything else, weird isn't it.

"Clint Hill" wrote:
Try using Server.MapPath(bString)

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
> I am trying to load a file from a dropdownlist, however I get a error
> saying
> a virtual path is required. An example selected value would be
> "../4900/myfile.doc". Any ideas - my code is.
>
> Dim sumfin As String = DropDownList1.SelectedValue.ToString
> Dim pos As Integer = sumfin.Length
> Dim bString As String = sumfin.Substring(3, pos - 3)
> Dim cString As String = "http://localhost/" & bString
> Server.Transfer(cString)

Nov 19 '05 #18
No problem loading when pasted in browser.

"Simon Hazelton" wrote:
What happens if you just paste the URL into your browser?
http://localhost/4900/myfile.doc
Do you still get an error message?

Doesn't look like a problem with the code but maybe with the web server
setup.

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
No suggestions have worked so far - anything else, weird isn't it.

"Clint Hill" wrote:
Try using Server.MapPath(bString)

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
> I am trying to load a file from a dropdownlist, however I get a error
> saying
> a virtual path is required. An example selected value would be
> "../4900/myfile.doc". Any ideas - my code is.
>
> Dim sumfin As String = DropDownList1.SelectedValue.ToString
> Dim pos As Integer = sumfin.Length
> Dim bString As String = sumfin.Substring(3, pos - 3)
> Dim cString As String = "http://localhost/" & bString
> Server.Transfer(cString)


Nov 19 '05 #19
No problem loading when pasted in browser.

"Simon Hazelton" wrote:
What happens if you just paste the URL into your browser?
http://localhost/4900/myfile.doc
Do you still get an error message?

Doesn't look like a problem with the code but maybe with the web server
setup.

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
No suggestions have worked so far - anything else, weird isn't it.

"Clint Hill" wrote:
Try using Server.MapPath(bString)

Clint Hill
H3O Software
http://www.h3osoftware.com

Niggy wrote:
> I am trying to load a file from a dropdownlist, however I get a error
> saying
> a virtual path is required. An example selected value would be
> "../4900/myfile.doc". Any ideas - my code is.
>
> Dim sumfin As String = DropDownList1.SelectedValue.ToString
> Dim pos As Integer = sumfin.Length
> Dim bString As String = sumfin.Substring(3, pos - 3)
> Dim cString As String = "http://localhost/" & bString
> Server.Transfer(cString)


Nov 19 '05 #20
could you post the html that is generated for the DropDownList1 please.
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
No problem loading when pasted in browser.

"Simon Hazelton" wrote:
What happens if you just paste the URL into your browser?
http://localhost/4900/myfile.doc
Do you still get an error message?

Doesn't look like a problem with the code but maybe with the web server
setup.

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
> No suggestions have worked so far - anything else, weird isn't it.
>
> "Clint Hill" wrote:
>
>> Try using Server.MapPath(bString)
>>
>> Clint Hill
>> H3O Software
>> http://www.h3osoftware.com
>>
>> Niggy wrote:
>> > I am trying to load a file from a dropdownlist, however I get a
>> > error
>> > saying
>> > a virtual path is required. An example selected value would be
>> > "../4900/myfile.doc". Any ideas - my code is.
>> >
>> > Dim sumfin As String = DropDownList1.SelectedValue.ToString
>> > Dim pos As Integer = sumfin.Length
>> > Dim bString As String = sumfin.Substring(3, pos - 3)
>> > Dim cString As String = "http://localhost/" & bString
>> > Server.Transfer(cString)
>>


Nov 19 '05 #21
could you post the html that is generated for the DropDownList1 please.
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
No problem loading when pasted in browser.

"Simon Hazelton" wrote:
What happens if you just paste the URL into your browser?
http://localhost/4900/myfile.doc
Do you still get an error message?

Doesn't look like a problem with the code but maybe with the web server
setup.

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
> No suggestions have worked so far - anything else, weird isn't it.
>
> "Clint Hill" wrote:
>
>> Try using Server.MapPath(bString)
>>
>> Clint Hill
>> H3O Software
>> http://www.h3osoftware.com
>>
>> Niggy wrote:
>> > I am trying to load a file from a dropdownlist, however I get a
>> > error
>> > saying
>> > a virtual path is required. An example selected value would be
>> > "../4900/myfile.doc". Any ideas - my code is.
>> >
>> > Dim sumfin As String = DropDownList1.SelectedValue.ToString
>> > Dim pos As Integer = sumfin.Length
>> > Dim bString As String = sumfin.Substring(3, pos - 3)
>> > Dim cString As String = "http://localhost/" & bString
>> > Server.Transfer(cString)
>>


Nov 19 '05 #22
Have spent a bit of time researching this, server.transfer to a document
just doesn't seem to work, give it up!

However, I do get that error message if I point to the wrong virtual
directory. Are the docs in the same directory as your application or are
they in a folder in the root directory. It works fine for me with
response.redirect. Are you CERTAIN you're redirecting correctly?
"Simon Hazelton" <Sh*******@community.nospam> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
could you post the html that is generated for the DropDownList1 please.
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
No problem loading when pasted in browser.

"Simon Hazelton" wrote:
What happens if you just paste the URL into your browser?
http://localhost/4900/myfile.doc
Do you still get an error message?

Doesn't look like a problem with the code but maybe with the web server
setup.

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
> No suggestions have worked so far - anything else, weird isn't it.
>
> "Clint Hill" wrote:
>
>> Try using Server.MapPath(bString)
>>
>> Clint Hill
>> H3O Software
>> http://www.h3osoftware.com
>>
>> Niggy wrote:
>> > I am trying to load a file from a dropdownlist, however I get a
>> > error
>> > saying
>> > a virtual path is required. An example selected value would be
>> > "../4900/myfile.doc". Any ideas - my code is.
>> >
>> > Dim sumfin As String = DropDownList1.SelectedValue.ToString
>> > Dim pos As Integer = sumfin.Length
>> > Dim bString As String = sumfin.Substring(3, pos - 3)
>> > Dim cString As String = "http://localhost/" & bString
>> > Server.Transfer(cString)
>>


Nov 19 '05 #23
Have spent a bit of time researching this, server.transfer to a document
just doesn't seem to work, give it up!

However, I do get that error message if I point to the wrong virtual
directory. Are the docs in the same directory as your application or are
they in a folder in the root directory. It works fine for me with
response.redirect. Are you CERTAIN you're redirecting correctly?
"Simon Hazelton" <Sh*******@community.nospam> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
could you post the html that is generated for the DropDownList1 please.
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
No problem loading when pasted in browser.

"Simon Hazelton" wrote:
What happens if you just paste the URL into your browser?
http://localhost/4900/myfile.doc
Do you still get an error message?

Doesn't look like a problem with the code but maybe with the web server
setup.

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
> No suggestions have worked so far - anything else, weird isn't it.
>
> "Clint Hill" wrote:
>
>> Try using Server.MapPath(bString)
>>
>> Clint Hill
>> H3O Software
>> http://www.h3osoftware.com
>>
>> Niggy wrote:
>> > I am trying to load a file from a dropdownlist, however I get a
>> > error
>> > saying
>> > a virtual path is required. An example selected value would be
>> > "../4900/myfile.doc". Any ideas - my code is.
>> >
>> > Dim sumfin As String = DropDownList1.SelectedValue.ToString
>> > Dim pos As Integer = sumfin.Length
>> > Dim bString As String = sumfin.Substring(3, pos - 3)
>> > Dim cString As String = "http://localhost/" & bString
>> > Server.Transfer(cString)
>>


Nov 19 '05 #24
As requested the html generated by the DDL is below. Using Response.Redirect
I get the following error. Thanks for percevering with this.

System.Threading.ThreadAbortException: Thread was being aborted. at
System.Threading.Thread.AbortInternal() at
System.Threading.Thread.Abort(Object stateInfo) at
System.Web.HttpResponse.End() at System.Web.HttpResponse.Redirect(String url,
Boolean endResponse) at System.Web.HttpResponse.Redirect(String url) at
WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object sender,
EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 149

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm4</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<STYLE>
</STYLE>
</HEAD>
<body MS_POSITIONING="GridLayout">
<IFRAME ID=__hifSmartNav NAME=__hifSmartNav STYLE=display:none
src="/aspnet_client/system_web/1_1_4322/SmartNav.htm"></IFRAME>
<form name="Form1" method="post" action="WebForm4.aspx?id=1&Head=Benefits"
id="Form1" __smartNavEnabled="true">
<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE"
value="dDwtMjEwMzMzOTAyMzt0PDtsPGk8MT47PjtsPHQ8O2w 8aTwxPjtpPDM+O2k8Nz47PjtsPHQ8QDA8cDxwPGw8VmlzaWJsZ TtQYWdlQ291bnQ7XyFEYXRhU291cmNlSXRlbUNvdW50O18hSXR lbUNvdW50O0RhdGFLZXlzOz47bDxvPHQ+O2k8MT47aTwyPjtpP DI+O2w8aTwxPjtpPDQ+Oz47Pj47Pjs7Ozs7Ozs7Ozs+O2w8aTw wPjs+O2w8dDw7bDxpPDE+O2k8Mj47PjtsPHQ8O2w8aTwwPjtpP DE+O2k8Mj47PjtsPHQ8cDxwPGw8VGV4dDs+O2w8MTs+Pjs+Ozs +O3Q8cDxwPGw8VGV4dDs+O2w8V2hlbjs+Pjs+Ozs+O3Q8O2w8a TwwPjs+O2w8dDxwPHA8bDxOYXZpZ2F0ZVVybDs+O2w8V2ViRm9 ybTEzLmFzcHg/aWQ9MTs+Pjs+Ozs+Oz4+Oz4+O3Q8O2w8aTwwPjtpPDE+O2k8Mj 47PjtsPHQ8cDxwPGw8VGV4dDs+O2w8NDs+Pjs+Ozs+O3Q8cDxw PGw8VGV4dDs+O2w8d2h5Oz4+Oz47Oz47dDw7bDxpPDA+Oz47bD x0PHA8cDxsPE5hdmlnYXRlVXJsOz47bDxXZWJGb3JtMTMuYXNw eD9pZD00Oz4+Oz47Oz47Pj47Pj47Pj47Pj47dDxwPHA8bDxUZX h0Oz47bDxCZW5lZml0c1w+IDs+Pjs+Ozs+O3Q8dDw7dDxpPDEx PjtAPE9yZ2FuaXNhdGlvbiAtIEN1bHR1cmUucHB0O09yZ2FuaX NhdGlvbiAtIEN1bHR1cmUucHB0O09yZ2FuaXNhdGlvbiAtIFN0 cnVjdHVyZS5wcHQ7aW50cm9kdWN0aW9uLnBkZjtGcmFtZXdvcm suZG9jO2N1bHR1cmUucGRmO0NvcnBvcmF0ZSBTdHJhdGVneSBN b2RlbHMucHB0O09yZ2FuaXNhdGlvbnMg4oCTIFR5cGVzLnBwdD tzdHJ1Y3R1cmVzLnBkZjtzdHJ1Y3R1cmVzMi5wZGY7VW5pdmVy c2l0eSAyMDA0LnBwdDs+O0A8Li4vNDkwMC9PcmdhbmlzYXRpb2 4gLSBDdWx0dXJlLnBwdDsuLi80OTAwL09yZ2FuaXNhdGlvbiAt IEN1bHR1cmUucHB0Oy4uLzQ5MDAvT3JnYW5pc2F0aW9uIC0gU3 RydWN0dXJlLnBwdDsuLi80OTAwL2ludHJvZHVjdGlvbi5wZGY7 Li4vNDkwMC9GcmFtZXdvcmsuZG9jOy4uLzQ5MDAvY3VsdHVyZS 5wZGY7Li4vNDkwMC9Db3Jwb3JhdGUgU3RyYXRlZ3kgTW9kZWxz LnBwdDsuLi80OTAwL09yZ2FuaXNhdGlvbnMg4oCTIFR5cGVzLn BwdDsuLi80OTAwL3N0cnVjdHVyZXMucGRmOy4uLzQ5MDAvc3Ry dWN0dXJlczIucGRmOy4uLzQ5MDAvVW5pdmVyc2l0eSAyMDA0Ln BwdDs+Pjs+Ozs+Oz4+Oz4+Oz6xg6zsT+Iy3AdXLrgBmEm6Zdsh hw==" />

<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape") > -1) {
theform = document.forms["Form1"];
}
else {
theform = document.Form1;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>

<script language="JScript"
src="/aspnet_client/system_web/1_1_4322/SmartNav.js"></script>
<center>
<table cellspacing="0" cellpadding="3" align="Center" rules="rows"
bordercolor="#E7E7FF" border="1" id="DataGrid1"
style="background-color:White;border-color:#E7E7FF;border-width:1px;border-style:None;width:672px;border-collapse:collapse;Z-INDEX:
101; LEFT: 8px; POSITION: absolute; TOP: 72px">
<tr style="color:#F7F7F7;background-color:#4A3C8C;font-weight:bold;">
<td>ID</td><td>Heading</td><td>Comments</td><td>Responses</td>
</tr><tr style="color:#4A3C8C;background-color:#E7E7FF;">
<td>1</td><td>When</td><td><a
href="WebForm13.aspx?id=1">Read</a></td><td><a
href="javascript:__doPostBack('DataGrid1$_ctl2$_ct l1','')"
style="color:#4A3C8C;">View</a></td>
</tr><tr style="color:#4A3C8C;background-color:#F7F7F7;">
<td>4</td><td>why</td><td><a
href="WebForm13.aspx?id=4">Read</a></td><td><a
href="javascript:__doPostBack('DataGrid1$_ctl3$_ct l1','')"
style="color:#4A3C8C;">View</a></td>
</tr>
</table></center>
<span id="Label1" style="Z-INDEX: 102; LEFT: 8px; POSITION: absolute;
TOP: 8px">Benefits> </span>
<span id="Label2" style="height:48px;width:128px;Z-INDEX: 104; LEFT:
536px; POSITION: absolute; TOP: 8px">Label</span>
<select name="DropDownList1" onchange="__doPostBack('DropDownList1','')"
language="javascript" id="DropDownList1" style="Z-INDEX: 103; LEFT: 240px;
POSITION: absolute; TOP: 8px">
<option value="../4900/Organisation - Culture.ppt">Organisation -
Culture.ppt</option>
<option value="../4900/Organisation - Culture.ppt">Organisation -
Culture.ppt</option>
<option value="../4900/Organisation - Structure.ppt">Organisation -
Structure.ppt</option>
<option value="../4900/introduction.pdf">introduction.pdf</option>
<option value="../4900/Framework.doc">Framework.doc</option>
<option value="../4900/culture.pdf">culture.pdf</option>
<option value="../4900/Corporate Strategy Models.ppt">Corporate Strategy
Models.ppt</option>
<option value="../4900/Organisations – Types.ppt">Organisations –
Types.ppt</option>
<option value="../4900/structures.pdf">structures.pdf</option>
<option value="../4900/structures2.pdf">structures2.pdf</option>
<option value="../4900/University 2004.ppt">University 2004.ppt</option>

</select></form>
</body>
</HTML>

"Simon Hazelton" wrote:
Have spent a bit of time researching this, server.transfer to a document
just doesn't seem to work, give it up!

However, I do get that error message if I point to the wrong virtual
directory. Are the docs in the same directory as your application or are
they in a folder in the root directory. It works fine for me with
response.redirect. Are you CERTAIN you're redirecting correctly?
"Simon Hazelton" <Sh*******@community.nospam> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
could you post the html that is generated for the DropDownList1 please.
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
No problem loading when pasted in browser.

"Simon Hazelton" wrote:

What happens if you just paste the URL into your browser?
http://localhost/4900/myfile.doc
Do you still get an error message?

Doesn't look like a problem with the code but maybe with the web server
setup.

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
> No suggestions have worked so far - anything else, weird isn't it.
>
> "Clint Hill" wrote:
>
>> Try using Server.MapPath(bString)
>>
>> Clint Hill
>> H3O Software
>> http://www.h3osoftware.com
>>
>> Niggy wrote:
>> > I am trying to load a file from a dropdownlist, however I get a
>> > error
>> > saying
>> > a virtual path is required. An example selected value would be
>> > "../4900/myfile.doc". Any ideas - my code is.
>> >
>> > Dim sumfin As String = DropDownList1.SelectedValue.ToString
>> > Dim pos As Integer = sumfin.Length
>> > Dim bString As String = sumfin.Substring(3, pos - 3)
>> > Dim cString As String = "http://localhost/" & bString
>> > Server.Transfer(cString)
>>



Nov 19 '05 #25
As requested the html generated by the DDL is below. Using Response.Redirect
I get the following error. Thanks for percevering with this.

System.Threading.ThreadAbortException: Thread was being aborted. at
System.Threading.Thread.AbortInternal() at
System.Threading.Thread.Abort(Object stateInfo) at
System.Web.HttpResponse.End() at System.Web.HttpResponse.Redirect(String url,
Boolean endResponse) at System.Web.HttpResponse.Redirect(String url) at
WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object sender,
EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 149

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm4</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<STYLE>
</STYLE>
</HEAD>
<body MS_POSITIONING="GridLayout">
<IFRAME ID=__hifSmartNav NAME=__hifSmartNav STYLE=display:none
src="/aspnet_client/system_web/1_1_4322/SmartNav.htm"></IFRAME>
<form name="Form1" method="post" action="WebForm4.aspx?id=1&Head=Benefits"
id="Form1" __smartNavEnabled="true">
<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE"
value="dDwtMjEwMzMzOTAyMzt0PDtsPGk8MT47PjtsPHQ8O2w 8aTwxPjtpPDM+O2k8Nz47PjtsPHQ8QDA8cDxwPGw8VmlzaWJsZ TtQYWdlQ291bnQ7XyFEYXRhU291cmNlSXRlbUNvdW50O18hSXR lbUNvdW50O0RhdGFLZXlzOz47bDxvPHQ+O2k8MT47aTwyPjtpP DI+O2w8aTwxPjtpPDQ+Oz47Pj47Pjs7Ozs7Ozs7Ozs+O2w8aTw wPjs+O2w8dDw7bDxpPDE+O2k8Mj47PjtsPHQ8O2w8aTwwPjtpP DE+O2k8Mj47PjtsPHQ8cDxwPGw8VGV4dDs+O2w8MTs+Pjs+Ozs +O3Q8cDxwPGw8VGV4dDs+O2w8V2hlbjs+Pjs+Ozs+O3Q8O2w8a TwwPjs+O2w8dDxwPHA8bDxOYXZpZ2F0ZVVybDs+O2w8V2ViRm9 ybTEzLmFzcHg/aWQ9MTs+Pjs+Ozs+Oz4+Oz4+O3Q8O2w8aTwwPjtpPDE+O2k8Mj 47PjtsPHQ8cDxwPGw8VGV4dDs+O2w8NDs+Pjs+Ozs+O3Q8cDxw PGw8VGV4dDs+O2w8d2h5Oz4+Oz47Oz47dDw7bDxpPDA+Oz47bD x0PHA8cDxsPE5hdmlnYXRlVXJsOz47bDxXZWJGb3JtMTMuYXNw eD9pZD00Oz4+Oz47Oz47Pj47Pj47Pj47Pj47dDxwPHA8bDxUZX h0Oz47bDxCZW5lZml0c1w+IDs+Pjs+Ozs+O3Q8dDw7dDxpPDEx PjtAPE9yZ2FuaXNhdGlvbiAtIEN1bHR1cmUucHB0O09yZ2FuaX NhdGlvbiAtIEN1bHR1cmUucHB0O09yZ2FuaXNhdGlvbiAtIFN0 cnVjdHVyZS5wcHQ7aW50cm9kdWN0aW9uLnBkZjtGcmFtZXdvcm suZG9jO2N1bHR1cmUucGRmO0NvcnBvcmF0ZSBTdHJhdGVneSBN b2RlbHMucHB0O09yZ2FuaXNhdGlvbnMg4oCTIFR5cGVzLnBwdD tzdHJ1Y3R1cmVzLnBkZjtzdHJ1Y3R1cmVzMi5wZGY7VW5pdmVy c2l0eSAyMDA0LnBwdDs+O0A8Li4vNDkwMC9PcmdhbmlzYXRpb2 4gLSBDdWx0dXJlLnBwdDsuLi80OTAwL09yZ2FuaXNhdGlvbiAt IEN1bHR1cmUucHB0Oy4uLzQ5MDAvT3JnYW5pc2F0aW9uIC0gU3 RydWN0dXJlLnBwdDsuLi80OTAwL2ludHJvZHVjdGlvbi5wZGY7 Li4vNDkwMC9GcmFtZXdvcmsuZG9jOy4uLzQ5MDAvY3VsdHVyZS 5wZGY7Li4vNDkwMC9Db3Jwb3JhdGUgU3RyYXRlZ3kgTW9kZWxz LnBwdDsuLi80OTAwL09yZ2FuaXNhdGlvbnMg4oCTIFR5cGVzLn BwdDsuLi80OTAwL3N0cnVjdHVyZXMucGRmOy4uLzQ5MDAvc3Ry dWN0dXJlczIucGRmOy4uLzQ5MDAvVW5pdmVyc2l0eSAyMDA0Ln BwdDs+Pjs+Ozs+Oz4+Oz4+Oz6xg6zsT+Iy3AdXLrgBmEm6Zdsh hw==" />

<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape") > -1) {
theform = document.forms["Form1"];
}
else {
theform = document.Form1;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>

<script language="JScript"
src="/aspnet_client/system_web/1_1_4322/SmartNav.js"></script>
<center>
<table cellspacing="0" cellpadding="3" align="Center" rules="rows"
bordercolor="#E7E7FF" border="1" id="DataGrid1"
style="background-color:White;border-color:#E7E7FF;border-width:1px;border-style:None;width:672px;border-collapse:collapse;Z-INDEX:
101; LEFT: 8px; POSITION: absolute; TOP: 72px">
<tr style="color:#F7F7F7;background-color:#4A3C8C;font-weight:bold;">
<td>ID</td><td>Heading</td><td>Comments</td><td>Responses</td>
</tr><tr style="color:#4A3C8C;background-color:#E7E7FF;">
<td>1</td><td>When</td><td><a
href="WebForm13.aspx?id=1">Read</a></td><td><a
href="javascript:__doPostBack('DataGrid1$_ctl2$_ct l1','')"
style="color:#4A3C8C;">View</a></td>
</tr><tr style="color:#4A3C8C;background-color:#F7F7F7;">
<td>4</td><td>why</td><td><a
href="WebForm13.aspx?id=4">Read</a></td><td><a
href="javascript:__doPostBack('DataGrid1$_ctl3$_ct l1','')"
style="color:#4A3C8C;">View</a></td>
</tr>
</table></center>
<span id="Label1" style="Z-INDEX: 102; LEFT: 8px; POSITION: absolute;
TOP: 8px">Benefits> </span>
<span id="Label2" style="height:48px;width:128px;Z-INDEX: 104; LEFT:
536px; POSITION: absolute; TOP: 8px">Label</span>
<select name="DropDownList1" onchange="__doPostBack('DropDownList1','')"
language="javascript" id="DropDownList1" style="Z-INDEX: 103; LEFT: 240px;
POSITION: absolute; TOP: 8px">
<option value="../4900/Organisation - Culture.ppt">Organisation -
Culture.ppt</option>
<option value="../4900/Organisation - Culture.ppt">Organisation -
Culture.ppt</option>
<option value="../4900/Organisation - Structure.ppt">Organisation -
Structure.ppt</option>
<option value="../4900/introduction.pdf">introduction.pdf</option>
<option value="../4900/Framework.doc">Framework.doc</option>
<option value="../4900/culture.pdf">culture.pdf</option>
<option value="../4900/Corporate Strategy Models.ppt">Corporate Strategy
Models.ppt</option>
<option value="../4900/Organisations – Types.ppt">Organisations –
Types.ppt</option>
<option value="../4900/structures.pdf">structures.pdf</option>
<option value="../4900/structures2.pdf">structures2.pdf</option>
<option value="../4900/University 2004.ppt">University 2004.ppt</option>

</select></form>
</body>
</HTML>

"Simon Hazelton" wrote:
Have spent a bit of time researching this, server.transfer to a document
just doesn't seem to work, give it up!

However, I do get that error message if I point to the wrong virtual
directory. Are the docs in the same directory as your application or are
they in a folder in the root directory. It works fine for me with
response.redirect. Are you CERTAIN you're redirecting correctly?
"Simon Hazelton" <Sh*******@community.nospam> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
could you post the html that is generated for the DropDownList1 please.
"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
No problem loading when pasted in browser.

"Simon Hazelton" wrote:

What happens if you just paste the URL into your browser?
http://localhost/4900/myfile.doc
Do you still get an error message?

Doesn't look like a problem with the code but maybe with the web server
setup.

"Niggy" <Ni***@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
> No suggestions have worked so far - anything else, weird isn't it.
>
> "Clint Hill" wrote:
>
>> Try using Server.MapPath(bString)
>>
>> Clint Hill
>> H3O Software
>> http://www.h3osoftware.com
>>
>> Niggy wrote:
>> > I am trying to load a file from a dropdownlist, however I get a
>> > error
>> > saying
>> > a virtual path is required. An example selected value would be
>> > "../4900/myfile.doc". Any ideas - my code is.
>> >
>> > Dim sumfin As String = DropDownList1.SelectedValue.ToString
>> > Dim pos As Integer = sumfin.Length
>> > Dim bString As String = sumfin.Substring(3, pos - 3)
>> > Dim cString As String = "http://localhost/" & bString
>> > Server.Transfer(cString)
>>



Nov 19 '05 #26
Cam
Server.Transfer and Response.Redirect both call Response.End to stop
execution of the current thread. This stops the thread by issuing a
ThreadAbort exception which is a special non-catchable exception (you can
catch it, but can't stop it bubbling up).

Try using Server.Execute instead, or Response.Redirect(url,false).

A simple google will provide plenty of results outlining this (e.g.
http://www.kbalertz.com/kb_312629.aspx)

HTH,
C.

"Niggy" wrote:
As requested the html generated by the DDL is below. Using Response.Redirect
I get the following error. Thanks for percevering with this.

System.Threading.ThreadAbortException: Thread was being aborted. at
System.Threading.Thread.AbortInternal() at
System.Threading.Thread.Abort(Object stateInfo) at
System.Web.HttpResponse.End() at System.Web.HttpResponse.Redirect(String url,
Boolean endResponse) at System.Web.HttpResponse.Redirect(String url) at
WebApplication1.WebForm4.DropDownList1_SelectedInd exChanged(Object sender,
EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm4.aspx.v b:line 149


Nov 19 '05 #27

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ray in HK | last post by:
What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE ? I found some web hosting company do not allow using LOAD DATA INFILE but allow LOAD DATA LOCAL INFILE. The reason...
5
by: kk | last post by:
Hello, I am using the udb 8.1 task scheduler to schedule a load. Is there any way to also schedule an OS command (win32) to delete the file after the load? I have a python script that will do...
0
by: Simon | last post by:
Hi I try to open a CR report file located on the network path from a web form developed with vs2003 and CR for Visual Studio, but the Load method of ReportDocument object always return error. ...
3
by: nsh | last post by:
mailing.database.mysql, comp.lang.php subject: does "LOAD DATA" EVER work?!? I've tried EVERYTHING! version info: my isp is running my web page on a linux box with php ver. 4.4.1 according to...
4
by: andrewcw | last post by:
I am moving some code forward from .NET 1.1. I was able to load the XSL file and perform the transform. The MSDN documentation looks like it should be easy. But I get a compile error. Ideas ?...
0
by: giovanni gherdovich | last post by:
Hello, first of all: Is this the right place to ask plastek-related questions? I'm trying to make plastex work on my Ubuntu Dapper Drake. For LaTeX, I have the all-in-one package tetex.
2
by: contractsup | last post by:
Environment: $ uname -a AIX <withheld2 5 000100614C00 $ db2level DB21085I Instance "<withheld>" uses "32" bits and DB2 code release "SQL08024" with level identifier "03050106"....
10
by: lamxing | last post by:
Dear all, I've spent a long time to try to get the xmldocument.load method to handle UTF-8 characters, but no luck. Every time it loads a document contains european characters (such as the...
2
by: David Thielen | last post by:
So we have moved our app from .NET version 2.X in IIS6 to a Windows 2008 Server running IIS7. We have copied all files to the Windwardreports\apps directory and that apps directory has been...
13
by: rdudejr | last post by:
Hi all, I hardly ever make a post unless I am having a very purplexing issue, so this one should be good... I am trying to do a load against a database on an AIX server into a DB2 v9.1...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.