Anchor not working in asp.net - asp.net

As the title suggests i've run into a problem with anchors ASP.NET.
I've set them up the same way as you would in standard html
ex:
Introduction
and then further down the page,
<a name="Intro" ...
for some reason when i click the link, the #Intro isnt appended to the url, and i'm not taking to the anchor.
However, if i manually add the #Intro to the url it works.
Also, if i change the #Intro to a name which has no corresponding anchor with the given name attribute it IS appended to the query
What's going on?

This seems more like a browser issue or else you're not including enough code.
The code you showed us looks fine.

You have it around the wrong way. It should be NAME="INTRO" where you want the intro and HREF="#INTRO" when you want to go back to the intro.

#INTRO not #Intro .. works.

Note that there should not be any postback to the server. This is all done on client-side, implemented by the browser. Try recreating this in another browser to disqualify the possibility that its some crazy browser issue. Scan the the source code (in browser, view source) of the page to understand if anything happens when user clicks the intro link (assuming of course you have no events on the links- in that case look for the problem there).

Try dropping the quotes in the name tag and/or adding the page name to the anchor link.

Related

Using Html Anchor on my web site

I am using weebly site builder and so just a beginner on Html coding. I am having issues making anchors work on my pages. They seem to work on some systems and not others, and so I think there must be a better method.
Here is what I am doing
I have a guest author page and I want each guest, to have a direct link to his section of the web page
I set up an anchor as follows
Then use the following link to it
http://arthurvaso.weebly.com/guests2016.html/#smith2
On some computers/broswers this works just fine, in others, it just goes to the Top of the page instead of the section I want.
I basically have pages I want to make direct links to
Poet1
Poet2
Poet3 etc
I search here, an all the posts were either years old, or not exactly the answer I was looking for. It seems the newer the browser version, the less my method works.
I really appreciate any help, thanks!
There is a little trick to it, but it's an easy fix for you. You are missing in your Anchor.
Change:
<a id="smith2"></a>
To:
<a id="smith2"> </a>
Make sure to publish the changes.
And, note that your Anchor Link should be:
http://arthurvaso.weebly.com/guests2016.html#smith2
without the / after .html

Using CSS to link to a page?

Would anyone happen to know how to use CSS to link to an internal page instead of using a href?
The situation is... I have a feed on a page from an external source on another one of my website (which controls the link) I wish to use CSS at my end to change the direction of the link almost creating a feed without coding RSS.
As of now I am using the following code to kill the link as I would rather it go nowhere than to an undesired place:
.col-one-thirdtest a.item-link {
pointer-events: none;
cursor: default;
}
Any help would be greatly appreciated.
Problem solved by using http://open.dapper.net/user-dapps.php and http://feed.informer.com/ in order to select the sections of the page I needed and then convert them into an RSS feed! Job Done!
Nope. CSS is not a scripting/behvaioral language. It's a styling language. (Your pointer-events trick doesn't work on all browsers, anyway.)
You'll need to use JavaScript to change the link locations.
Also (as a side note), you might want to reconsider your reasons for having the feed from said external source if the links don't go where you want them to. The behavior you're asking for suggests that your feed might be the wrong way to go about your desired effect.

Style getting screwed up with hash in URL

I have some pages that are loaded with a hash/anchor in the url. When we do this it screws up the padding/margin of the document. Without it, it works fine.
What's even stranger is if I use the browser tools to get to the css and disable the margin and padding and then reenable it, it looks fine. We are using a third party web site to serve our site which means we're kind of locked into a CMS type of service and our hands are tied to a certain extent as to how much we can customize our pages. So, therefore, we have multiple css files referenced and so forth.
If you look at the two urls below you'll see the issue in the one with the #company_settings appended to the end of the url. If you then use inspect element in chrome to look at the header and disable and reenable the custom.css:2 for margin and padding, you'll see it then fixes the problem. Any idea why this is happening and if there's something I can do in css to fix this? Thanks.
http://www.patriotsoftware.com/patriot-pay-help-center-payroll-settings
vs
http://www.patriotsoftware.com/patriot-pay-help-center-payroll-settings/#company_settings
Using a hash in the URL signals the browser to scroll to a specific location of the document.
And the browser is exactly doing so.
If you can edit skin.css (which sounds so by it's name), go into line 6:
#foxboro_header {width:100%;overflow:hidden;}
Change it, remove the overflow rule:
#foxboro_header {width:100%;}
This should make it work.
BTW if it's a block element, the width is automatically set to 100%. Setting it would be redundant then.
Next to that the code of the page is full of validation errors, deal with them otherwise you might run into more and more problems.
I had a similar issue using hash.
There is/was a some bug with display: table and hash url. I changed it to display: block and it was working correctly afterwards.
Hope it helps someone.

Qt Assistant as Custom Help Viewer - Home button doesn't work?

The <homePage> tag in my .qhcp file doesn't appear to work. Sometimes it seems to set the page I specify in that tag to be the value in Edit..Preferences..Options..Homepage; sometimes not. Either way, clicking the Home button does not work. Sometimes it does nothing, sometimes it says the page could not be found - and gives what looks to me to be a perfectly valid path.
Any ideas? Or worst case, is there a way to get the viewer to not show the Home button?
The <homePage> should provide a complete path, i.e.
<homePage>qthelp://your.full.namespace/doc/index.html</homePage>
Could that be the problem?
I clicked Restore to default, and now it seems to work. Not sure what's going on, but hopefully the problem is behind us...

In-text hyperlinks shown by Internet Explorer without the following space. What can be the reason? YUI?

I've a problem which is most likely some ugly CSS mistake, but I just can't spot the solution (and a few changes I tried did not help).
Some of in-text hyperlinks (not all!) are shown by Internet Explorer without the following space.
here is the example
See the link WatchBot just below the Rationale title (and a few similar links deeper in the article). Firefox, Opera, Chrome, Konqueror - all display it properly: WatchBot can. IE (6.0 but IIRC also 7.0) displays it as **WatchBot***can*.
I am using Yui-reset and yui-base. Is it possible that those libraries cause the problem?
Do you have a script running on, and altering, the content in any way? I say this because the page loads normally initially, but looks as though it undergos some modification later in the loading lifecycle.
If you think reset or base are making this happen try removing them one at a time - I haven't had any experience of this error before however (I usually use the full whack: Reset, Grids, Base and Fonts).
What I did notice however is that the first WatchBot link of the page is simply this:
<p>Have you ever been curious how is
WatchBot
picking the games to observe and save? Here is the explanation.</p>
Where as the second link looks like this:
<span>Due to the FICS limitations </span>
WatchBot<span> can
I have no idea what that second span is doing there - might be something to check up on. (It validated fine however - so there's definitely an closing span somewhere).
I'd say a good place to start would be to but a space after the anchor but before the span, rather than right after the span start tag.
Current state of the things: as steve_c spotted first, and buti-oxa confirmed, it looks like the layout is being spoiled by javascript (and as Ross noted, some extra spans are injected). Thank you all, I missed it.
I am to make experiments and selectively disable those scripts (analytics and google ads) to check whether it helps (my current bet is that maybe I have some HTML error or naming conflict)
Did you try to disable pageTracker? It seems to be the only script on your page, and it looks fine to me in its static form.
EDIT: I wondered what span Ross was talking about - I did not see any. I viewed the source. I just learned that Firefox allows to see both source and generated source (Toos/Web Developer/View Source). Sure enough, generated source has additional span inserted.
Solution: my page was spoiled by the text-link-ads script (which, in fact I activated on English blog by mistake - this is script by adkontekst.wp.pl, Polish firm). After disabling it everything is OK.
Thanks for everybody who pointed me into the right direction.

Resources