Forum Moderators: open
So for instance, you will have a number of users who enter keywords on their accounts which are separated by commas (example: music, dance, chat, property).
When someone looks at a user profile they will see those words as links that they can click on and find other users with those keywords.
I know everything else, I just need to know how to make the keywords show up as links.
I am using an Access dbase as this is just a test phase. Can I use a 'memo' field?
If anyone has any info or links to somewhere that has info please let me know.
Any questions just give me a bell.
Thanks for any help.
Something like this:
Add a literal to the Page <asp:Literal ID="Literal1" runat="server" />
Add this to the Code Behind
string myKeywords = "music, dance, chat, property"; // this would come from the DB
string[] myList = myKeywords.Split(','); // Split the keywords
foreach (string myKeyword in myList)
{
Literal1.Text += String.Format("<a href='/search.aspx?query={0}'>{0}</a>, ", myKeyword.Trim());
}
[edited by: marcel at 9:03 am (utc) on Sep. 18, 2009]
Here is an example of what I'm looking for. I hope I can post links like this, if not, I apologise. If you go <snip> and scroll down to the 'Services' > 'I have' and 'I want' area you can see what I mean.
I know the sites not in C ASP but these words have all been entered into a text area and show up as links.
I hope this gives you a better idea of what I'm looking for.
[edited by: marcel at 8:48 am (utc) on Sep. 18, 2009]
[edit reason] Removed URL [/edit]
Basically I would still do the same, save all of the keywords in a database field as a comma separated list, and then create URL's from them as they are retrieved from the Database.
Something like this:
Dim myKeywords
myKeywords = "music, dance, chat, property"Dim myKeywordArray
myKeywordArray = Split(myKeywords, ",")For i = 0 to UBound(myKeywordArray)
response.write "<a href='/Search.asp?query=" & Trim(myKeywordArray(i)) & "'>" & Trim(myKeywordArray(i)) & "</a>, "
Next
I tried searching for the records where the keywords field was like my keyword but because there are a number of keywords, again, separated by commas it is giving me a cannot find record error.
Does anyone know of a way I can code the search results page? This is an area I haven't really ventured into so I'm not 100% on it.
Please help :(