URLs changing in Custom Module

Posted by Community Admin on 03-Aug-2018 15:45

URLs changing in Custom Module

All Replies

Posted by Community Admin on 18-Apr-2011 00:00

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?

localhost:60876/.../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


Posted by Community Admin on 19-Apr-2011 00:00

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>

Posted by Community Admin on 20-Apr-2011 00:00

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

Posted by Community Admin on 20-Apr-2011 00:00

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

Posted by Community Admin on 21-Apr-2011 00:00

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

This thread is closed