Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

asp.net label

Posted on 2014-10-11
1
Medium Priority
?
284 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
[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
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

719 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