Set ID field dynamically

Posted on 2013-06-19
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.


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

Open in new window

Question by:patriotpacer
  • 4

Accepted Solution

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.

Author Comment

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.

Author Comment

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

Author Comment

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.

Author Comment

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

Please award him points.

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 ( First, Just open a new email message.  In the To field, type your recipient's fax number 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