469,626 Members | 826 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

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 817

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by wpy | last post: by
2 posts views Thread by Jorge Ayala | last post: by
1 post views Thread by Mike Smith | last post: by
5 posts views Thread by Trisha | last post: by
2 posts views Thread by Mark A. Sam | last post: by
5 posts views Thread by paul.hester | last post: by
1 post views Thread by rn5a | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.