473,568 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<a name="xyz"/> 'obsolete'?

The editor says that when using <a name="xyz" />, the "name" element is
"obsolete" but it doesn't suggest a replacement. What's wrong with <a
name="xyz" /> to set a page anchor?
May 2 '06 #1
5 1781
That's correct; in XHTML the name attribute of the anchor is obsolete.
Preference is to now reference a page anchor by an element's ID attribute.

I.e. <div id="xyz">...som e content</div> would work with the "#xyz" in the
URL the same as the <a name="xyz" /> did in older HTML versions.

- Steve

"Alex Maghen" wrote:
The editor says that when using <a name="xyz" />, the "name" element is
"obsolete" but it doesn't suggest a replacement. What's wrong with <a
name="xyz" /> to set a page anchor?

May 2 '06 #2
Hi Alex,

As Steve has said, ASP.NET 2.0/vs 2005 by default use XHTML (transitional)
to validate the aspx content and "name" attribute is no longer an valid
attribute in XHTML(transitio nal). We should use "id" attribute instead. And
most popular browsers has already begun support xhtml pages. And here is a
good msdn reference on XHTML and othe web standards support in ASP.NET
2.0/VS 2005:

#Building ASP.NET 2.0 Web Sites Using Web Standards
#http://msdn.microsoft.com/asp.net/re...fault.aspx/def
ault.aspx?pull=/library/en-us/dnaspp/html/aspnetusstan.as p

Hope this also helps.

Regards,

Steven Cheng
Microsoft Online Community Support
=============== =============== =============== =====

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
May 2 '06 #3
Okay, and I like that idea quite a bit anyway - but my question is this: If I
do it using element IDs, can I do hyperlinks and JavaScript scrolling that
references those spots on the page using the old URL approach:
href="xyz.aspx# ElementID"???

Alex

"Steven Cheng[MSFT]" wrote:
Hi Alex,

As Steve has said, ASP.NET 2.0/vs 2005 by default use XHTML (transitional)
to validate the aspx content and "name" attribute is no longer an valid
attribute in XHTML(transitio nal). We should use "id" attribute instead. And
most popular browsers has already begun support xhtml pages. And here is a
good msdn reference on XHTML and othe web standards support in ASP.NET
2.0/VS 2005:

#Building ASP.NET 2.0 Web Sites Using Web Standards
#http://msdn.microsoft.com/asp.net/re...fault.aspx/def
ault.aspx?pull=/library/en-us/dnaspp/html/aspnetusstan.as p

Hope this also helps.

Regards,

Steven Cheng
Microsoft Online Community Support
=============== =============== =============== =====

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

May 2 '06 #4
Yes, Target an Id and it will take you there.

I have targeted a Table ID for example and it worked.

SA
"Alex Maghen" <Al********@new sgroup.nospam> wrote in message
news:79******** *************** ***********@mic rosoft.com...
Okay, and I like that idea quite a bit anyway - but my question is this:
If I
do it using element IDs, can I do hyperlinks and JavaScript scrolling that
references those spots on the page using the old URL approach:
href="xyz.aspx# ElementID"???

Alex

"Steven Cheng[MSFT]" wrote:
Hi Alex,

As Steve has said, ASP.NET 2.0/vs 2005 by default use XHTML
(transitional)
to validate the aspx content and "name" attribute is no longer an valid
attribute in XHTML(transitio nal). We should use "id" attribute instead.
And
most popular browsers has already begun support xhtml pages. And here is
a
good msdn reference on XHTML and othe web standards support in ASP.NET
2.0/VS 2005:

#Building ASP.NET 2.0 Web Sites Using Web Standards
#http://msdn.microsoft.com/asp.net/re...fault.aspx/def
ault.aspx?pull=/library/en-us/dnaspp/html/aspnetusstan.as p

Hope this also helps.

Regards,

Steven Cheng
Microsoft Online Community Support
=============== =============== =============== =====

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no
rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

May 3 '06 #5
Thanks for SA's input,

Hi Alex,

For anchor used in url, you can just use the "id" value to replace the
original "name" value, e.g;

http://server/app/page1.aspx#anchorid1

Regards,

Steven Cheng
Microsoft Online Community Support
=============== =============== =============== =====

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

May 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1527
by: danjourno | last post by:
Is there any way of referencing a method or field dynamically by a name contained in a string? thanks D
2
2842
by: FrankS | last post by:
Hi All, I have a problem with an call-template cmd at xslt 1.0: With: pCall = 'ExInput' ------ I try to: <xsl:call-template name="{$pCall}"> <xsl:with-param name="pVal" select="$pValue"/> </xsl:call-template>
13
40655
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div style="display:none"> can be displayed by setting the style attribute to "display:", or hidden with "display:none". This gives the illusion that the person...
5
17677
by: johnsuth | last post by:
I want to produce a trivial demonstration of dynamic modification. I thought that pressing a button might change its color. I studied O'Reillys books and successfully created the button with a fancy style, but the onclick fails to do anything no matter what permutation of parameters I try. <input type=button...
4
1544
by: Rich | last post by:
Hello, Just checking which is more efficient/better/or correct Do While something str1 = dr(i).ToString If Not str1.Equals("xyz") Then .... or
31
4820
by: Yeah | last post by:
Is it absolutely necessary to include "http://" in an A HREF hyperlink? Would it be wise to remove this from one's Links page, just to save code?
4
2927
by: rsa_net_newbie | last post by:
Hi there, I have a Managed C++ object (in a DLL) which has a method that is defined like ... Generic::List<String^>^ buildList(String^ inParm) Now, when I compile it, I get "warning C4172: returning address of local variable or temporary". In good old 'C', that would indicate that a 'static' was missing from the declaration of the...
5
4935
by: .Net Sports | last post by:
I'm having problems trying to get a record out of a resultset when working with a Datalist control. <%# Container.DataItem( "myfield" )%is how I am displaying the field , but when trying to do an If ..then..end if condition and referring to a field in the resultset while inside the <asp:datalist</ asp:datalistenvironment, can't find anything...
3
2559
by: amollokhande1 | last post by:
Hi I have some string value like strTest="name=xyz&code=20&dept=10" How to convert this strTest to Namevaluecollection so to extract the individual value for key. Regards Amol Lokhande
0
7604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6275
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.