469,299 Members | 2,080 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

Redirect to a link in a user control

Max
Hello,
here a user control named aff.ascx : (this control is used to see the
contains of a link)

<%@ Control Language="VB" %>
<script runat="server">
' Insert user control code here
Public adr As String

</script>
<!-- Insert content here -->
<div align="center">
Contrôle<br />
<% If adr <> "" Then
Server.execute(adr) <---- It's ok
End If%>
</div>
<p style="text-align: left">
</p>
__________________________________________________ __________________________________________________ ____________
Here the main Page

<%@ Page Language="VB" %>
<%@ Register Src="aff.ascx" TagName="aff" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
aff.adr = "x.htm"
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align: left">
<span style="color: #99ffcc">
<uc1:aff ID="aff" runat="server" />
</span>
</div>
</form>
</body>
</html>

When i try to test a complete link like
aff.adr="http://xx.xx.xx.xx/directory/x.pdf" for example, the server return
this error : 'Invalid path for child request
"http://xx.xx.xx.xx/directory/x.pdf". A virtual path is expected. How can i
do to redirect to link in this control .
Thank's a lot.
Nov 19 '05 #1
4 2811
Use Response.Redirect, not Server.Execute.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hello,
here a user control named aff.ascx : (this control is used to see the
contains of a link)
<%@ Control Language="VB" %>
<script runat="server">
' Insert user control code here
Public adr As String
</script>

<!-- Insert content here -->

<div align="center">

Contrôle<br />

<% If adr <> "" Then

Server.execute(adr) <---- It's ok

End If%>

</div>

<p style="text-align: left">

</p>

__________________________________________________ ____________________
__________________________________________

Here the main Page

<%@ Page Language="VB" %>
<%@ Register Src="aff.ascx" TagName="aff" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
aff.adr = "x.htm"
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align: left">
<span style="color: #99ffcc">
<uc1:aff ID="aff" runat="server" />
</span>
</div>
</form>
</body>
</html>
When i try to test a complete link like
aff.adr="http://xx.xx.xx.xx/directory/x.pdf" for example, the server
return this error : 'Invalid path for child request
"http://xx.xx.xx.xx/directory/x.pdf". A virtual path is expected. How
can i do to redirect to link in this control .

Thank's a lot.


Nov 19 '05 #2
I have already used Response.redirect but the document opened itself into
another Page and not into the control.
Idon't know how to do...

"Brock Allen" <ba****@NOSPAMdevelop.com> a écrit dans le message de news:
11***********************@msnews.microsoft.com...
Use Response.Redirect, not Server.Execute.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hello,
here a user control named aff.ascx : (this control is used to see the
contains of a link)
<%@ Control Language="VB" %>
<script runat="server">
' Insert user control code here
Public adr As String
</script>

<!-- Insert content here -->

<div align="center">

Contrôle<br />

<% If adr <> "" Then

Server.execute(adr) <---- It's ok

End If%>

</div>

<p style="text-align: left">

</p>

__________________________________________________ ____________________
__________________________________________

Here the main Page

<%@ Page Language="VB" %>
<%@ Register Src="aff.ascx" TagName="aff" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
aff.adr = "x.htm"
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align: left">
<span style="color: #99ffcc">
<uc1:aff ID="aff" runat="server" />
</span>
</div>
</form>
</body>
</html>
When i try to test a complete link like
aff.adr="http://xx.xx.xx.xx/directory/x.pdf" for example, the server
return this error : 'Invalid path for child request
"http://xx.xx.xx.xx/directory/x.pdf". A virtual path is expected. How
can i do to redirect to link in this control .

Thank's a lot.


Nov 19 '05 #3
But you're trying to emit a PDF -- this will require a seperate HTTP request
to get that document. Perhaps what you really want are frames?

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have already used Response.redirect but the document opened itself
into
another Page and not into the control.
Idon't know how to do...
"Brock Allen" <ba****@NOSPAMdevelop.com> a écrit dans le message de
news: 11***********************@msnews.microsoft.com...
Use Response.Redirect, not Server.Execute.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hello,
here a user control named aff.ascx : (this control is used to see
the
contains of a link)
<%@ Control Language="VB" %>
<script runat="server">
' Insert user control code here
Public adr As String
</script>
<!-- Insert content here -->

<div align="center">

Contrôle<br />

<% If adr <> "" Then

Server.execute(adr) <---- It's ok

End If%>

</div>

<p style="text-align: left">

</p>

__________________________________________________ __________________
__ __________________________________________

Here the main Page

<%@ Page Language="VB" %>
<%@ Register Src="aff.ascx" TagName="aff" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
aff.adr = "x.htm"
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align: left">
<span style="color: #99ffcc">
<uc1:aff ID="aff" runat="server" />
</span>
</div>
</form>
</body>
</html>
When i try to test a complete link like
aff.adr="http://xx.xx.xx.xx/directory/x.pdf" for example, the server
return this error : 'Invalid path for child request
"http://xx.xx.xx.xx/directory/x.pdf". A virtual path is expected.
How
can i do to redirect to link in this control .
Thank's a lot.


Nov 19 '05 #4
I have read that frames are not recommended with asp.net. I usually write
with frames in asp. I have already tested to do a document with frames
separated like left / right.
The left Frame contains in reality a treeview which is linked to a data base
but when i click onto a node of the link the result is displayed on the left
frame.
However, I wrote something like node.target="right" but that was not good.
the left frame was written in aspx language and the right only in html. Is
this comptatible or perhaps this is not advised ?
thank you very much for your assistance.
My excuses for the bad spoken language... Everybody is not shakespear !

"Brock Allen" <ba****@NOSPAMdevelop.com> a écrit dans le message de news:
11***********************@msnews.microsoft.com...
But you're trying to emit a PDF -- this will require a seperate HTTP
request to get that document. Perhaps what you really want are frames?

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have already used Response.redirect but the document opened itself
into
another Page and not into the control.
Idon't know how to do...
"Brock Allen" <ba****@NOSPAMdevelop.com> a écrit dans le message de
news: 11***********************@msnews.microsoft.com...
Use Response.Redirect, not Server.Execute.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hello,
here a user control named aff.ascx : (this control is used to see
the
contains of a link)
<%@ Control Language="VB" %>
<script runat="server">
' Insert user control code here
Public adr As String
</script>
<!-- Insert content here -->

<div align="center">

Contrôle<br />

<% If adr <> "" Then

Server.execute(adr) <---- It's ok

End If%>

</div>

<p style="text-align: left">

</p>

__________________________________________________ __________________
__ __________________________________________

Here the main Page

<%@ Page Language="VB" %>
<%@ Register Src="aff.ascx" TagName="aff" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
aff.adr = "x.htm"
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align: left">
<span style="color: #99ffcc">
<uc1:aff ID="aff" runat="server" />
</span>
</div>
</form>
</body>
</html>
When i try to test a complete link like
aff.adr="http://xx.xx.xx.xx/directory/x.pdf" for example, the server
return this error : 'Invalid path for child request
"http://xx.xx.xx.xx/directory/x.pdf". A virtual path is expected.
How
can i do to redirect to link in this control .
Thank's a lot.


Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Damo | last post: by
3 posts views Thread by Tom | last post: by
8 posts views Thread by msnews.microsoft.com | last post: by
4 posts views Thread by Marty U. | last post: by
5 posts views Thread by Trisha | last post: by
10 posts views Thread by Eirik Eldorsen | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.