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

How to change the title of a Web Form through code?

Hi newsgroup,

could someone please tell how to change the title of a
Web Form window through VB.NET code?

In VB 6 I would write Me.Caption="title",
and what is it in VB.NET??

Thanks for your help

Regards,
Frank
Jul 21 '05 #1
12 2470
KS
Look through the properties - find Text and see the value "Form1" - guess
what to do !

Me.Text="Title" - I would try that !

KS, Denmark

"Frank Lehmann" <f.******@world4net.com> skrev i en meddelelse
news:eI**************@TK2MSFTNGP12.phx.gbl...
Hi newsgroup,

could someone please tell how to change the title of a
Web Form window through VB.NET code?

In VB 6 I would write Me.Caption="title",
and what is it in VB.NET??

Thanks for your help

Regards,
Frank

Jul 21 '05 #2
Hi Keld,

I'm afraid Me.Text=.. is impossible. Text is not a property of Me
in this context.

Regards,
Frank
"KS" <ke************@os.dk> schrieb im Newsbeitrag news:e$**************@TK2MSFTNGP10.phx.gbl...
Look through the properties - find Text and see the value "Form1" - guess
what to do !

Me.Text="Title" - I would try that !

KS, Denmark

Jul 21 '05 #3
Try this :-

In the HEAD section of the ASP.NET page (.aspx) define the title as a server
side control:

<TITLE ID=PageTitle RUNAT=server></TITLE>

.... and in the code-behind (.aspx.vb) or inline code, define ...

Protected PageTitle As New HtmlGenericControl

.... and set the title from anywhere in the code as ...

Me.PageTitle.InnerText = "Hello World"

HTH,

--
- Paul Glavich
"Frank Lehmann" <f.******@world4net.com> wrote in message
news:#q**************@TK2MSFTNGP09.phx.gbl...
Hi Keld,

I'm afraid Me.Text=.. is impossible. Text is not a property of Me
in this context.

Regards,
Frank
"KS" <ke************@os.dk> schrieb im Newsbeitrag

news:e$**************@TK2MSFTNGP10.phx.gbl...
Look through the properties - find Text and see the value "Form1" - guess what to do !

Me.Text="Title" - I would try that !

KS, Denmark


Jul 21 '05 #4
Hi Keld,

Meanwhile I've found a smart solution myself:

http://www.developer.com/net/asp/article.php/2107811

Regards,
Frank
Jul 21 '05 #5
KS
Ooooooh - "WEB Form" - I did't see that - sorry !

KS, Denmark

"Frank Lehmann" <f.******@world4net.com> skrev i en meddelelse
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi Keld,

I'm afraid Me.Text=.. is impossible. Text is not a property of Me
in this context.

Regards,
Frank
"KS" <ke************@os.dk> schrieb im Newsbeitrag

news:e$**************@TK2MSFTNGP10.phx.gbl...
Look through the properties - find Text and see the value "Form1" - guess what to do !

Me.Text="Title" - I would try that !

KS, Denmark


Jul 21 '05 #6
Frank Lehmann <f.******@world4net.com> wrote:
I'm afraid Me.Text=.. is impossible. Text is not a property of Me
in this context.


In that case you'll have to tell us what the context is, as a form
definitely has a Text property, inherited from Control.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #7
Hi Jon,

A Web Form doesn't have a Text property as I could read at

http://www.developer.com/net/asp/article.php/2107811

They simply forgot it.

The given site was also the solution to my problem.

Regards,
Frank
"Jon Skeet [C# MVP]" <sk***@pobox.com> schrieb im Newsbeitrag
news:MP************************@msnews.microsoft.c om...
Frank Lehmann <f.******@world4net.com> wrote:
I'm afraid Me.Text=.. is impossible. Text is not a property of Me
in this context.


In that case you'll have to tell us what the context is, as a form
definitely has a Text property, inherited from Control.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #8
Hi newsgroup,

Thank you all for your help.

I've found a solution at

http://www.developer.com/net/asp/article.php/2107811

Regards,
Frank
Jul 21 '05 #9
Frank Lehmann <f.******@world4net.com> wrote:
A Web Form doesn't have a Text property as I could read at

http://www.developer.com/net/asp/article.php/2107811

They simply forgot it.


Ah, my mistake - a *web* form rather than a *windows* form. Sorry about
that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #10
Make the <title> as a server side tag (<title runat="server">). add a HTML Generic Control in code behind with same identity of Title.

Now set the value at code behind. thats it.

HTH
Sudhakar Sadasivuni
Microsoft MVP | MCAD
www.mugh.net
www.mvpblog.com

Jul 21 '05 #11
I tried posting this earlier, dont know why it didn't get to the list, but
try this :-

In the HEAD section of the ASP.NET page (.aspx) define the title as a server
side control:

<TITLE ID=PageTitle RUNAT=server></TITLE>

.... and in the code-behind (.aspx.vb) or inline code, define ...

Protected PageTitle As New HtmlGenericControl

.... and set the title from anywhere in the code as ...

Me.PageTitle.InnerText = "Hello World"
--
- Paul Glavich
"Frank Lehmann" <f.******@world4net.com> wrote in message
news:#q**************@TK2MSFTNGP09.phx.gbl...
Hi Keld,

I'm afraid Me.Text=.. is impossible. Text is not a property of Me
in this context.

Regards,
Frank
"KS" <ke************@os.dk> schrieb im Newsbeitrag

news:e$**************@TK2MSFTNGP10.phx.gbl...
Look through the properties - find Text and see the value "Form1" - guess what to do !

Me.Text="Title" - I would try that !

KS, Denmark


Jul 21 '05 #12
read this

http://authors.aspalliance.com/chris...sp?article=141

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

"Frank Lehmann" <f.******@world4net.com> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
Hi newsgroup,

could someone please tell how to change the title of a
Web Form window through VB.NET code?

In VB 6 I would write Me.Caption="title",
and what is it in VB.NET??

Thanks for your help

Regards,
Frank

Jul 21 '05 #13

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

Similar topics

1
by: Shayne H | last post by:
I want to be able to add a clock to the title of a VB.NET form. Simply updating the FormClass.Text property does not quite make it, the titile only changes once the form is minimised/maximised....
2
by: chichi | last post by:
Hi there! I was wondering if somebody could tell me how to edit the following ASP code so that the text within the tables appears as Font Color "00FF00". Right now it is appearing in BLACK and...
4
by: Christiaan | last post by:
I am trying to create a small javascript to change the button text and then submit it and do all kinds of form validations. So I have a button with the value "Save", when the button is clicked it...
34
by: Andrew DeFaria | last post by:
I thought this would be fairly straight forward but apparently it's not. Given the following html file: <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> <html> <head>...
3
by: Matt | last post by:
I want to change the label on the fly (when the user click the checkbox), but my attempt InputForm.lataLbl.value = "LATA * "; didn't work. Here's my code, any ideas? thanks !!! <html>...
4
by: DerekM | last post by:
I have a database project that I created with several forms and reports. I would like to be able to declare a single title and be able to change the title on all the forms and reports by changing...
5
by: Iver Erling Årva | last post by:
This works: Main window: <html> <head> <title>Untitled Document</title> <script> function openSub(){ window.open("Printwindow.htm","pw","height=200px, width=300px, left=300px, top=300px")
0
by: zeng.hui.stephen | last post by:
I download the demo http://msdn.microsoft.com/msdnmag/issues/02/10/cuttingedge/. I inherite the demo, and write my code. I want to use Hook to monitor C++ Edit change. I use a C# form...
6
by: gavy7210 | last post by:
hello i am using struts 1.2,Eclipse Platform Version: 3.4.2,mySql 5.0.1,jdk 1.5.. i have a login form(jsp) in which a user logs in,in case he doesnt enter his username and/or password an error...
5
by: thatcollegeguy | last post by:
Below are my 3php and 2js files. I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.