Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

asp.net label

Posted on 2014-10-11
1
Medium Priority
?
290 Views
Last Modified: 2014-10-24
Below this single line of code, I want to read the asp:label value
Now I have: <a href="Category.aspx?category=<%# Eval("typeName") %>&brand=HP">

And

I want to change like <a href="Category.aspx?category=<%# Eval("typeName") %>&brand=<%= brandHP.Value %>">

How can I do that?


<a href="#" class="dropdown-toggle" data-toggle="dropdown">
               
<asp:Label runat="server" ID="brandHP" Text="HP"></asp:Label>
               
</a>
                <ul class="dropdown-menu mega-menu">
                                       
<li class="yamm-content">
                       
<div class="row">
                           
<div class="col-md-12">
                               
<ul class="list-unstyled">
                                   
<asp:DataList Width="800px" runat="server"
                                     ID="dataListTopSaleProductTypeList"
                                     RepeatColumns="5" RepeatDirection="Vertical" >
                                    <ItemTemplate>
                                    <li>
                                    <a href="Category.aspx?category=<%# Eval("typeName") %>&brand=HP">
                                    <asp:Label Width="200px" runat="server" ID="repeatItem"
                                    Text='<%# Bind("typeName") %>'></asp:Label>                                            
                                    </a>
                                    </li>
                                    </ItemTemplate>
                                    </asp:DataList>
                                 
</ul>
                           
</div>
                         
</div>
                   
</li>
                   
               
</ul>
0
Comment
Question by:ITsolutionWizard
1 Comment
 
LVL 29

Accepted Solution

by:
sammySeltzer earned 2000 total points
ID: 40376087
Hi

If I understand you correctly, you want the text value to be dynamically generated?

Try this:

 <a href="Category.aspx?category=<%# Eval("typeName") %>" Text="<%# Eval("brandHP") %>">

Open in new window

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
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. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

927 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