OK... how do I set the aspx page html title from my codebehind?
MTIA
wardeaux 13 1138
Hi Wardeaux,
Put a Web control between your <title> and </title> tags, then you could
reference that control from your codebehind to manipulate its output. (tip:
use the Literal web control)
Regards,
Nils Magnus Englund
"Wardeaux" <wa******@bellsouth.net> wrote in message
news:Ou**************@TK2MSFTNGP14.phx.gbl... OK... how do I set the aspx page html title from my codebehind? MTIA wardeaux
..aspx.cs
protected string _title;
_title = "Hello";
..aspx
<head>
<title><%=_title%></title>
</head>
MattC
"Wardeaux" <wa******@bellsouth.net> wrote in message
news:Ou**************@TK2MSFTNGP14.phx.gbl... OK... how do I set the aspx page html title from my codebehind? MTIA wardeaux
VS.NET 2003 has a bug that will remove runat="server" from
the <title> element when switching from design to code views.
--
<%= Clinton Gallagher, "Twice the Results -- Half the Cost"
Architectural & e-Business Consulting -- Software Development
NET cs*********@REMOVETHISTEXTmetromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"Wardeaux" <wa******@bellsouth.net> wrote in message
news:Ou**************@TK2MSFTNGP14.phx.gbl... OK... how do I set the aspx page html title from my codebehind? MTIA wardeaux
ehgads no...far better off to use the above suggestion, namely <title
runat="server" id="title" />
and
protected HtmlGenericControl title;
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/
"MattC" <m@m.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl... .aspx.cs protected string _title; _title = "Hello";
.aspx <head> <title><%=_title%></title> </head>
MattC
"Wardeaux" <wa******@bellsouth.net> wrote in message news:Ou**************@TK2MSFTNGP14.phx.gbl... OK... how do I set the aspx page html title from my codebehind? MTIA wardeaux
hey don't be sorry for asking this, this was also my first headache when
starting .Net and the reason is it requires quite a good knowledge of what's
really going on behind the curtains in .Net !
"Wardeaux" <wa******@bellsouth.net> wrote in message
news:Ou**************@TK2MSFTNGP14.phx.gbl... OK... how do I set the aspx page html title from my codebehind? MTIA wardeaux
HTML for your aspx
<title id="PageTitle" runat="server">My Page Title</Title>
code behind
Dim title As HtmlContainerControl
title = DirectCast(FindControl("PageTitle"), HtmlContainerControl)
title.InnerText = "My New Page Title"
HTH
Craig
"Wardeaux" <wa******@bellsouth.net> wrote in message
news:Ou**************@TK2MSFTNGP14.phx.gbl... OK... how do I set the aspx page html title from my codebehind? MTIA wardeaux
I use VS 2003 and runat="server" on my title tags with no problems, and I
constantly switch between design and code views.
Craig
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... VS.NET 2003 has a bug that will remove runat="server" from the <title> element when switching from design to code views.
-- <%= Clinton Gallagher, "Twice the Results -- Half the Cost" Architectural & e-Business Consulting -- Software Development NET cs*********@REMOVETHISTEXTmetromilwaukee.com URL http://www.metromilwaukee.com/clintongallagher/
"Wardeaux" <wa******@bellsouth.net> wrote in message news:Ou**************@TK2MSFTNGP14.phx.gbl... OK... how do I set the aspx page html title from my codebehind? MTIA wardeaux
I'd say you were a lucky freak of nature :-) as it happens to me
with regularity. There are discussions in newsgroups, forums, and
blogs that discovered and discuss this VS2003 bug.
<%= Clinton Gallagher
"Craig" <us**@domain.com> wrote in message
news:Dg*******************@tornado.tampabay.rr.com ... I use VS 2003 and runat="server" on my title tags with no problems, and I constantly switch between design and code views.
Craig
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... VS.NET 2003 has a bug that will remove runat="server" from the <title> element when switching from design to code views.
-- <%= Clinton Gallagher, "Twice the Results -- Half the Cost" Architectural & e-Business Consulting -- Software Development NET cs*********@REMOVETHISTEXTmetromilwaukee.com URL http://www.metromilwaukee.com/clintongallagher/
"Wardeaux" <wa******@bellsouth.net> wrote in message news:Ou**************@TK2MSFTNGP14.phx.gbl... OK... how do I set the aspx page html title from my codebehind? MTIA wardeaux
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:Iz*****************@twister.rdc-kc.rr.com... I'd say you were a lucky freak of nature :-) as it happens to me with regularity.
As a good friend tells me all the time, luck is the residue of good design.
:-) I have three development boxes on which I have never experienced this
bug. Do you have the Automatic Formatting and HTML Validation "features"
enabled for your html editor? I have mine turned off becuase quite frankly
they're stupid, and they wreck more than they fix.
Uncle Chutney loves your friend's proverb:
"Luck is the residue of good design."
He asked me to let you know.
--
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"Craig" <us**@domain.com> wrote in message
news:kh******************@tornado.tampabay.rr.com. .. "clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message news:Iz*****************@twister.rdc-kc.rr.com... I'd say you were a lucky freak of nature :-) as it happens to me with regularity. As a good friend tells me all the time, luck is the residue of good
design. :-) I have three development boxes on which I have never experienced this bug. Do you have the Automatic Formatting and HTML Validation "features" enabled for your html editor? I have mine turned off becuase quite
frankly they're stupid, and they wreck more than they fix.
You shouldn't be having trouble with this, but if you are - here's a
workaround:
declare a protected string in your codebehind with page scope
called, say, strTitle
Your title tag: <title><%=strTitle%></title> will render the
contents of this string which you can set anytime before page_unload.
Gerry
"Craig" <us**@domain.com> wrote in message
news:Dg*******************@tornado.tampabay.rr.com ... I use VS 2003 and runat="server" on my title tags with no problems, and I constantly switch between design and code views.
Craig
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... VS.NET 2003 has a bug that will remove runat="server" from the <title> element when switching from design to code views.
-- <%= Clinton Gallagher, "Twice the Results -- Half the Cost" Architectural & e-Business Consulting -- Software Development NET cs*********@REMOVETHISTEXTmetromilwaukee.com URL http://www.metromilwaukee.com/clintongallagher/
"Wardeaux" <wa******@bellsouth.net> wrote in message news:Ou**************@TK2MSFTNGP14.phx.gbl... > OK... how do I set the aspx page html title from my codebehind? > MTIA > wardeaux > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Peroq |
last post by:
Hi all
I'm not sure ASP is the problem, but my SQL statement seems fine to me.
This works fine :
strSQL = "SELECT .* FROM _RechPat INNER JOIN NivPatri ON
.cod_niv = NivPatri.cod_niv WHERE...
|
by: Tony Vasquez |
last post by:
First off, I am coding soley for IE 5.5+ right now. I am going to try to
later add code for other support of other browsers, but I doubt it will ever
support more than a few. The site is up at...
|
by: John Wiese |
last post by:
I am creating my first website and need some help desperatley. I have
choosen to use Front Page XP for this simple Intranet project. All I am
trying to do is:
1. Collect childrens names for a...
|
by: David Sworder |
last post by:
This message was already cross-posted to C# and ADO.NET, but I forgot to
post to this "general" group... sorry about that. It just occured to me
after my first post that the "general" group readers...
|
by: Xiangliang Meng |
last post by:
Hi.
void setValue(int n)
{
int size = getValueLength();
int buffer_p;
if (buffer_p)
{
....
|
by: sneill |
last post by:
I have read a number of posts on the use of eval() in Javascript, and I
agree that its use is questionable. But it does beg the following
question:
"How arbitrary does a string need to be before...
|
by: Brian |
last post by:
I am "learning" C# and have run into a problem that, though I can work around
it, I would like to know what the *right* way to handle the issue is.
I have created an "Info" struct and assigned...
|
by: Colin McGuire |
last post by:
Sorry to ask a simple question on syntax but the line inside the
subroutine "assignBitmapArray" won't compile giving me an "Expression
Expected" error. What is the correct syntax to initialize an...
|
by: Wardeaux |
last post by:
All,
How do I start another exe from my vb desktop app? want to create simple
setup wrapper that calls several setups in sequence...
MTIA
wardeaux
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |