| | |
Dynamically udate "News articles"
Please support our ASP advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
Ok - I have never used ASP before. I'm pretty hardcore with (x)HTML, JavaScript, CSS, and I also know C++.
Here's the thing - I need to create some sort of code that receives information from the back end of a site and dynamically adds a link on an overview page of that new article and also creates a new webpage with the article on it.
I'm not quite sure where to start or how to go about doing this. If anyone could give me a push in how to get started or maybe explain how the code would work?
**The link will reside on a page built with HTML**
Any help is greatly appreciated....
If necessary I'll use PHP (but I don't have any experience with that either
)
Thanks!
Here's the thing - I need to create some sort of code that receives information from the back end of a site and dynamically adds a link on an overview page of that new article and also creates a new webpage with the article on it.
I'm not quite sure where to start or how to go about doing this. If anyone could give me a push in how to get started or maybe explain how the code would work?
**The link will reside on a page built with HTML**
Any help is greatly appreciated....
If necessary I'll use PHP (but I don't have any experience with that either
)Thanks!
Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining.
~Jef Raskin
~Jef Raskin
•
•
Join Date: Jan 2009
Posts: 11
Reputation:
Solved Threads: 0
With your overview page have a sql statement that creates the links. To do this have one of your columns in the database table reference the title of the article. Then when calling the title also request the primary key from the database for that article.
Create a do until end of record set and populate the page with anchors created from this data:
If you want to get fancy you can add another row under the link to show the first part of the article and use CSS to make the link to the article the same colour text as the rest of your page.
In the page I called ShowArtical.asp you will need to grab the Article_ID from the query string
Create another SQL statement where your ID column equals the Article_ID variable
SELECT A_Title, A_Body, A_ID
FROM Article
WHERE A_ID = Article_ID
Open your database and create a record set.
Place the data from the record set how you want it formatted within the page
If I understood your question correctly that’s about it. ShowArtical.asp will be used for all the articles. You may also want to put a date column in the database so you can query only articles written within a certain timeframe. You may also want a page that has a text box for the title and body of a new article to insert into the database.
Create a do until end of record set and populate the page with anchors created from this data:
ASP Syntax (Toggle Plain Text)
[Inside table] Do Until objRS.EOF Response.Write "<td><a href ='ShowArtical.asp?Artical="&rs(“Article_ID”)&" '>”&objRS(“article_Name”)&”</a></td>" objRS.Move.Next Loop [Inside table]
In the page I called ShowArtical.asp you will need to grab the Article_ID from the query string
ASP Syntax (Toggle Plain Text)
Article_ID = Request.QueryString("Article_ID ")
SELECT A_Title, A_Body, A_ID
FROM Article
WHERE A_ID = Article_ID
Open your database and create a record set.
Place the data from the record set how you want it formatted within the page
ASP Syntax (Toggle Plain Text)
[Inside table] Response.Write "<tr>" Response.Write "<td>” & objRS(“A_Title”) & “</td>" Response.Write "<tr>" Response.Write "<td >” & objRS(“A_Body”) & “</td>" Response.Write "<tr>" [Inside table]
![]() |
Similar Threads
- ";:<script><html>< // >@@#"; (PHP)
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- binding datagrid dynamically with "add button" (ASP.NET)
- sorting the "news" (C)
- Google "Beta" News in Israel (Search Engine Optimization)
- Latest News or Even old news gets updated on the site? Where to get the news articles (Existing Scripts)
- Displaying News Articles (PHP)
Other Threads in the ASP Forum
- Previous Thread: blabla.com/content/blabla/
- Next Thread: User Authorization & Roles in ASP.Net while using MySQL
| Thread Tools | Search this Thread |
archive asp aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection





