Solved

Set ID field dynamically

Posted on 2013-06-19
5
227 Views
Last Modified: 2013-06-19
See code

How do I set the ID column to the account number?  Kind of like I have...only have it work.
I get a not well formed error.

THIS SECTION:  ID='<%# Eval("ACCOUNT_NUMBER") %>'


<asp:TemplateField HeaderText="CLICK">
	<ItemTemplate>
	<asp:HyperLink ID='<%# Eval("ACCOUNT_NUMBER") %>' runat="server" NavigateUrl="#" 
	Text='<%# Eval("ACCOUNT_NUMBER") %>'></asp:HyperLink>
	</ItemTemplate>
</asp:TemplateField>

Open in new window

0
Comment
Question by:patriotpacer
  • 4
5 Comments
 
LVL 9

Accepted Solution

by:
COANetwork earned 500 total points
ID: 39259730
your hyperlink is a server-side control, I don't think you can set its ID dynamically.  Why do you need that?  you can use the name attribute, or text, like you are doing.
0
 

Author Comment

by:patriotpacer
ID: 39259736
>>your hyperlink is a server-side control, I don't think you can set its ID dynamically.  Why do you need that?  you can use the name attribute, or text, like you are doing.

I may be getting mixed up here.  I don't want to set the server side ID.  I want the client side ID.

Basically I want the link but, via Jquery, i want to know what particular link I clicked.
0
 

Author Comment

by:patriotpacer
ID: 39259752
Now that I'm clear I'm going to close out this question, do a little more homework, and then rephrase what I'm after.

But you did clear things up
0
 

Author Comment

by:patriotpacer
ID: 39259767
I've requested that this question be closed as follows:

Accepted answer: 0 points for patriotpacer's comment #a39259736

for the following reason:

Question was answered to what I unintentionally asked.
0
 

Author Comment

by:patriotpacer
ID: 39259768
COANetwork answered my question.  He should get full credit for the answer.

Please award him points.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

706 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

21 Experts available now in Live!

Get 1:1 Help Now