473,382 Members | 1,380 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,382 software developers and data experts.

switching between HTML and ASPNET

Hi

I want to write de content of a variable from my asp net code into the Title
Bar of the Browser

each time I need to switch between those world (HTML-ASPNET) I suffer cause
I don’t have clear the boundaries in between

What alternatives do I have?
Where Can I find a good documentation about using or switching between HTML
and ASPNET, passing data, controlling html controls. etc

Thks

Apr 28 '06 #1
7 1335
If you set runat="server" in any HTML tag you can set it's properties in
server side code referencing it by ID. However you can do what you need to
do simply using the following in the Page_load event handler.

string PageTitle = "My Page";
Page.Title = PageTitle;

"Kenny M." wrote:
Hi

I want to write de content of a variable from my asp net code into the Title
Bar of the Browser

each time I need to switch between those world (HTML-ASPNET) I suffer cause
I don’t have clear the boundaries in between

What alternatives do I have?
Where Can I find a good documentation about using or switching between HTML
and ASPNET, passing data, controlling html controls. etc

Thks

Apr 28 '06 #2
Hi

Thanks for your answer but the first thing I did was looking for Title
property and there is not such property in the Page object, at lease I can
not find it..

I'm working in VB.NET

also I know that I can convert HTML controls to server controls, but how do
you manage sections like <HEAD><TITLE>?.
thks
--
Kenny M.

--
Kenny M.
"clickon" wrote:
If you set runat="server" in any HTML tag you can set it's properties in
server side code referencing it by ID. However you can do what you need to
do simply using the following in the Page_load event handler.

string PageTitle = "My Page";
Page.Title = PageTitle;

"Kenny M." wrote:
Hi

I want to write de content of a variable from my asp net code into the Title
Bar of the Browser

each time I need to switch between those world (HTML-ASPNET) I suffer cause
I don’t have clear the boundaries in between

What alternatives do I have?
Where Can I find a good documentation about using or switching between HTML
and ASPNET, passing data, controlling html controls. etc

Thks

Apr 28 '06 #3
I started with ASP.net 2.0 in which the page object has a title property,
maybe it doesn't in 1.1

To handle any HTML tag simply set runat="server" and give it an ID, then you
can set it's properties programatically via server side code.

e.g.

<head runat="server" id="myHead">

You can then set the title with MyHead.Title = "MyTitle";

As i say i have never used asp.net 1.1 so if this doesn't work for you maybe
it's time to upgrade.

"Kenny M." wrote:
Hi

Thanks for your answer but the first thing I did was looking for Title
property and there is not such property in the Page object, at lease I can
not find it..

I'm working in VB.NET

also I know that I can convert HTML controls to server controls, but how do
you manage sections like <HEAD><TITLE>?.
thks
--
Kenny M.

--
Kenny M.
"clickon" wrote:
If you set runat="server" in any HTML tag you can set it's properties in
server side code referencing it by ID. However you can do what you need to
do simply using the following in the Page_load event handler.

string PageTitle = "My Page";
Page.Title = PageTitle;

"Kenny M." wrote:
Hi

I want to write de content of a variable from my asp net code into the Title
Bar of the Browser

each time I need to switch between those world (HTML-ASPNET) I suffer cause
I don’t have clear the boundaries in between

What alternatives do I have?
Where Can I find a good documentation about using or switching between HTML
and ASPNET, passing data, controlling html controls. etc

Thks

Apr 28 '06 #4
Ok that works

I’m still looking for ways to work more directly between ASPNET and HTML
without convert, I remember something like <@# > to include asp controls
into the HTML etc, but I can find a tutorial so if you have one pass it to me.

I can not migrate because the company does not want to do it yet :/ anyway
thks.
--
Kenny M.

"clickon" wrote:
I started with ASP.net 2.0 in which the page object has a title property,
maybe it doesn't in 1.1

To handle any HTML tag simply set runat="server" and give it an ID, then you
can set it's properties programatically via server side code.

e.g.

<head runat="server" id="myHead">

You can then set the title with MyHead.Title = "MyTitle";

As i say i have never used asp.net 1.1 so if this doesn't work for you maybe
it's time to upgrade.

"Kenny M." wrote:
Hi

Thanks for your answer but the first thing I did was looking for Title
property and there is not such property in the Page object, at lease I can
not find it..

I'm working in VB.NET

also I know that I can convert HTML controls to server controls, but how do
you manage sections like <HEAD><TITLE>?.
thks
--
Kenny M.

--
Kenny M.
"clickon" wrote:
If you set runat="server" in any HTML tag you can set it's properties in
server side code referencing it by ID. However you can do what you need to
do simply using the following in the Page_load event handler.

string PageTitle = "My Page";
Page.Title = PageTitle;

"Kenny M." wrote:

> Hi
>
> I want to write de content of a variable from my asp net code into the Title
> Bar of the Browser
>
> each time I need to switch between those world (HTML-ASPNET) I suffer cause
> I don’t have clear the boundaries in between
>
> What alternatives do I have?
> Where Can I find a good documentation about using or switching between HTML
> and ASPNET, passing data, controlling html controls. etc
>
> Thks
>

Apr 28 '06 #5
Putting code within the HTML is the old, bad, classic ASP way of doing
things. ASP.net is object and event driven. So in short, apart from a
couple of exceptions such as binding things to controls in TemplateFields,
you do not do things the way you are suggesting, ASP.net it is simply not
designed that way. This is a good thing. The ASP.net way of doing things is
much better, and leads to much easier to understand, cleaner and more stable
code, that is much much easier to maintain in the long run.
"Kenny M." wrote:
Ok that works

I’m still looking for ways to work more directly between ASPNET and HTML
without convert, I remember something like <@# > to include asp controls
into the HTML etc, but I can find a tutorial so if you have one pass it to me.

I can not migrate because the company does not want to do it yet :/ anyway
thks.
--
Kenny M.

"clickon" wrote:
I started with ASP.net 2.0 in which the page object has a title property,
maybe it doesn't in 1.1

To handle any HTML tag simply set runat="server" and give it an ID, then you
can set it's properties programatically via server side code.

e.g.

<head runat="server" id="myHead">

You can then set the title with MyHead.Title = "MyTitle";

As i say i have never used asp.net 1.1 so if this doesn't work for you maybe
it's time to upgrade.

"Kenny M." wrote:
Hi

Thanks for your answer but the first thing I did was looking for Title
property and there is not such property in the Page object, at lease I can
not find it..

I'm working in VB.NET

also I know that I can convert HTML controls to server controls, but how do
you manage sections like <HEAD><TITLE>?.
thks
--
Kenny M.

--
Kenny M.
"clickon" wrote:

> If you set runat="server" in any HTML tag you can set it's properties in
> server side code referencing it by ID. However you can do what you need to
> do simply using the following in the Page_load event handler.
>
> string PageTitle = "My Page";
> Page.Title = PageTitle;
>
> "Kenny M." wrote:
>
> > Hi
> >
> > I want to write de content of a variable from my asp net code into the Title
> > Bar of the Browser
> >
> > each time I need to switch between those world (HTML-ASPNET) I suffer cause
> > I don’t have clear the boundaries in between
> >
> > What alternatives do I have?
> > Where Can I find a good documentation about using or switching between HTML
> > and ASPNET, passing data, controlling html controls. etc
> >
> > Thks
> >

Apr 28 '06 #6
Definitely you are right , some time I forget the philosophy of ASP.NET

thks

anyway talking about the same issue, when you set the runat and id words in
htmlcontrols those controls are recognized in .net code windows but for items
like HTML , TITLE or HEAD even you can set perfectly the attributes ASP1.1
does not recognized those elements in code.
--
Kenny M.
"clickon" wrote:
Putting code within the HTML is the old, bad, classic ASP way of doing
things. ASP.net is object and event driven. So in short, apart from a
couple of exceptions such as binding things to controls in TemplateFields,
you do not do things the way you are suggesting, ASP.net it is simply not
designed that way. This is a good thing. The ASP.net way of doing things is
much better, and leads to much easier to understand, cleaner and more stable
code, that is much much easier to maintain in the long run.
"Kenny M." wrote:
Ok that works

I’m still looking for ways to work more directly between ASPNET and HTML
without convert, I remember something like <@# > to include asp controls
into the HTML etc, but I can find a tutorial so if you have one pass it to me.

I can not migrate because the company does not want to do it yet :/ anyway
thks.
--
Kenny M.

"clickon" wrote:
I started with ASP.net 2.0 in which the page object has a title property,
maybe it doesn't in 1.1

To handle any HTML tag simply set runat="server" and give it an ID, then you
can set it's properties programatically via server side code.

e.g.

<head runat="server" id="myHead">

You can then set the title with MyHead.Title = "MyTitle";

As i say i have never used asp.net 1.1 so if this doesn't work for you maybe
it's time to upgrade.

"Kenny M." wrote:

> Hi
>
> Thanks for your answer but the first thing I did was looking for Title
> property and there is not such property in the Page object, at lease I can
> not find it..
>
> I'm working in VB.NET
>
> also I know that I can convert HTML controls to server controls, but how do
> you manage sections like <HEAD><TITLE>?.
>
>
> thks
> --
> Kenny M.
>
>
>
> --
> Kenny M.
>
>
> "clickon" wrote:
>
> > If you set runat="server" in any HTML tag you can set it's properties in
> > server side code referencing it by ID. However you can do what you need to
> > do simply using the following in the Page_load event handler.
> >
> > string PageTitle = "My Page";
> > Page.Title = PageTitle;
> >
> > "Kenny M." wrote:
> >
> > > Hi
> > >
> > > I want to write de content of a variable from my asp net code into the Title
> > > Bar of the Browser
> > >
> > > each time I need to switch between those world (HTML-ASPNET) I suffer cause
> > > I don’t have clear the boundaries in between
> > >
> > > What alternatives do I have?
> > > Where Can I find a good documentation about using or switching between HTML
> > > and ASPNET, passing data, controlling html controls. etc
> > >
> > > Thks
> > >

Apr 28 '06 #7
"Kenny M." <Ke****@discussions.microsoft.com> wrote in message
news:42**********************************@microsof t.com...
anyway talking about the same issue, when you set the runat and id words
in
htmlcontrols those controls are recognized in .net code windows but for
items
like HTML , TITLE or HEAD even you can set perfectly the attributes
ASP1.1
does not recognized those elements in code.


On your ASPX page...

<html>
<head>
<title><asp:Label ID=lblTitle Runat=server /></title>
</head>

<body>

</body>
</html>

On your class page...

protected Label lblTitle;

lblTitle.Text = "This is my page title";
Apr 29 '06 #8

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

Similar topics

2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
17
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control...
3
by: Rahul Agarwal | last post by:
Hi In our web page we use a combination of HTML and server side controls and some of them have a custom attribute based on which we need to find and replace the values once the HTML is ready. ...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
4
by: Jeremy Holt | last post by:
Hi, In a windows.forms application I would BeginInvoke a delegate on the UI thread to collect data from a database. When the call returns to the AsyncCallback, if the Control.InvokeRequired =...
7
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST" action="https://www.1234.com/trans_center/gateway/direct.cgi"> <input type="hidden" name="Merchant"...
4
by: m_evergreen | last post by:
I have what I think is a simple problem and yet I can't seem to find a solution. All I want to do is switch from one page to another within the same vb.net project. I expected frmThank.show to...
12
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation...
5
by: GaryDean | last post by:
Anyone know of html screen scrapper software that will work with .net projects. We need to get data back from a gov site that only provides it on a webpage. Thanks, Gary
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
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...
0
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,...
0
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...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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 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.