Solved

C# Anchor tag

Posted on 2004-08-06
3
2,643 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 50 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

726 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