I know there are not to many ASP.NET nerds here, but I'll try this:
I have a page which has a usercontrol embedded in it. The main page is in the root of the site, the usercontrol is in a folder, in the root, named "controls"
In the usercontrol there are a large number of HTML anchor tags inside a jquery tab-pane, with a runat="server" attribute
As they are in a tab-pane, I want the page to remain static (ie, no reload), and, I need the href to have a "hover" state. If I do not have an href attribute, all is fine except there is no "hover" state in IE
The code is list of anchor tags like this:
blah
The code-behind assigns them onclick events depending on circumstances. This works, except that when the page is generated, the href is removed completely.
Output:
blah
- no hover state, and no "hand" cursor unless specifically set in the CSS for the element.
If I set the href to #
Output is
blah
- which when clicked directs the browser to the controls/ folder, which is wrong
If I set the href to ~/#
Output is
blah
- works OK.. but I'd like to be able to set the url to, say #games in order to activate the Jquery tab with id "games"
If I do this
I get
blah
Any clever ideas or workarounds?
Try
blag
That works, though I do not like it much! And it also does not allow me to set the tab to open (given tab id like "games", the jquery tab-pane will open the tab if the URL is changed to include #games)
But then, the HtmlAnchor.Attributes.Add("onclick","") is also not very pleasant IMO, as it adds inline JS anyway.
Perhaps the answer is to spit out some JS that sets the href and onclick on page load, rather than having the .NET generate them.
I use a rel attribute for all my jQuery-esque associations
blag
Thanks - didn't know about the rel in this way.