473,770 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing the document.title from a user control

I would like to change the <title></title> of a page from a user control. I
have been unable to find any property in VB that allows me to do this. The
only thing I have been able to find that might be related is when in Design
view, there is a property called title under the DOCUMENT object in
properties, which leads me to believe that there may be a way to access a
DOCUMENT.title somewhere (although that may be only for Javascript/JScript).
Does anyone know of a way to change the document title programmaticall y
using VB.NET in ASP.NET from a User Control? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
2 1950
Nathan,

Not the nicest stuff, although I am busy again at the moment with it.
(Don't set imports to this namespace).

http://msdn.microsoft.com/library/de.../reference.asp

It follows completly the DOM

I hope this helps,

Cor
Nov 19 '05 #2
Hi,

To be able to change the page title from an asp.net application add the
following to html portion of the aspx.

<HEAD>
<title runat="server" id="PageTitle"> </title>
......
</HEAD>

Note that if you make changes to the web page vb.net will drop the
runat=server. Make sure you add it back in or you wont be able to change the
page title

Add the following to the aspx.vb file

Protected PageTitle as new htmlgenericcont rol

To change the page title from the page

PageTitle.Inner Text= "My new page title"

To access this from a user control

Dim pagetitle as htmlgenericcont rol

Try
pagetitle=ctype (me.page.findco ntrol("PageTitl e"), htmlgenericcont rol)
pagetitle.inner text="Live from user control"
catch
end try

Ken
------------------------

"Nathan Sokalski" wrote:
I would like to change the <title></title> of a page from a user control. I
have been unable to find any property in VB that allows me to do this. The
only thing I have been able to find that might be related is when in Design
view, there is a property called title under the DOCUMENT object in
properties, which leads me to believe that there may be a way to access a
DOCUMENT.title somewhere (although that may be only for Javascript/JScript).
Does anyone know of a way to change the document title programmaticall y
using VB.NET in ASP.NET from a User Control? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #3

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

Similar topics

1
2433
by: TDN | last post by:
Hi, I expect to see "foo" for the 2nd alert. Instead, the value of select is cleared. Am I missing something? Thanks for your help. <html> <head><title>Foo</title> <script language="javascript"> <!-- function foo()
4
16215
by: Kenny | last post by:
I have been trying to write a script that will increase the size of and image when you mouse over it, and decrease it to original size, when you mouse out. After a couple of attempts, this is what I've come up with. In this example, there are 5 images (0 thru 4) all with a height of 80px. When you mouse over an image, it changes the growingImage variable equal to the number of the image you mouse over, when you mouse out, it sets it to 5,...
7
6594
by: Frostillicus | last post by:
Hi, I've written some javascript to randomly choose a classical music composer's picture and sample audio and display it on my home page (http://marc.fearby.com/), and this works fine in Mozilla but has problems in IE. Here's the code: imagestring = "<img src=\"" + imagedir + composers + "\" />"; objimage.innerHTML = imagestring;
31
4158
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and populating a simple table. I'd like the table to contain 10 entries per page and have the option for the user to scroll through the pages of data without having to go back to refresh the page (I've already pulled all the info I need from the...
5
1590
by: Carlo Marchesoni | last post by:
Is it possible to change the document's title property from code behind (c#) ? I need to build a dynamic title at runtime.
2
4102
by: Nathan Sokalski | last post by:
I would like to change the <title></title> of a page from a user control. I have been unable to find any property in VB that allows me to do this. The only thing I have been able to find that might be related is when in Design view, there is a property called title under the DOCUMENT object in properties, which leads me to believe that there may be a way to access a DOCUMENT.title somewhere (although that may be only for...
13
3030
by: amykimber | last post by:
Hi all, I know I'm doign something really daft, but I can't get this to work... I have a form with a bunch of inputs called ship_owner - why the ? Because I'm submitting this page though php and the put the data into an array in the post.... anywhat. I have a link <a href="javascript:change_class()" >Block mode</a> to
1
4532
by: rbinington | last post by:
Hi, I am trying to write a DNN module that has the ability to insert articles into an article repository. I want the users to be able to move pages around and enter text into the FCKEditor. I want only one instance of the FCKEditor on the screen at one time so I make tabs that the user can click and I store the values in variables behind the scenes. I change the CSS class on the link that is the currently selected one. I have a really...
4
3357
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters the comments and clicks the save button then the date and the date will be stored in the mysql database. This is working fine. But my problem is when, after the user had made an entry the date in the calendar for which an entry has made should be...
0
9617
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10099
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.