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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server Error 11 58
How to prevent website from publishing with errors 9 46
jquery progress bar 3 41
asp enable view state 1 24
I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 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