Programming, ASP.NET, C#, JavaScript and Computer Life
Ralph Whitbeck
Home
Contact
Subscribe
Tuesday, June 06, 2006
LinkButton doesn't print out a name attribute
When you use a LinkButton Control in ASP.NET 1.1 there is one difference compared to a Button Control. A LinkButton does not print out a name attribute in the Generated HTML.
I was trying to write some javascript from a textbox to press the LinkButton if the enter key is pressed as this is not done automatically in .NET.
I was having the worst time debugging this stipping it all down to bare javascript calls. But I kept coming up with this.form.elements.somenameattibute has no properties. Obviously I was getting at the LinkButton control but for some reason could not figure out why. I switched over to document.getElementById("someIDattribute").click() and this worked great in IE but did not work in Firefox. So back to debugging I went.
After looking at the code and the example code that I lifted this with I noticed that the code had a name attibute and my code did not. I switch my Link button over to a button control and everything worked fine.
So in case you need to know this information at a later time a LinkButton control does not print out a name attribute, at least by default.
Tuesday, June 6 2006 at 11:15 AM |
Comments [0]
Tags:
Mussings
|
Programming
|
Technology
Name
E-mail
Home page
Remember Me
Comment (Some html is allowed:
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u
)
Enter the code shown (prevents robots):
Blog Posts by:
Recent
Month
Category
Search
Currently Viewable:
My Twitter Updates
View Twitter Page
Contact Ralph
E-Mail
Click icon to send me e-mail.
Instant Messenger
AIM:
RedWolves2
Social Networks
Twitter:
http://twitter.com/redwolves
Last.fm:
http://last.fm/user/RedWolves/
Close
Subscribe
Main Feed
Category Feeds
BrandLogic
Entertainment
Fitness
How-to
Interesting Links
Mussings
Personal Finance
Politics
Programming
Simple Shadow
Sports
Sushi
Technology
Other feeds
Twitter updates: RedWolves
MediaGab Forum posts
Close
Blog Posts
Recent
Database Mirroring with SQL Server 2005
Gaining Exclusive Access to database in SQL Server 2005 via T-SQL
Light at the End of the Tunnel
jQuery Plugin - Simple Shadow
Adding link separators to a unordered list using jQuery
How to target="_blank" a link while keeping it XHTML compliant with jQuery
Book Review: "Smart & Gets Things Done" by Joel Spolsky
My first JSON Implementation
Close
Blog Posts
Month
October, 2008 (2)
September, 2008 (1)
August, 2008 (1)
July, 2008 (1)
June, 2008 (3)
May, 2008 (4)
April, 2008 (4)
February, 2008 (1)
January, 2008 (2)
November, 2007 (4)
October, 2007 (5)
July, 2007 (2)
May, 2007 (2)
April, 2007 (1)
February, 2007 (5)
January, 2007 (16)
December, 2006 (5)
November, 2006 (3)
October, 2006 (10)
September, 2006 (6)
August, 2006 (3)
July, 2006 (17)
June, 2006 (16)
May, 2006 (13)
April, 2006 (4)
March, 2006 (9)
February, 2006 (10)
January, 2006 (23)
December, 2005 (3)
Close
Blog Posts
Category
BrandLogic
Entertainment
Fitness
How-to
Interesting Links
Mussings
Personal Finance
Politics
Programming
Simple Shadow
Sports
Sushi
Technology
Close