473,386 Members | 1,830 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,386 software developers and data experts.

Help please Creating web page of links and content

Hello,
i'm looking to create an aspx page that is basically a FAQ page
i'm not sure if this can be done, but would love some help with
suggestions of how to do it another way if this is not possible

on the aspx page i have a table with 1 row and 2 columns in it, in the
column on the left i have an asp:label, lblLinks and in the column on
the right i have another asp:label, lblBody

i'm reading the content of the links and body from the database
i'd like to be able to dynamically create the links, so i was creating
them like this is a dataSet loop:
"<a href="FAQ.aspx?section=" + drRow.Item("Section") + ">" +
drRow.Item("Section") + "</a>"

this isn't working because i'm not using frames, what i'd like to do
is have an onClick of this link that calls a codebehind function that
then fills the lblBody with the content read from the database.

my main question is how i can dynamically create link and have them
once clicked call the codebehind to fill another label with something
else read from the database.

thank you for any help

Feb 27 '06 #1
3 1449
one other thing i thought i of, but don't believe it will work, is to
create asp:LinkButton's instead of regular hyperlinks. but since
these would be created on the fly in the codebehind, i wouldn't think
that would be allowed because i assume the asp.net elements need to be
already coded on the page so they can be registered when the page
compiles?
maybe i'm making a mountain out of a molehill :) thanks for any help

i'm reading the content of the links and body from the database
i'd like to be able to dynamically create the links, so i was creating
them like this is a dataSet loop:
"<a href="FAQ.aspx?section=" + drRow.Item("Section") + ">" +
drRow.Item("Section") + "</a>"

this isn't working because i'm not using frames, what i'd like to do
is have an onClick of this link that calls a codebehind function that
then fills the lblBody with the content read from the database.


Feb 27 '06 #2
I should probably have all my thought and attempts done before
replying, but i tried this and wanted to post what happened. code
below does display the info i want (link names), but the links are not
active, it is only text displayed

Dim i As Integer
i = 1
For Each drRow In copyDataSet.Tables(0).Rows
lblLinks.Text = lblLinks.Text + _
"<asp:LinkButton id=LinkButton" + i.ToString() + "
runat=server>" + drRow.Item("Section") + "</asp:LinkButton> <br>"
i += 1
Next

when i look at the source (right-click, view source) the linkbuttons
are created (or at least the correct text that would define a
linkbutton), but it is just text, nothing active. so i'm assuming my
theory of creating objects on the fly this way can't be done (at least
the way i'm trying)?
thanks, i'll wait to reply before filling up this thread myself :)
appreciate any advice....

one other thing i thought i of, but don't believe it will work, is to
create asp:LinkButton's instead of regular hyperlinks. but since
these would be created on the fly in the codebehind, i wouldn't think
that would be allowed because i assume the asp.net elements need to be
already coded on the page so they can be registered when the page
compiles?
maybe i'm making a mountain out of a molehill :) thanks for any help

i'm reading the content of the links and body from the database
i'd like to be able to dynamically create the links, so i was creating
them like this is a dataSet loop:
"<a href="FAQ.aspx?section=" + drRow.Item("Section") + ">" +
drRow.Item("Section") + "</a>"

this isn't working because i'm not using frames, what i'd like to do
is have an onClick of this link that calls a codebehind function that
then fills the lblBody with the content read from the database.


Feb 27 '06 #3
CMM
Use the Repeater control.
http://msdn.microsoft.com/library/de...ebcontrols.asp
On postback, on the click event for an item, you'll be able to tell which
item was clicked. SmartNavigation (if it's enabled) will allow you do what
you want (show expanded information) without having it look like the user
has reloaded the page.

--
-C. Moya
www.cmoya.com

"simon" <me@here.com> wrote in message
news:j7********************************@4ax.com...
I should probably have all my thought and attempts done before
replying, but i tried this and wanted to post what happened. code
below does display the info i want (link names), but the links are not
active, it is only text displayed

Dim i As Integer
i = 1
For Each drRow In copyDataSet.Tables(0).Rows
lblLinks.Text = lblLinks.Text + _
"<asp:LinkButton id=LinkButton" + i.ToString() + "
runat=server>" + drRow.Item("Section") + "</asp:LinkButton> <br>"
i += 1
Next

when i look at the source (right-click, view source) the linkbuttons
are created (or at least the correct text that would define a
linkbutton), but it is just text, nothing active. so i'm assuming my
theory of creating objects on the fly this way can't be done (at least
the way i'm trying)?
thanks, i'll wait to reply before filling up this thread myself :)
appreciate any advice....

one other thing i thought i of, but don't believe it will work, is to
create asp:LinkButton's instead of regular hyperlinks. but since
these would be created on the fly in the codebehind, i wouldn't think
that would be allowed because i assume the asp.net elements need to be
already coded on the page so they can be registered when the page
compiles?
maybe i'm making a mountain out of a molehill :) thanks for any help

i'm reading the content of the links and body from the database
i'd like to be able to dynamically create the links, so i was creating
them like this is a dataSet loop:
"<a href="FAQ.aspx?section=" + drRow.Item("Section") + ">" +
drRow.Item("Section") + "</a>"

this isn't working because i'm not using frames, what i'd like to do
is have an onClick of this link that calls a codebehind function that
then fills the lblBody with the content read from the database.

Feb 28 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Keith Morris | last post by:
Hi all! I'm creating a mini CMS that will store content in a MySQL database. What I am trying to do is parse the content and replace certain keywords with a link. The keywords and associated...
14
by: Akbar | last post by:
Hey there, Big-time curiosity issue here... Here's the test code (it's not that long)... it's to display a large number of image links with captions, ideally pulled in from an external file...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: suzy | last post by:
hi, i have created a aspx page template by creating a template.cs file which inherits from the page class. In this file I override the OnInit event and create a template in the form of a...
1
by: simon | last post by:
Hello, i'm looking to create an aspx page that is basically a FAQ page i'm not sure if this can be done, but would love some help with suggestions of how to do it another way if this is not...
4
by: Learner | last post by:
Hello, Here is a little bit of what I am working ... I have selected Header and Side lay out for my Master Page. All my links go on the Side and the content on to the right pane. I have no...
8
by: Dhananjay | last post by:
hello everyone Do you have any information how to generate a tool using .net which is used to translate the web page contents to html format. Plz reply me asap Thanks in advance Dhananjay
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
by: magicofureyes | last post by:
Hello Guys im a just a new user and i dnt knw much abt Xml i want to upload a new template in Blogger so got some free coding but when i save this code in Blogger template it say '''' Your...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.