473,324 Members | 2,501 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,324 software developers and data experts.

Dynamic page title in AP

23
Is it possible to have dynamic page titles with an ASP site? Many people would like to share our content on facebook, but can't do so because the page titles are displayed as the URL.

I'm not very familiar with ASP, so any help would be greatly appreciated.
Aug 23 '11 #1
3 3871
jhardman
3,406 Expert 2GB
yes.

With ASP your script creates the code of the web page. Not just the text of the web page, but the underlying code as well. so it is easy to say
Expand|Select|Wrap|Line Numbers
  1. if session(var1) = "current" then
  2.    response.write "<title>A nifty web page</title>" & vbNewLine
  3. else
  4.    response.write "<title>An ordinary web page</title>" & vbNewLine
  5. end if 
  6.  
  7. 'or
  8.  
  9. <title><%=userName%>'s home page</title>
Let me know if this answers your question.

Jared
Aug 29 '11 #2
user65
23
Expand|Select|Wrap|Line Numbers
  1. <title><%=userName%>'s home page</title>
I am not too familiar with ASP/Microsoft SQL. What should I be looking to replace the userName variable with? Can I use a variable from the database to plug in here?
Aug 29 '11 #3
jhardman
3,406 Expert 2GB
yes, that would work. Using database fields it would look something like this
Expand|Select|Wrap|Line Numbers
  1. <title><%=rs("fname") & " " & rs("lname")%>'s home page</title>
the code <%= %> just prints out the value of whatever variable you put in there.

At this point, it sounds like there are still several missing pieces of information between you and your final solution, and it is hard for me to see what you are still missing. You might want to check out w3schools.com, they have a fairly broad library of tutorials and examples. Of course you can keep firing your questions at me and I will continue to help answering them.

Jared
Aug 29 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: the wonderer | last post by:
This is an elementary question, but I've not been able to find the answer, so here goes: I am developing a site using php. I have the html header information in a file that I include in all the...
6
by: Don Grover | last post by:
How can I get the page title into an variable to handle in my asp. Don
5
by: Maxim Izbrodin | last post by:
Hello For displaying page titles for my ASP.NET applications I use the following technique <title><%=BannerModule.PageTitle%></title where BannerModule.PageTitle is a public field of my user...
5
by: Mark | last post by:
I'm interested in displaying a dynamic page title, rather than the static html <title>My Page</title>. In a previous posting, I had seen a suggestion of making the title into a server control...
14
by: Paul | last post by:
I want to set the page title and/or a form hidden field programatically through ASP.Net. I do not want to use something like... <% sTitle ="My Title" %> <html><title><%=sTitle%></title>..... ...
0
by: Abraham Andres Luna | last post by:
hello everyone, i just wanted to know if there was a workaround, or maybe it's just a bug. i have a master page: basepage.master <%@ Master %> <html> <head runat="server"> <title>CRM...
1
by: rn5a | last post by:
I am using the Title property of the Page class in the Page_Load event to set the title of the page so that the browser displays appropriate titles. <html> <head runat="server"> <script...
6
by: RoomfulExpress | last post by:
Here's the problem that I'm having- I'm trying to pull in 2 fields from my database and place them in the title of the HTML. I'm connecting to the db and selecting everything exactly the same as I am...
2
by: googletired | last post by:
I have run into a small problem (well I hope it's a small problem) On every page of my .ASP website the page has a set name <title><%If strLang = "en" or strLang = "" THEN response.write "blah...
3
by: fran7 | last post by:
Hi, When I put asp in my title and description, I get a type mismatch error. I dont get it when the page has the full database address like so http://www.mysite.com/page.asp?Author=aaaa%20aaaaaaa...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
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.