Guoqi:
I agree this is a serious problem....not only does the <base> element not
"need" a closing element, it's strictly forbidden....
The only solution I can think of is that you create your own server control:
Something like:
public class HtmlBase : HtmlGenericControl {
private string href;
public string Href {
get { return href; }
set { href = value; }
}
public HtmlBase(object o) {}
protected override void Render(HtmlTextWriter writer) {
writer.Write("<base href=\"");
writer.Write(href);
writer.Write("\">");
}
}
you can then use it by
[a] registering the control:
<%@ Register TagPrefix="HtmlBase" Assembly="ASSEMBLY NAME GOES HERE"
NameSpace="NAMESPACE GOES HERE" %>
[b] using it:
<HtmlBase:HtmlBase id="X" runat="Server" href="some value" />
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Guoqi Zheng" <no@sorry.com> wrote in message
news:eN****************@TK2MSFTNGP15.phx.gbl...
Dear sir,
On some of my pages, I used a <base href="http://www.meetholland.com/">
I need to dynamically determine the base href value to different URL based
on user session.
I am thinking to use <base id="baseUrl" runat=server>, it seems not to
work. It returns an error of missing </base> but base tag does not need
</base>
How can I achieve this?? Thannks in advanced.