Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

ASP newbie question

Posted 19 Mar 2002 13:46:47
1
has voted
19 Mar 2002 13:46:47 Peter Elkjaer posted:
Hello guys <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

On www.demenskonsulent.dk/oil/content.asp?title=products you see the "grey area" to the left.
I would like to have a "short-news-field" there, which is the same on all 5 pages (menus + default.asp).

But how is that done?
I have a table just for that field - do I create another recordset or what?

Help please.

Regards, Peter Elkjær

Replies

Replied 19 Mar 2002 20:19:40
19 Mar 2002 20:19:40 Rick Harding replied:
yep, create a new recordset from your news table. I'd create a HTML-table for the layout you want on the left (in case you want to display info such as date submitted or a category) and drag the fields from the Data Bindings over to the table. If necessary put a repeat region over it to get as many of the news articles as you would like to display.

Rick Harding
U of M CS Student / Network Admin for MSU FAME
"Techies just think differently...at least that's what they keep telling me"
Replied 20 Mar 2002 00:04:25
20 Mar 2002 00:04:25 Peter Elkjaer replied:
Hi Rick!

I think I tried that about a 100 times last night - but I gave it one last shot when you wrote it was the way to do it.
I can't explain it, but it worked with no problems whatsoever.

Thanks man 8D

&lt;-----------------------------------------&gt;

But now I have another problem. How do I update this "newsrecord" when I don't have any parameter on the recorsset?

(I have build a small CMS using the PD Editor - the other pages updates perfectly)

Peter - Denmark
Replied 20 Mar 2002 00:10:11
20 Mar 2002 00:10:11 Rick Harding replied:
Happy to help. Use it myself www.ricks-web.info

Rick Harding
U of M CS Student / Network Admin for MSU FAME
"Techies just think differently...at least that's what they keep telling me"
Replied 20 Mar 2002 23:04:19
20 Mar 2002 23:04:19 Dennis van Galen replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
But now I have another problem. How do I update this "newsrecord" when I don't have any parameter on the recorsset?

(I have build a small CMS using the PD Editor - the other pages updates perfectly)

Peter - Denmark
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Peter,

How are you selecting the newsitems now when you update them ?
Can't you just display the latest 3, on your product pages that displays the news you could have the news recordset get the records with a SQL statement like:
SELECT *
FROM NEWS
ORDER BY NewsID DESC

If you apply a repeat region set to 3 times then you will get the latest 3.
Currently I see the following items on your page:
20 march
19 march
18 march

if you have or make a news insert page and you insert the 21st march then your page would look like:
21 march
20 march
19 march
etc, always showing the latest 3, but i'm assuming you allready figured this out since i see the latest 3, unless there's only 3 in the dbase table...

Please explain in more detail why you can't update proper item without a parameter being present. Your product page gets all it's info from the SQL query, the update page needs to know what to update.

With kind regards,

Dennis van Galen
Webmaster KPN Services
Financial and Information Services
Replied 20 Mar 2002 23:32:53
20 Mar 2002 23:32:53 Peter Elkjaer replied:
Hi Dennis.

Well, I must admit that I am creating all this asp-shit in UD's designview <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> - my strong side is design and html only.

So I don't know really. For now I have solved my problem, -but now a hiddenfield displays the text ind my cms because I have no ID on the newstable... <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>

It's probably not the best way I have done it, but I'm learning ;D

Replied 20 Mar 2002 23:43:11
20 Mar 2002 23:43:11 Rick Harding replied:
I would suggest adding a autonumber field that uniquely identifies the record so you can pass it around. In this way you can create an edit page or a page where you can view just the single article and such. Holds true for most things.

Rick Harding
U of M CS Student / Network Admin for MSU FAME
"Techies just think differently...at least that's what they keep telling me"
Replied 20 Mar 2002 23:45:29
20 Mar 2002 23:45:29 Rick Harding replied:
I might also suggest keeping your view in the split view. Even if you don't use the code view, you might be suprised how much you can pick up just by seing it.

Rick Harding
U of M CS Student / Network Admin for MSU FAME
"Techies just think differently...at least that's what they keep telling me"
Replied 20 Mar 2002 23:45:59
20 Mar 2002 23:45:59 Dennis van Galen replied:
I strongly suggest you add a unique key field in your news table, then you can make a similar update page as you did with the other pages.
ie. a master list+detail page, the detail page would update and for insert you just use a insert record page, you stick the link to this page on your master+list where you select news item you want to update and yet another piece of your website-administration is done.

That reminds me...are you now using the simple repeat region table method or the dynamic menu way to update your products ? You can use the same principle for your news section, just add a uniqueID in your table.

You are overwriting the same 3 records everytime now ? the benefit of adding a unique key and keeping the news items is that you can create a news archive, if you want one that is.

With kind regards,

Dennis van Galen
Webmaster KPN Services
Financial and Information Services

Reply to this topic