Document Object

  • Thread starter Thread starter John Smith Jr.
  • Start date Start date
J

John Smith Jr.

How do you obtain the document object programatically? (If you want to
change something like the title of the form programatically), I did it using
a literal before, but i was curious as I could not find a way to pick up the
document object in code.
 
No, trying to get the document object for a page so you can change the title
property of a page.
 
No, trying to get the document object for a page so you can change the
title property of a page.

Are you talking about ASP.Net, and setting the title of a web page.
If so, you're in the wrong newsgroup.

Anyway, the easiest way is probably to set the title tag itself to be a
control that you can manipulate in code.

<title id="titletag" runat="server"></title>

// and in code
protected HtmlGenericControl titletag;

public void Page_load()
{
titletag.InnerText = "My New Title";
}
 
Back
Top