<img src="<%=image_path%>new_client/ci-top_01.gif" > ?

1) yeah, it would be a heavy way of handling it. Depends on your application whether or not this is reasonable.

2) You should be able to figure out in advance all the possible controls and expand the If-Else to handle each. You can share this sub with all pages in your app, so you'd only have to do it once.

3) The replace function is looking for ~, so shouldn't affect any external links.

Another option would be to set the page base in the header:

Code:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="test.aspx.vb" Inherits="test"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>test</title>
		<asp:literal id="litSetBase" runat="server"></asp:literal>
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<img src="choose.gif">
		</form>
	</body>
</HTML>

Code:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        litSetBase.Text = "<BASE href='http://localhost/FR/'>"
    End Sub

However, this will also affect any relative links you may have used in your pages.
 
3) The replace function is looking for ~, so shouldn't affect any external links.

Another option would be to set the page base in the header:

Thank you very much! So amazing! I didn't even know it was possible to setup the root path in HTML for all relative links!!!

For every image src, I'll just put «myImages/img1.gif»

You saved me thousans lines of useless code!!! I think I'll solve most of the problems! The only disadvantage I see is that I wont be able no more to put relative links to navigate between pages that are in the same directory. I'll have to put the whole path from the new base directory, witch will be: "http://mysite.com/fr/" or "http://mysite.com/en/". So if I'm in the /fr/sub1/sub2/sub3/page1.aspx, and I want to put a link to /fr/sub1/sub2/sub3/page2.aspx, I'll have to write the whole path (sub1/sub2/sub3/page2.aspx).
 
Back
Top