Repeater Control Question

Discussion in 'ASP .Net Web Controls' started by Roshawn, Mar 6, 2005.

  1. Roshawn

    Roshawn Guest

    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
    Roshawn, Mar 6, 2005
    #1
    1. Advertising

  2. Roshawn

    Riki Guest

    Roshawn wrote:
    > 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.

    --

    Riki
    Riki, Mar 6, 2005
    #2
    1. Advertising

  3. Roshawn

    quaester Guest

    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.

    "Roshawn" wrote:

    > 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
    >
    >
    >
    quaester, Mar 9, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    854
  2. Replies:
    0
    Views:
    2,881
  3. Replies:
    1
    Views:
    7,025
    Karl Seguin
    Aug 10, 2005
  4. uncensored
    Replies:
    0
    Views:
    815
    uncensored
    Oct 25, 2006
  5. Microsoft

    Repeater inside a Repeater

    Microsoft, Aug 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    207
    Microsoft
    Aug 21, 2006
Loading...

Share This Page