get the text cliqued on a HREF link

Last post 06-13-2007 12:22 PM by naturehermit. 3 replies.

Sort Posts:

  • get the text cliqued on a HREF link

    06-13-2007, 6:07 AM
    • Member
      207 point Member
    • Goraleye
    • Member since 10-26-2004, 8:49 AM
    • Posts 229
    Hello, I’m using rewriting URL Is it possible when I click a link to get the text cliqued For example :

    1    <a href="home/product/shoes.aspx"> SHOES A </a>   
    2    <a href="home/product/shoes.aspx"> SHOES B </a>   
    3    <a href="home/product/shoes.aspx"> SHOES C </a>   
    4    <a href="home/product/shoes.aspx"> SHOES D </a>   
    5   
    6   

    So my page will show four links :SHOES A SHOES B SHOES C   SHOES D     I want when I click SHOES A to  view the page home/product/shoes.aspx ? prodID =  SHOES A       when I click SHOES B to  view the page home/product/shoes.aspx ? prodID =  SHOES B       when I click SHOES C to  view the page home/product/shoes.aspx ? prodID =  SHOES C and sower……. 

    My rewriting code is good but my problem is to retrive the text cliqued and put on a variable that I will put on rewritting rules

     

    Bets regards

     

     
    f
  • Re: get the text cliqued on a HREF link

    06-13-2007, 8:07 AM
    Answer
    • All-Star
      54,239 point All-Star
    • DarrellNorton
    • Member since 04-04-2003, 11:49 AM
    • VA, USA
    • Posts 6,539
    • Moderator

    If you want the text in the querystring, then you need to change the link, like this:

    1    <a href="home/product/shoes.aspx?prodID=Shoes A"> SHOES A </a>

    Darrell Norton, MVP
    Darrell Norton's Blog


    Please mark this post as answered if it helped you!
  • Re: get the text cliqued on a HREF link

    06-13-2007, 11:08 AM
    • Member
      207 point Member
    • Goraleye
    • Member since 10-26-2004, 8:49 AM
    • Posts 229

    Thank you,

    I'm doing rewritting URL, so  my link  is <a href="home/product/shoes.aspx"> SHOES A </a>

    And at execution I want to rewrite it to :home/product/shoes.aspx?prodID=Shoes A.

    So  the entry URL will be (home/product/shoes.aspx) and  I would  like to get the text( Shoes A) or his ID to complete my path  to  (home/product/shoes.aspx?prodID=Shoes A.)  using HTTP HANDLERS.

    The code that rewrite the URL is very good ! my problem is how to get the string that completes my path

    Bets regards


     

    f
  • Re: get the text cliqued on a HREF link

    06-13-2007, 12:22 PM
    Answer

    if you add runat= "server" in your link as follows you can get the innertext as below

     

    <a href="BLAH" mce_href="BLAH" runat="server" id="link">LINKTEXT</a>

    to get the LINKTEXt use

     string myString = link.InnerText;

    use myString whereever you want.

     

    Please mark as answer if that helps

    Please Mark Post that helped you as answer, also include a summary of what solved the problem as it helps others in similar situations
Page 1 of 1 (4 items)