Solved label

Posted on 2014-10-11
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">


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>
                <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"
                                     RepeatColumns="5" RepeatDirection="Vertical" >
                                    <a href="Category.aspx?category=<%# Eval("typeName") %>&brand=HP">
                                    <asp:Label Width="200px" runat="server" ID="repeatItem"
                                    Text='<%# Bind("typeName") %>'></asp:Label>                                            
Question by:ITsolutionWizard
1 Comment
LVL 28

Accepted Solution

sammySeltzer earned 500 total points
ID: 40376087

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


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Offline Apllication 5 55
Angular JS Route 3 52
C# parent child form 5 18
Webform example, External Authentication Services, OAUTH, 4.6.2 1 15
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now