HREF on rewriting URL problem RRS feed

  • Question

  • User1153663591 posted

    Hi ,

    I’m working with templated user control, I want to rewrite URL<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>For exemple …/…./page.aspx/SelectedCategoryPath/12<o:p></o:p>Will be rewrite on …/…./page.aspx?SelectedCategoryPath=12<o:p></o:p><o:p> </o:p>So in tne HREF section I do : <a href="<%#Container.Category["GG_CategoryHomeTemplate"]%>/SelectedCategoryPath/<%#Container.Category.Name%>"<o:p></o:p><o:p> </o:p>And  I want to rewrite it on : <a href="<%#Container.Category["GG_CategoryHomeTemplate"]%>?SelectedCategoryPath=<%#Container.Category.Name%>"<o:p></o:p><o:p> </o:p>Supposing my root is : http://galass:4040/US/es/TESTproduct/Animation/<o:p></o:p>And my page is like this :<o:p></o:p><o:p> </o:p><Level1ItemTemplate><o:p></o:p>   <a href="<%#Container.Category["GG_CategoryHomeTemplate"]%>/SelectedCategoryPath/<%#Container.Category.Name%>" class="Start" onmousedown="MenuTop_ShowSubSub(this,'MenuTopSpace1')"><span><%# Container.Category.DisplayName%><o:p></o:p> </Level1ItemTemplate><o:p></o:p><o:p> </o:p><o:p> </o:p><Level1ItemTemplate> is a property of my templated user control.<o:p></o:p><o:p> </o:p>This code run very well at first click.<o:p></o:p><o:p> </o:p>http://galass:4040/US/es/TESTproduct/Animation/axeWomenTemplate.aspx/SelectedCategoryPath/12 <o:p></o:p><o:p> </o:p>and the rewrite is OK,<o:p></o:p><o:p> </o:p>at second click I have this : <o:p></o:p><o:p> </o:p>http://galass:4040/US/es/TESTproduct/Animation/axeWomenTemplate.aspx/SelectedCategoryPath/axeWomenTemplate.aspx/SelectedCategoryPath/12<o:p></o:p>and rewrite fails!!!!<o:p></o:p><o:p> </o:p>SelectedCategoryPath/axeWomenTemplate.aspx  is repeated, why ?<o:p></o:p><o:p> </o:p>How can I format my HREF section to avoid repeatition ?<o:p></o:p><o:p> </o:p>NOTE : If I don’t attempt to rewrite URL : with  <a href="<%#Container.Category["GG_CategoryHomeTemplate"]%>?SelectedCategoryPath=<%#Container.Category.Name%>"<o:p></o:p><o:p> </o:p>There are no repeatition and the url are like this :<o:p></o:p><o:p> </o:p>http://galas:4040/US/es/TESTproduct/axeWomenTemplate.aspx?SelectedCategoryPath=12<o:p></o:p><o:p> </o:p>http://galas:4040/US/es/TESTproduct/accessoir.aspx?SelectedCategoryPath=13<o:p></o:p><o:p> </o:p>all page is attached on the root, OK.<o:p></o:p><o:p> </o:p><o:p>Best Reagerds</o:p><o:p> </o:p><o:p> </o:p><o:p> </o:p><o:p> </o:p><o:p> </o:p><o:p> </o:p><o:p> </o:p><o:p> </o:p>


    Wednesday, May 30, 2007 8:44 AM


  • User-225114762 posted

    Your posting was messed up in transit, so it's rather hard to read. But, if I understand it correctly, you want to produce URL's for external viewing in your templated control - and you have rewriting logic somewhere else to handle the links when they are clicked by the user on the client.

    You want to generate URLs of the form: /path/path/page.aspx/tail/number and then you have other rewriting logic so they actually come back to the code as /path/path/page.aspx?tail=number .

    Your problem appears to be that your template is not generating the correct URLs in the HREF of the element. I think you need to show us some code, what you're really doing when you create the URL. I have a feeling that the problem is in the use of the URL 'tail', i.e. the part that comes after page.aspx .

    If you can, please ensure that the formatting is more easy to read. For code, you may want to use the little code pop-up window available to format code nicely.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 31, 2007 10:16 AM