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

Literal control combined with linkbuttons question

dgk
I'm adapting some code that wrote out html pages to work in dotnet and
be dynamic rather than static. Currently, a page is presented with a
table containing quite a few rows and columns. One of those columns is
a short description of the item. If there is extended information for
the item, the text is a hyperlink to a static webpage.

I found that the Literal control works great for just writing out the
table, but slipping a linkbutton in there in order to create the
detail page on the fly is tricky and perhaps not possible. I viewed
the source of pages with linkbuttons and can now create the necessary
html code and I can even get it to call an event handler (by using one
real linkbutton). But, there is no way to get a unique commandname or
other distinguishing property so I can't tell what linkbutton was
pressed. That data is not passed to the html/javascript and must be
stored in the project dll.

This is how I'm stuffing the linkbutton into the page. Note that q is
chr(34), a quote character:

DescField = "<a id=" & q & "LinkButton" & Links.ToString & q & "
href=" & q & "javascript:__doPostBack('LinkButton1','')" & q & ">" &
myRS.Item("RDesc").ToString & "</a>"

So, is there a way to make this work?

I could fall back to the static html pages that I used before because
slipping in a hyperlink is easy. But that wouldn't be very elegant. I
can also redo the whole thing and use a datagrid, datalist, or
repeater but I don't think I could be as flexible as I am just writing
the code myself. I'll probably do that just to see how it works. But,
I'm just being a bit stubborn and was wondering what could be done to
stuff the required info into the javascript or dll.
Nov 20 '05 #1
0 876

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

Similar topics

1
by: wpy | last post by:
Hi, Does anybody know how to create multiple control with same ID or name in asp.net and request the controls's value in array form? For example the vb control can have same same but with...
2
by: Jorge Ayala | last post by:
Well I'm trying to catch and act upon a button event that is placed within the item template of a repeater control. Yet the code I'm using isn't working. What I've seen out there to explain how...
1
by: Dan | last post by:
I have an asp.net page default.aspx with a user control and a placeholder control. <html> <body> <form id="myform" method="post" runat="server" /> <PageHeader:Header id="header1"...
1
by: Mike Smith | last post by:
I am attempting to create a dynamic multi-level tab strip from a database using linkbuttons. I can get the controls added to the page on the first page load, but on post back I get the mutiple...
5
by: Trisha | last post by:
I have a navigation user control navig.ascx that redirects to respective pages based on webcontrols.linkbutton clicks using response.redirect. I would like to control the look and feel of those...
2
by: Mark A. Sam | last post by:
Hello, I want to use a literal control to provide information about people listed on a webpage, where the control is on the same line as the person it addresses, so that I have a button, the...
5
by: paul.hester | last post by:
Hi all, I have a custom control with an overridden Render method. Inside this method I'm rendering each control in its collection using their RenderControl method. However, I'm running into a...
0
by: Walter | last post by:
Hi, can someone please help me with my custom control viewstate problem....I haven't slept for hours trying to get this fixed. I am making two custom controls which will be included on a single...
1
by: rn5a | last post by:
This is how I am populating a Panel with dynamic LinkButtons (the no. of LinkButtons that will be created will depend upon the no. of orders a user has placed): Sub Page_Init(obj As Object, ea...
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:
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,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.