More in this section

Forums / General Discussions / URLs changing in Custom Module

URLs changing in Custom Module

5 posts, 0 answered
  1. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    18 Apr 2011
    Link to this post
    Hi,

    After 3 days trying to create a simple module to just display some information from the database and perform some post backs i am loosing patience with 4.0, a site that was supposed to take two weeks looks like it will be delayed as the more and more days i lose trying to get these things to work.

    I have a custom module (whose viewstate doesnt seem to be working aswell) and i am just trying to set the url so that it goes to a page that i have setup which will deal with product details.  My Page hierachy setup is:

    Products (group Page)
    - Products Lister
    - Products Detail

    i am trying to setup the link as follows:
    <li><asp:HyperLink NavigateUrl='<%# "/products/product-details?id=" + Eval("id").ToString() %>' CssClass="view" Text="View Slab" runat="server" ID="hlnkDetails"></asp:HyperLink></li>

    now i know the link is not great, i will want to change it at some point to something more google friendly (although i think custom urls from 3.7 is not in 4.0 yet?) but i cant even get it to do that, the module changes my url to this?

    http://localhost:60876/App_Data/Sitefinity/WebSiteTemplates/Default/App_Master/1

    am i being really stupid or is something going on here?

    Can someone please answer this, i have asked three questions and not one person from Telerik has responded, where has the legendary support we used to get from 3.7 gone?????

    Rob


  2. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    19 Apr 2011
    Link to this post
    Hi,

    I am still having this issue with my custom module changing the navigate url for my links.  After the 4.1 upgrade the url is being remapped to: /SFPageService/2

    Can someone please help me?

    Line in question:
    <li><asp:HyperLink NavigateUrl='<%# "/products/product-details/" + Eval("id").ToString() %>' CssClass="view" Text="View Slab" runat="server" ID="hlnkDetails"></asp:HyperLink></li>

    Fill Listview code
    <asp:ListView ID="lvSlabs" runat="server" GroupItemCount="3">
        <LayoutTemplate>
            <asp:PlaceHolder runat="server" ID="groupPlaceHolder"></asp:PlaceHolder>
        </LayoutTemplate>
        <GroupTemplate>
            <div class="group">
                <asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
            </div>
        </GroupTemplate>
        <ItemTemplate>
            <div class="product-item">
                <div class="img">
                    <img src="/" alt="" />
                </div>
                <h3>Some Time <%# Eval("ID").ToString() %></h3>
                <ul class="details">
                    <li><span>Material:</span> <%# Eval("Block.BlockType.TypeName") %></li>
                    <li class="alt"><span>Thickness (mm):</span> <%# Eval("Thickness") %></li>
                    <li><span>Length (m):</span> <%# Eval("Length") %></li>
                    <li class="alt"><span>Width (m):</span> <%# Eval("Width") %></li>
                    <li><span>Colour:</span> <%# Eval("Colours") %></li>
                    <li class="alt"><span>Finish:</span> <%# Eval("Finish") %></li>
                    <li><span>Origin:</span> <%# Eval("Block.Origin") %></li>
                    <li class="alt"><span>Block No:</span> <%# Eval("Block.BatchNo").ToString() %></li>
                    <li><span>No of Slabs:</span></li>
                    <li class="alt"><span>Notes:</span></li>
                    <li><asp:HyperLink NavigateUrl='<%# "/products/product-details/" + Eval("id").ToString() %>' CssClass="view" Text="View Slab" runat="server" ID="hlnkDetails"></asp:HyperLink></li>
                </ul>
            </div>
        </ItemTemplate>
    </asp:ListView>
  3. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    20 Apr 2011
    Link to this post
    Hi,

    This is becoming a real issue now, i have spent hours trying different things and i cannot get a simple link to output in the format that i specify, no matter what i do.  I scheduled to do this project in two weeks and i am almost at the end of that period and i am nowhere, can an admin please see if it something i am doing or if this is a bug! 

    Where has the amazing Sitefinity 3.7 support gone???

    Rob

  4. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    20 Apr 2011
    Link to this post
    Hi All,

    Please ignore my last post i have found a workaround. If anyone else is having this issue then maybe this will work for them.

    i change the link to a linkbutton and wired up the ItemCommand method of the list view, which then redirected via a response.redirect, an extra step which i find pointless but have to get this moving!

    Item Command Setup
    protected override void CreateChildControls()
    {
        base.CreateChildControls();
        lvSlabs.ItemCommand += new EventHandler<ListViewCommandEventArgs>(lvSlabs_ItemCommand);
    }

    Item Command Event Handler
    protected void lvSlabs_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
       Page.Response.Redirect("/products/product-details/" + e.CommandArgument);
    }

    I hope it helps someone out there
  5. Nikolay Datchev
    Nikolay Datchev avatar
    87 posts
    Registered:
    01 Nov 2016
    21 Apr 2011
    Link to this post
    Hello Roberto,

    Thank you for sharing the workaround, we are going to investigate the problem in details, and get back to you soon if this is a bug or we can provide a better solution

    Regards,
    Nikolay Datchev
    the Telerik team

5 posts, 0 answered