Solved

Set ID field dynamically

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

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 & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, 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 www.johnchapman.name 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