Repeater Control Question

R

Roshawn

Hi,

I have a Repeater control that contains a few web controls. It looks like
this:

<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate><asp:HyperLink id="HyperLink1" runat="Server"
navigateurl="<%# Container.DataItem("address") %>" text="<%#
Container.DataItem("Name") %> /></ItemTemplate>
<SeparatorTemplate>, </SeparatorTemplate>
</asp:Repeater>

I've designed it to work like a pager control. Now whenever a hyperlink is
clicked, I'd like to replace the selected hyperlink with a literal control.
Is there any way to accomplish this task?

Thanks,
Roshawn
 
R

Riki

Roshawn said:
Hi,

I have a Repeater control that contains a few web controls. It looks
like this:

<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate><asp:HyperLink id="HyperLink1" runat="Server"
navigateurl="<%# Container.DataItem("address") %>" text="<%#
Container.DataItem("Name") %> /></ItemTemplate>
<SeparatorTemplate>, </SeparatorTemplate>
</asp:Repeater>

I've designed it to work like a pager control. Now whenever a
hyperlink is clicked, I'd like to replace the selected hyperlink with
a literal control. Is there any way to accomplish this task?

If it's only to make it unclickable, set its NavigateUrl property to a blank
string.
 
Q

quaester

what I did for my code is to put both the hyperlink control and the literal
control in the ItemTemplate. And I just set the visible attribute accordingly
whenever I don't want any of it to show on client's screen. found this
solution to be short and clean.
btw, remember to replicate all you controls with in itemtemplate to
alternateitemtemplate both are suppose to be the same, it seems that you've
missed that out in your code pasted here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top