how to pass parameter in address field of href tag in asp.net??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jay123
    New Member
    • Sep 2008
    • 121

    #1

    how to pass parameter in address field of href tag in asp.net??

    hello everyone,
    what i am trying to do is pass a value in
    Code:
    <a href="abc.aspx?id=123">
    but instead of giving that abc.aspx link here, i want to give job.webpage(whe re job is class with webpage property) ,
    as this <a> tag is in repeater so depending on the value in repeater my page should be redirected to job.webpage(whi ch stores the url of page) ..

    hope i am clear..

    any help would b appreciated.
    Last edited by jay123; Oct 1 '08, 11:07 AM. Reason: found the answer
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    I'm not entirely sure about what your problem is.
    When you are creating the data source for the Repeater you should use the DataBinder.Eval method to retrieve the value stored within the Job.webpage property....I'm assuming that your repeater is databinding to a list of Job ojects...

    Eg:
    [code=asp]
    <asp:Repeter ID="theRepeter " runat="server">
    <ItemTemplate >
    <!--.......-->
    <a href="<%# DataBinder.Eval (Container.Data Item,"webPage") %>">linky</a>
    <!--.......-->
    </ItemTemplate>
    </Repeater>
    [/code]

    Comment

    • jay123
      New Member
      • Sep 2008
      • 121

      #3
      Originally posted by Frinavale
      I'm not entirely sure about what your problem is.
      When you are creating the data source for the Repeater you should use the DataBinder.Eval method to retrieve the value stored within the Job.webpage property....I'm assuming that your repeater is databinding to a list of Job ojects...

      Eg:
      [code=asp]
      <asp:Repeter ID="theRepeter " runat="server">
      <ItemTemplate >
      <!--.......-->
      <a href="<%# DataBinder.Eval (Container.Data Item,"webPage") %>">linky</a>
      <!--.......-->
      </ItemTemplate>
      </Repeater>
      [/code]
      thanks, it worked.. exactly what i wanted..

      Comment

      Working...