G
Guest
Hello,
I use VB.NET and have a series of linkbuttons that are inside individual
<td>s. Like this:
<td background="image.gif"><asp:linkbutton id="myID" runat="server"/></td>
I would like the background of the td to be different for the currently
selected linkbutton than for the other linkbuttons:
<td background="image1.gif"><asp:linkbutton id="myID1" runat="server"/> </td>
<td background="image2.gif"><asp:linkbutton id="myID2" runat="server"/></td>
<td background="image2.gif"><asp:linkbutton id="myID3" runat="server"/></td>
I tried several things before posting. First I tried to create a
<asp:literal/> and refer to that literal in by aspx.vb file. Thus I wanted
to programatically specify the image that would be displayed in the
background of my <td>:
If ...then
myLiteral = "<td background='image1.gif'><asp:linkbutton id='myID'
runat='server'/> </td>"
else
myLiteral = "<td background='image2.gif'><asp:linkbutton id='myID'
runat='server'/> </td>"
end if
This suffers from the problem that I can't refer to a linkbutton in my
literal without first having a tag appear in the html part of the .aspx code,
since the tag needs to be inside the <td>. See "Linkbutton Constructor" in
the .net framework class library.
Next I tried to do it by placing my linkbutton in the html portion of the
..aspx file by placing it inside a <asp:table>:
<asp:table>
<asp:tablerow>
<asp:tablecell>
<asp:linkbutton id=...>
</asp:tablecell>
</asp:tablerow>
</asp:table>
My hope was that I could then programatically specify the property of
<asp:tablecell>. This too suffered from the problem that my linkbutton could
not be contained in this <asp:table> arrangement.
Any help is sure appreaciated.
Thanks,
Gil
I use VB.NET and have a series of linkbuttons that are inside individual
<td>s. Like this:
<td background="image.gif"><asp:linkbutton id="myID" runat="server"/></td>
I would like the background of the td to be different for the currently
selected linkbutton than for the other linkbuttons:
<td background="image1.gif"><asp:linkbutton id="myID1" runat="server"/> </td>
<td background="image2.gif"><asp:linkbutton id="myID2" runat="server"/></td>
<td background="image2.gif"><asp:linkbutton id="myID3" runat="server"/></td>
I tried several things before posting. First I tried to create a
<asp:literal/> and refer to that literal in by aspx.vb file. Thus I wanted
to programatically specify the image that would be displayed in the
background of my <td>:
If ...then
myLiteral = "<td background='image1.gif'><asp:linkbutton id='myID'
runat='server'/> </td>"
else
myLiteral = "<td background='image2.gif'><asp:linkbutton id='myID'
runat='server'/> </td>"
end if
This suffers from the problem that I can't refer to a linkbutton in my
literal without first having a tag appear in the html part of the .aspx code,
since the tag needs to be inside the <td>. See "Linkbutton Constructor" in
the .net framework class library.
Next I tried to do it by placing my linkbutton in the html portion of the
..aspx file by placing it inside a <asp:table>:
<asp:table>
<asp:tablerow>
<asp:tablecell>
<asp:linkbutton id=...>
</asp:tablecell>
</asp:tablerow>
</asp:table>
My hope was that I could then programatically specify the property of
<asp:tablecell>. This too suffered from the problem that my linkbutton could
not be contained in this <asp:table> arrangement.
Any help is sure appreaciated.
Thanks,
Gil