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

dynamic table with linkbuttons

8
Hi.

I need to do a Control that accesses a DB and generates a table with one linkbutton per row (using the linkbutton command name and command argument). The table content fetched from the DB will change according to the linkbutton the user clicks (like a forum where you click a forum and then you see that forum sub forums).

Is there any way i can do this without doing 2 DB accesses (one in the init to set up the linkbuttons so their events fire, and another after the event, to fetch the user selected data)?

Thanks in advance.
Feb 10 '09 #1
5 1964
jhardman
3,406 Expert 2GB
Xend,

Can you please confirm that you intended to post in the "classic" ASP forum? It sounds like you intended to post in the ASP.NET forum and posted here on accident.

Jared, moderator
classic ASP forum
Feb 11 '09 #2
xend
8
Yap my mistake.

How do i move the thread?

Can some move it please?
Feb 11 '09 #3
Frinavale
9,735 Expert Mod 8TB
Hi Xend,

Are you using a GridView to display your data?
All you have to do is specify TemplateField to display the first column as LinkButtons.

If you want to have more control over the template data, and you want to do this dynamically, or you're not using a GridView control to display your data, you'll be interested in looking up how to implement the ITemplate Interface.
Feb 11 '09 #4
xend
8
I am not using GridView. I am generating the table manually (deriving from control and overriding the render method). I assume that GridView keeps track of the linkbuttons through ViewState, am i right? Right now i am using a hidden field and creating anchor tags that run java script and place the command argument in the hidden field and force a postback.
Feb 12 '09 #5
Frinavale
9,735 Expert Mod 8TB
You don't have to use a GridView. You could use anything really. For creating tables the Repeater is a good control to use. Look into creating a Templated Control.
Feb 13 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: CodeRazor | last post by:
I am creating an aspx page using C# and would like to be able to dynamically create linkbuttons that all run the same fuction on the click event. However, I would like the function to accept a...
0
by: RSB | last post by:
Hi Every one, i am trying to create a UserControl and i am passing a Array of strings to it. Now based on the Array elements i am creating the LinkButtons Dynamically. I am also passing a Event to...
2
by: hn | last post by:
Hi, I have linkbuttons created dynamically and they display fine on the web page. However, when I click on the those link buttons, the event doesn't fire. Please tell me what's wrong with the...
1
by: Homam | last post by:
So I have a composite paging control that shoulld be positioned on the page like this: PagNav ResultSetDisplay PagNav I know that I can't resuse the PagNav more than once in the form, so I...
3
by: WebBuilder451 | last post by:
I have a series of dynamic link buttons created based upon a datareader. I've added a click event and it calls the sub ok: example: "while loop through the reader" Dim ltrCtrl As New...
6
by: Andrew Robinson | last post by:
I have a page that contains a number of link buttons that are used for making selections. I load my LinkButtons during the Page_PreInit event and they render fine but then I need to make a change...
1
by: Andrew Robinson | last post by:
I have a <asp:table> control with a large number of dynamically created LinkButtons. I am using the command event, command name and command argument values in my LinkButtons to trigger actions...
13
by: rn5a | last post by:
In a shopping cart app, suppose a user has placed 5 orders, I want to show him 5 LinkButtons (one for each order) so that when he clicks the first LinkButton, he would be shown the details of his...
0
by: Gui | last post by:
Hi, I'm working in C# .net 2005 with Ajax. I have a page that loads dynamic user controls depending on the scenario. In those user controls, I create dynamic linkbuttons. The user controls are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.