Forum Moderators: mack

Message Too Old, No Replies

Dynamic pages using ASP

how the contents are added to the dynamic pages

         

Navdeep

3:51 pm on Dec 1, 2003 (gmt 0)

10+ Year Member



hi all
i am new to website development i want to know how contents are added to dynamic pages using ASP. what are various tool that i can use to add contents to D-pages of my website.

macrost

5:46 pm on Dec 1, 2003 (gmt 0)

10+ Year Member



Navdeep,
Well about the easiest way to start into the world of asp is to start here. htt*://www.w3schools.com This should get you on your way.

Mac

Navdeep

10:57 am on Dec 2, 2003 (gmt 0)

10+ Year Member



mac
i am already working on asp, actually i want to learn the method to add meta information to dynamic pages. how is ASP used for this purpose.

mcavill

11:16 am on Dec 2, 2003 (gmt 0)

10+ Year Member



not sure if i've completely understood what you're after, but this sort of code would allow you to add dynamic meta information (i haven't tested it):

<%
Dim sVar
sVar = "Widgets" ' or your field from a recordset
%>

<html>
<head>
<title>Great Page about <%=sVar%></title>
<meta name="description" content="<%=sVar%> Information, history, resources and more">
</head>
<body>
<h1>Information about <%=sVar%></h1>
<body>
loads of great content
</body>
</html>

Navdeep

7:27 am on Dec 3, 2003 (gmt 0)

10+ Year Member



thanks mcavill,
i will let you know if this will work for my requirements. i am sure that i will work.

Navdeep

10:43 am on Dec 3, 2003 (gmt 0)

10+ Year Member



mcavill
i could'nt understand how will it work, please give me a little description about its working. i ll be thankful to you.

navdeep

mattur

4:45 pm on Dec 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Navdeep, perhaps if you gave a bit more information about what you're trying to do someone could give you some more help. (e.g. what do you mean by "meta information" - meta keyword and meta description tags?)

mcavill's example is just inserting the text in variable sVar into the html page returned to browsers.

If you work out what content+html you want the asp to generate, then where the content is coming from, building it into the page using similar syntax to the example should be straightforward.

Navdeep

10:55 am on Dec 4, 2003 (gmt 0)

10+ Year Member



i want to optimize dynamic pages of my website. both meta keywords and meta description tags are required but i want to enter meta keywords and description not directly mentioning them in the coding but to add them as the contents of the pages are added from the database

mattur

2:06 pm on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, so you need to build an sql query to pull all the info out of the database, then just use code broadly similar to the example above to render the page. What are you having problems with specifically?

Navdeep

5:34 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



mattur
so i just need to fire a sql query using above code to get the keywords on the page.
but my question is if i have to add specific keywords to around 100 different pages that are dynamically generated for different products on the website, then how can i add the keywords to all these dynamic pages. or i have to build a static page for each product.
navdeep

mattur

6:15 pm on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's an example of querying a database on the w3schools site here:
htt*://www.w3schools.com/ado/showasp.asp?filename=demo_display1

Assuming you have field names in your database called MetaDescrip and MetaKeywords, and each page has a unique ID, your sql will be something like:

SELECT MetaDescrip, MetaKeywords FROM <YourTable> WHERE ID=<YourPageID>

And then you can add them into your HTML page using code like this:

<meta name="description" content="<%=rs("MetaDescrip")%>">

<meta name="keywords" content="<%=rs("MetaKeywords")%>">

HTH

Navdeep

10:56 am on Dec 5, 2003 (gmt 0)

10+ Year Member



thanks mattur
thanks very much for all this information and help
i found this forum while searching on google and it is such a great help, especially to the beginners.
thanks alot you all.
navdeep