locked
get the text cliqued on a HREF link RRS feed

  • Question

  • User1153663591 posted
    Hello, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>I’m using rewriting URL <o:p></o:p>Is it possible when I click a link to get the text cliqued<o:p></o:p><o:p> </o:p>For example : <o:p></o:p>

    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 :<o:p></o:p>SHOES A <o:p></o:p>SHOES B <o:p></o:p>SHOES C   <o:p></o:p>SHOES D    <o:p></o:p><o:p> </o:p>I want when I click SHOES A to  view the page home/product/shoes.aspx ? prodID =  SHOES A<o:p></o:p>       when I click SHOES B to  view the page home/product/shoes.aspx ? prodID =  SHOES B<o:p></o:p>       when I click SHOES C to  view the page home/product/shoes.aspx ? prodID =  SHOES C<o:p></o:p><o:p> </o:p>and sower…….<o:p></o:p><o:p> </o:p>

    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

     

     
    Wednesday, June 13, 2007 6:07 AM

Answers

  • User-837620913 posted

    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>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 13, 2007 8:07 AM
  • User-1091210821 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 13, 2007 12:22 PM

All replies

  • User-837620913 posted

    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>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 13, 2007 8:07 AM
  • User1153663591 posted

    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


     

    Wednesday, June 13, 2007 11:08 AM
  • User-1091210821 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 13, 2007 12:22 PM