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:
However, this will also affect any relative links you may have used in your pages.
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.