Search Results

Search found 6 results on 1 pages for 'htmlanchor'.

Page 1/1 | 1 

  • Using HtmlAnchor for anchor tag that navigates in-page named anchor

    - by Frank Schwieterman
    I am trying to render a simple hyperlink that links to a named anchor within the page, for example: <a href="#namedAnchor"scroll to down</a <a name="namedAnchor"down</a The problem is that when I use an ASP.NET control like asp:HyperLink or HtmlAnchor, the href="#namedAnchor" is rendered as href="controls/#namedAnchor" (where controls is the subdirectory where the user control containing the anchor is). Here is the code for the control, using two types of anchor controls, which both have the same problem: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Test.ascx.cs" Inherits="TestWebApplication1.controls.Test" % <a href="#namedAnchor" runat="server"HtmlAnchor</a <asp:HyperLink NavigateUrl="#namedAnchor" runat="server"HyperLink</asp:HyperLink The generated source looks like: <a href="controls/#namedAnchor"HtmlAnchor</a <a href="controls/#namedAnchor"HyperLink</a I really just want: <a href="#namedAnchor"HtmlAnchor</a <a href="#namedAnchor"HyperLink</a I am using the HtmlAnchor or HyperLink class because I want to make changes to other attributes in the code behind. I do not want to introduce a custom web control for this requirement, as the requirement I'm pursuing is not that important and it would be hard to talk the team into abandoning the traditional ASP.NET link controls. It seems like I should be able to use the ASP.NET link controls to generate the desired link.

    Read the article

  • HtmlUnit click() behaves differently?

    - by rhcp2p
    Hi, A question regarding the HtmlUnit java libary: I've created a log on my server, and noticed that the click() method doesn't pass the "referral" information when it is invoked through a "HtmlElement" or "HtmlArea". when invoked through the more commonly used HtmlAnchor- the refferral information is passed. This is strange since HtmlAnchor is a Subclass of HtmlElement Thanks for the help

    Read the article

  • Xpath to get the 2nd url with the matching text in the href tag

    - by Blankman
    A html page has paging links, 1 set at the top of the page and another on the bottom of the page. Using HtmlUnit, I am currently getting the HtmlAnchor on the page using getByAnchorText("1"); There is a problem in some of the links on the top, so I want to reference the bottom links using XPath. nextPageAnchor = (HtmlAnchor) page.getByXPath(""); How can I reference the 2nd link on the page, with using xpath? I need to reference the link using the AnchorText, so a link like: <a href="....">33</a> The href has random text, and is a javascript function so I have no idea what it will be. Is this possible with xpath?

    Read the article

  • How to get HTML of HtmlControl object in backend

    - by jlech
    I have a short snippet of C# code like this: HtmlGenericControl titleH3 = new HtmlGenericControl("h3"); titleH3.Attributes.Add("class", "accordion"); HtmlAnchor titleAnchor = new HtmlAnchor(); titleAnchor.HRef = "#"; titleAnchor.InnerText = "Foo Bar"; titleH3.Controls.Add(titleAnchor); What I want is a way to return a string that looks like this: <h3 class="accordion"><a href="#">Foo Bar</a></h3> Any thoughts or suggestions?

    Read the article

  • Does calling a click method effect the HtmlPage object if there is a 404?

    - by Blankman
    If I call a click method on a HtmlAnchor, and say that page returns a 404, does that mean the HtmlPage will effect, so searching for another link on the page will result in an error because the page's HTML is the error page (assuming the link is NOT on the error page). Can I manually set the page's HTML, and then locate and click on links and continue on from this approach? (other than connecting via a URL)

    Read the article

  • How can i create a ModalPopupExtender control dynamically from a server control?

    - by Colour Blend
    I have a composite server control that does quiet a number of things; one of which is to display a ModalPopup OnClick of a dynamically generated HtmlAnchor control. I need to create this ModalPopupExtender control dynamically in my server control and trigger it from within. I have been able to create it and trigger it from a button created at design time but not at runtime. This is as a result of the ID assign to the link is always not found by the ModalPopupExtender control. I have tried assigning a static ID but no success. Can anyone help?

    Read the article

1