473,325 Members | 2,442 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,325 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 2467
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
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: 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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.