473,320 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to add <base target="_self"> in code behind

Hi!

I want to add
<base target="_self">
into the header section of a aspx page. I want to do this in the code
behind because I use master pages which I do not want to change directly.

Thanks

Joe
May 3 '07 #1
5 19902
"Joe Kovac" <Jo****@nospam.comwrote in message
news:e2***************************@news.inode.at.. .
I want to add
<base target="_self">
into the header section of a aspx page. I want to do this in the code
behind because I use master pages which I do not want to change directly.
http://msdn2.microsoft.com/en-us/lib....htmlhead.aspx
--
http://www.markrae.net

May 3 '07 #2
Another option:

Have a protected class-level string variable (and assign a value in
Page_Load or inline) in the code-behind:

protected string baseUrl = "<base href=\"_self\">";

And in the .aspx page:

<head>
<%= baseUrl %>
</head>

"Joe Kovac" wrote:
Hi!

I want to add
<base target="_self">
into the header section of a aspx page. I want to do this in the code
behind because I use master pages which I do not want to change directly.

Thanks

Joe
May 3 '07 #3
"Siva M" <sh******@online.excite.comwrote in message
news:C2**********************************@microsof t.com...
protected string baseUrl = "<base href=\"_self\">";
protected string baseUrl = "<base target=\"_self\">";
And in the .aspx page:
In the MasterPage...

--
http://www.markrae.net

May 3 '07 #4
Mark Rae wrote:
"Siva M" <sh******@online.excite.comwrote in message
news:C2**********************************@microsof t.com...
>protected string baseUrl = "<base href=\"_self\">";

protected string baseUrl = "<base target=\"_self\">";
>And in the .aspx page:

In the MasterPage...
Well, I don't want this in the MasterPage as not all pages are
concerned. Therefor I use:

Page.Header.Controls.Add(new LiteralControl(@"<base target=""_self"" />"));

May 4 '07 #5
"Joe Kovac" <Jo****@nospam.comwrote in message
news:a3**************************@news.inode.at...
Mark Rae wrote:
>"Siva M" <sh******@online.excite.comwrote in message
news:C2**********************************@microso ft.com...
>>protected string baseUrl = "<base href=\"_self\">";

protected string baseUrl = "<base target=\"_self\">";
>>And in the .aspx page:

In the MasterPage...

Well, I don't want this in the MasterPage as not all pages are concerned.
Therefor I use:

Page.Header.Controls.Add(new LiteralControl(@"<base target=""_self""
/>"));

Indeed - what I meant was that such things need to end up in the header
section and, since content pages don't have headers...

No biggie...
--
http://www.markrae.net

May 4 '07 #6

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

Similar topics

0
by: |-|erc | last post by:
<?php // Get the names and values for vars sent by index.lib.php3 if (isset($HTTP_GET_VARS)) { while(list($name,$value) = each($HTTP_GET_VARS)) { $$name = $value; }; };
3
by: Lars Schlanbusch | last post by:
Hi! Is there any way to set <base target="_blank"> for links which link to a page outside the domain, and <base target="_self"> for links which link to a page inside the domain? Can i do such...
4
by: John MacIntyre | last post by:
Hi, Using the script below, when you click on the radio button beside click here .... the first row shrinks. Has anybody else ever experienced this? Does anybody know of a logical...
2
by: Rez | last post by:
Hi Guys, I have a problem with exporting to excel from a modal dialog box. Basically, i have an ASPX page that gathers user criteria, and passes it to a dialogbox (showModalDialog), There is a...
7
by: Jack Gray | last post by:
I have a form requiring data input for all fields. When any field is left blank and the data is submitted, the cgi file generates a new form which is populated with data already input and an error...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.