[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

C# Anchor tag

Posted on 2004-08-06
3
Medium Priority
?
2,645 Views
Last Modified: 2011-10-03
Hi all

I am new to C# i am using repeater control to display data the code is as follow. I need to assign  customerid in the anchor tag can anyone help me.


<tr><td colspan=4><ASP:Repeater id="MyRepeater" runat="server">
      <HeaderTemplate>
         <table width=600 border=1 frame="void" bordercolordark="#FFFFFF" bordercolorlight="#cccccc" rules="rows">
            <tr class='barbg' align=left >
               <th class="titlehead">
                  &nbsp;Name
               </th>
               <th class="titlehead">
                  &nbsp;Telephone
               </th >
               <th class="titlehead">
                 &nbsp; Fax
               </th >
               <th class="titlehead">
                  &nbsp;Contact Name
               </th>
               <th class="titlehead">
                  &nbsp;Contacts
               </th>
             
            </tr>
      </HeaderTemplate>
            
            
      <ItemTemplate>
            
            <tr class='colhead' >
               <td width=150>
                  <%# DataBinder.Eval(Container.DataItem, "customername") %>
               </td>
               <td width=100>
                  <%# DataBinder.Eval(Container.DataItem,"phone") %>
               </td>
               <td width=100>
                  <%# DataBinder.Eval(Container.DataItem, "fax") %>
               </td>
               <td width=100>
                  <%# DataBinder.Eval(Container.DataItem, "Contactname") %>
               </td>
                <td width=100>
                 <a id="link1" runat="server" HRef="customercontact.aspx?custid="><%# DataBinder.Eval(Container.DataItem, "Contactname") %></a>
               </td>
            </tr>
           
      </ItemTemplate>
     
            
      <FooterTemplate>
      <tr class='colhead' >
               <td colspan='4'>&nbsp;</td>
                 
            </tr>
         </Table>
      </FooterTemplate>
   </ASP:Repeater></td></tr>
     
      
thanks
0
Comment
Question by:surya_madhavi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
nhewitt21 earned 150 total points
ID: 11734784
try replacing:
<a id="link1" runat="server" HRef="customercontact.aspx?custid="><%# DataBinder.Eval(Container.DataItem, "Contactname") %></a>

with:
<asp:Label id="label_lnk" text='<%#"<a id=\"link1\" runat=\"server\" href=\"customercontact.aspx?custid=" + (DataBinder.Eval(Container.DataItem,"Contactname").ToString()) + "\">" + (DataBinder.Eval(Container.DataItem,"Contactname").ToString())  + "</a>"%>'/>

That should do the trick.
0
 

Author Comment

by:surya_madhavi
ID: 11734898
Hi

thank you it worked.
0
 
LVL 3

Expert Comment

by:nhewitt21
ID: 11734966
No problem, glad it worked for you
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question