Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > GetDocumentUrl() not working View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/5/2012 9:50:14 AM
   
GetDocumentUrl() not working
I've created a custom webpart and all works as expected except for creating a link to view the details. For whatever reason the GetDocumentUrl() is not generating the url I'd expect, it just sends me back to the Home page of the site.

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 7/5/2012 2:51:30 PM
   
RE:GetDocumentUrl() not working
Are you using it in an ASCX or Text/XML with K# macros?

The GetDocumentUrl() macro wasn't working correctly in earlier hotfixes of Kentico 6. It works in SP1 and up though.

Does it generate a url that matches the home page url?

Is the context in which you are calling GetDocumentUrl() inside a reapeater item template?

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/5/2012 3:00:52 PM
   
RE:GetDocumentUrl() not working
Currently on 6.0.34 (SP1) using ASCX and no K# macros.

It generates the URL for my home page "/Default.aspx". Pretty simple transformation I use in a CMSRepeater
<div style="padding: 5px;">
<div style="float: left; width: 50%;">
<%# Eval("StoreName") %> <%# IfEmpty(Eval("ProxDistance"),"", IfEmpty(Eval("ProxDistance"), "", " - " + Convert.ToString(Math.Round(Convert.ToDouble(Eval("ProxDistance")), 2))+ " miles")) %></b> <br />
<%#Eval("Address1") %><br />
<%#Eval("City") + ", " %>
<%#Eval("ST") %> <%#Eval("Zip") %><br />
<%#Eval("PrimaryStorePhone") %>
</div>
<div style="float: right; width: 50%;">
<a href='<%# GetDocumentUrl() %>'>Store Info</a>
</div>
<div style="clear: both;"></div>
</div>

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/5/2012 3:18:16 PM
   
RE:GetDocumentUrl() not working
Hi,

What are the repeater settings?
In which transformation is this code placed? Selected item or default transformation?
What are the items listed by the repeater - have you tried to do some tests and put on the output the listed items to see if the repeater is listing correct ones?

Best regards,
Juraj Ondrus

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/5/2012 3:23:00 PM
   
RE:GetDocumentUrl() not working
The code is in the Default transformation. The items in the repeater are a custom document type of Store (very similar to the document type of Office). When I run the test, it outputs the data as expected although it does not correctly generate the URL for that document.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/5/2012 3:32:42 PM
   
RE:GetDocumentUrl() not working
Hi,

Could you please describe us your complete setup and where and how are you using your custom web part?
The GetDocumentURL function works fine for me in the default news repeater transformation - the URL is rendered correctly so I think that for some reason the repeater is currently rendering the home document.

Best regards,
Juraj Ondrus

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/5/2012 3:46:45 PM
   
RE:GetDocumentUrl() not working
Typically I won't do this as it is usually lengthy but this is pretty small (and I left out all the properties as they aren't needed for the example) but here is my code for my custom webpart. All of the records returned in the search (button click event) are of my custom document type and it returns the correct information although it doesn't return the URL.

ASCX
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="StoreLocations.ascx.cs" Inherits="CMSWebParts_MyWebPart_StoreLocations" %>

<table>
<tr>
<td colspan="2">
<asp:Panel ID="pnlFilter" runat="server" DefaultButton="btnSearch">
<h4>Search by City and State</h4>
<table>
<tr>
<td>
<asp:TextBox ID="txtCity" runat="server" />
<ajaxToolkit:TextBoxWatermarkExtender ID="waterMarkExtender" runat="server" TargetControlID="txtCity" WatermarkText="enter a city" />
<asp:RequiredFieldValidator ID="rfvCity" runat="server" Display="Static" ErrorMessage="*" ForeColor="Red" Font-Bold="true" SetFocusOnError="true" ControlToValidate="txtCity" ValidationGroup="Locator" />
</td>
<td>
<asp:DropDownList ID="ddlState" runat="server">
<asp:ListItem Text="1" Value="A" />
<asp:ListItem Text="2" Value="B" />
<asp:ListItem Text="3" Value="C" />
</asp:DropDownList>
</td>
<td>
distance:
<asp:DropDownList ID="ddlDistance" runat="server">
<asp:ListItem Text="10 Miles" Value="10" />
<asp:ListItem Text="20 Miles" Value="20" />
<asp:ListItem Text="50 Miles" Value="50" />
<asp:ListItem Text="No Limit" Value="-1" />
</asp:DropDownList>
</td>
<td>
<asp:Button ID="btnSearch" runat="server" Text=" Find " onclick="btnSearch_Click" ValidationGroup="Locator" />
</td>
</tr>
<tr>
<td colspan="2">
<b>Available Services</b>
</td>
<td colspan="2">
<b>Available Fuel</b>
</td>
</tr>
<tr>
<td colspan="2" valign="top" style="padding-right: 20px;">
<asp:CheckBoxList ID="cbServices" runat="server" DataValueField="FieldName" DataTextField="FriendlyName" />
</td>
<td colspan="2" valign="top">
<asp:CheckBoxList ID="cbFuel" runat="server" DataValueField="FieldName" DataTextField="FriendlyName" />
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
<tr>
<td valign="top">
<cms:CMSRepeater ID="cmsRepeater" runat="server" ClassNames="KT.Store" DataBindByDefault="false" OrderBy="ProxDistance" />
</td>
<td valign="top">

</td>
</tr>
</table>

Code behind
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Linq;

using CMS.CMSHelper;
using CMS.GlobalHelper;
using CMS.PortalControls;
using System.Web.UI.WebControls;
using CMS.SettingsProvider;
using CMS.DataEngine;

public partial class CMSWebParts_MyWebPart_StoreLocations : CMSAbstractWebPart
{
KT.RetailStructure.RetailStructureService RetailService = new KT.RetailStructure.RetailStructureService();

#region "Methods"

/// <summary>
/// Content loaded event handler
/// </summary>
public override void OnContentLoaded()
{
base.OnContentLoaded();
SetupControl();
}

/// <summary>
/// Initializes the control properties
/// </summary>
protected void SetupControl()
{
if (this.StopProcessing)
{
// Do nothing
}
else
{
InitializeCheckboxes();
cmsRepeater.Path = Path;
cmsRepeater.DataBindByDefault = true;
cmsRepeater.SelectedItemTransformationName = SelectedItemTransformationName;
cmsRepeater.TransformationName = TransformationName;
cmsRepeater.AlternatingTransformationName = AlternatingTransformationName;
cmsRepeater.ItemSeparator = ItemSeparator;
}
}

/// <summary>
/// Populate checkboxes with data
/// </summary>
private void InitializeCheckboxes()
{
KT.RetailStructure.ServiceCallResult searchableAmenities = RetailService.GetQueryableStoreFields(System.Configuration.ConfigurationManager.AppSettings["ApiKey"], "StoreLocations");
System.Data.DataTable tFuelFields = searchableAmenities.DataSetResults.Tables[0].Copy();

System.Data.DataView ServicesView = searchableAmenities.DataSetResults.Tables[0].DefaultView;
ServicesView.RowFilter = "IsVisible = true AND IsFuelField = false";
ServicesView.Sort = "FriendlyName";
cbServices.DataSource = ServicesView;
cbServices.DataBind();

System.Data.DataView FuelOptionsView = searchableAmenities.DataSetResults.Tables[0].DefaultView;
FuelOptionsView.RowFilter = "IsVisible = true AND IsFuelField = true";
FuelOptionsView.Sort = "FriendlyName";
cbFuel.DataSource = FuelOptionsView;
cbFuel.DataBind();
}

protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}

private void BindData()
{
DataTable dt = new DataTable();
string Where = null;
int distance = -1;
if (ddlDistance.SelectedValue != null)
{
distance = ValidationHelper.GetInteger(ddlDistance.SelectedValue, -1);
}
KT.RetailStructure.ServiceCallResult result = RetailService.GetStoreDataByProximityToCityAndState("WhereWeAre", txtCity.Text.Trim(), ddlState.SelectedItem.Value);
if (result.DataSetResults.Tables.Count > 0)
{
System.Data.DataView view = result.DataSetResults.Tables["StoreData"].DefaultView;
view.RowFilter = "ProxDistance < " + distance.ToString() + " AND ZoneNumber < 9000 AND (LocationType < 3 OR StoreNumber = 870 OR StoreNumber = 850)";

// filter based on checked services
foreach (ListItem i in cbServices.Items)
{
if (i.Selected)
{
view.RowFilter += " AND " + i.Value + " = true";
}
}
// filter based on checked fuels
foreach (ListItem i in cbFuel.Items)
{
if (i.Selected)
{
view.RowFilter += " AND " + i.Value + " = true";
}
}
Where = "StoreNumber IN(";
foreach (DataRowView rv in view)
{
DataRow row = rv.Row;
Where += Convert.ToString(row["StoreNumber"]) + ",";
}
Where += ")";
// do some cleanup to remove the last comma from the IN statement
Where = Where.Replace(",)", ")");
dt = view.ToTable();
}

DataTable dt2 = GetKenticoStores(Where);
if (dt2.Rows.Count > 0 && dt.Rows.Count > 0)
{
foreach (DataRow dr in dt2.Rows)
{
DataRow[] row = dt.Select("StoreNumber = " + Convert.ToString(dr["StoreNumber"]));
dr["ProxDistance"] = row[0]["ProxDistance"];
}
}
cmsRepeater.DataSource = dt;
cmsRepeater.DataBind();
}

/// <summary>
/// Reloads data
/// </summary>
public override void ReloadData()
{
base.ReloadData();

// Reload data in all controls if needed
InitializeCheckboxes();
BindData();
}

/// <summary>
/// Get the kentico store document types based on the select all query
/// </summary>
/// <param name="Where"></param>
/// <returns></returns>
private DataTable GetKenticoStores(string Where)
{
QueryDataParameters parameters = new QueryDataParameters();
GeneralConnection cn = ConnectionHelper.GetConnection();
DataSet ds = cn.ExecuteQuery("KT.Store.selectall", parameters, Where);
return ds.Tables[0];
}

#endregion
}

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/6/2012 3:29:22 PM
   
RE:GetDocumentUrl() not working
Hi,

I would try to set the DelayedLoading property of the repeater to true and/or also set the StopProcessing property to true - so the default data load is stopped, then set the repeater properties you are setting in the code behind and then set the StopProcessing to false and call the reload data.

Best regards,
Juraj Ondrus

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 7/10/2012 4:04:01 PM
   
RE:GetDocumentUrl() not working
try adding this to your SetupControl() method
cmsRepeater.ControlContext = this.ControlContext;

I noticed this bit of code in the cmsrepeater webpart the other day and I noticed it is missing from your code. I'm not sure if it will fix your problem though.

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 7/23/2012 3:39:48 PM
   
RE:GetDocumentUrl() not working
Did you ever get this working? If so, what was your solution?

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/24/2012 7:06:33 AM
   
RE:GetDocumentUrl() not working
I've been working on another project and haven't had a lot of time to work on this particular one quite yet. The short answer is no, I've made the suggested changes and still not working as expected.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/30/2012 7:30:04 AM
   
RE:GetDocumentUrl() not working
Hi,

I think I got it - you are binding some data to the repeater. You need to ensure that in the dataset are also fields/columns which are used by that function to create the URL: site name, node alias path and document URL path.

Best regards,
Juraj Ondrus

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 8/1/2012 2:32:16 PM
   
RE:GetDocumentUrl() not working
Thanks Juraj, I figured that was probably the issue back when I posted my code an realized I shoudn't be using the selectall query but the selectdocuments query, which does the join in the view and gets all that other info (node, sitename, alias, etc.). Still leaves me with the URL of /default.aspx.

In my transformation I'm able to render the CMSContext.CurrentDocument.DocumentID, CMSContext.CurrentDocument.NodeID, etc. without issue. So what is it I'm missing in my code behind?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/2/2012 3:02:23 AM
   
RE:GetDocumentUrl() not working
Hi,

In this case, could you please post the actual code behind you have so we can take another look at it? Thank you.
Also, as I mentioned - when binding the data to the repeater, are those columns available? They are used to compose the URL using that function.

Best regards,
Juraj Ondrus

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 8/6/2012 7:59:20 AM
   
RE:GetDocumentUrl() not working
Yes the columns are available when binding to the repeater, they are retrieved in the GetKenticoStores(string) method in the code below.

Code hasn't changed much from what is above but I'll post it again:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="StoreLocations.ascx.cs" Inherits="CMSWebParts_KT_StoreLocations" %>

<table>
<tr>
<td colspan="2">
<asp:Panel ID="pnlFilter" runat="server" DefaultButton="btnSearch">
<h4>Search by City and State</h4>
<table>
<tr>
<td>
<asp:TextBox ID="txtCity" runat="server" />
<ajaxToolkit:TextBoxWatermarkExtender ID="waterMarkExtender" runat="server" TargetControlID="txtCity" WatermarkText="enter a city" />
<asp:RequiredFieldValidator ID="rfvCity" runat="server" Display="Static" ErrorMessage="*" ForeColor="Red" Font-Bold="true" SetFocusOnError="true" ControlToValidate="txtCity" ValidationGroup="Locator" />
</td>
<td>
<asp:DropDownList ID="ddlState" runat="server">
<asp:ListItem Text="1" Value="A" />
<asp:ListItem Text="2" Value="B" />
<asp:ListItem Text="3" Value="C" />
</asp:DropDownList>
</td>
<td>
distance:
<asp:DropDownList ID="ddlDistance" runat="server">
<asp:ListItem Text="10 Miles" Value="10" />
<asp:ListItem Text="20 Miles" Value="20" />
<asp:ListItem Text="50 Miles" Value="50" />
<asp:ListItem Text="No Limit" Value="-1" />
</asp:DropDownList>
</td>
<td>
<asp:Button ID="btnSearch" runat="server" Text=" Find " onclick="btnSearch_Click" ValidationGroup="Locator" />
</td>
</tr>
<tr>
<td colspan="2">
<b>Available Services</b>
</td>
<td colspan="2">
<b>Available Fuel</b>
</td>
</tr>
<tr>
<td colspan="4">
Choose only locations with:
</td>
</tr>
<tr>
<td colspan="2" valign="top" style="padding-right: 20px;">
<asp:CheckBoxList ID="cbServices" runat="server" DataValueField="FieldName" DataTextField="FriendlyName" />
</td>
<td colspan="2" valign="top">
<asp:CheckBoxList ID="cbFuel" runat="server" DataValueField="FieldName" DataTextField="FriendlyName" />
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
<tr>
<td valign="top" style="width: 50%;">
<cms:CMSRepeater ID="cmsRepeater" runat="server" DelayedLoading="true" ClassNames="KT.Store" DataBindByDefault="false" OrderBy="ProxDistance" />
</td>
<td valign="top" style="width: 50%;">
<cms:BasicGoogleMaps ID="gMaps" runat="server" />
</td>
</tr>
</table>

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Linq;

using CMS.CMSHelper;
using CMS.GlobalHelper;
using CMS.PortalControls;
using System.Web.UI.WebControls;
using CMS.SettingsProvider;
using CMS.DataEngine;

public partial class CMSWebParts_KT_StoreLocations : CMSAbstractWebPart
{
KT.RetailStructure.RetailStructureService RetailService = new KT.RetailStructure.RetailStructureService();

#region "Properties"

/// <summary>
/// Gets or sets the path of the documents.
/// </summary>
public string Path
{
get
{
return DataHelper.GetNotEmpty(ValidationHelper.GetString(GetValue("Path"), null), null);
}
set
{
SetValue("Path", value);
cmsRepeater.Path = value;
}
}

/// <summary>
/// Gets or sets value of TransformationName
/// </summary>
/// <summary>
/// Gets or sets the name of the transforamtion which is used for displaying the results.
/// </summary>
public string TransformationName
{
get
{
return DataHelper.GetNotEmpty(ValidationHelper.GetString(GetValue("TransformationName"), "KT.Store.DefaultList"), "KT.Store.DefaultList");
}
set
{
SetValue("TransformationName", value);
cmsRepeater.TransformationName = value;
}
}

/// <summary>
/// Gets or sets value of AlternatingTransformationName
/// </summary>
/// <summary>
/// Gets or sets the name of the transforamtion which is used for displaying the results.
/// </summary>
public string AlternatingTransformationName
{
get
{
return DataHelper.GetNotEmpty(ValidationHelper.GetString(GetValue("AlternatingTransformationName"), "KT.Store.DefaultListAlternating"), "KT.Store.DefaultListAlternating");
}
set
{
SetValue("AlternatingTransformationName", value);
cmsRepeater.AlternatingTransformationName = value;
}
}

/// <summary>
/// Gets or sets value of SelectedItemTransformationName
/// </summary>
/// <summary>
/// Gets or sets the name of the transforamtion which is used for displaying the results.
/// </summary>
public string SelectedItemTransformationName
{
get
{
return DataHelper.GetNotEmpty(ValidationHelper.GetString(GetValue("SelectedItemTransformationName"), "KT.Store.StoreDetails"), "KT.Store.StoreDetails");
}
set
{
SetValue("SelectedItemTransformationName", value);
cmsRepeater.SelectedItemTransformationName = value;
}
}

/// <summary>
/// Gets or sets value of SelectedItemTransformationName
/// </summary>
/// <summary>
/// Gets or sets the name of the transforamtion which is used for displaying the results.
/// </summary>
public string ItemSeparator
{
get
{
return ValidationHelper.GetString(GetValue("ItemSeparator"), "");
}
set
{
SetValue("ItemSeparator", value);
cmsRepeater.ItemSeparator = value;
}
}


#endregion

#region "Methods"

/// <summary>
/// Content loaded event handler
/// </summary>
public override void OnContentLoaded()
{
base.OnContentLoaded();
InitializeCheckboxes();
SetupControl();
}

/// <summary>
/// Initializes the control properties
/// </summary>
protected void SetupControl()
{
this.StopProcessing = true;
if (this.StopProcessing)
{
// Set WebPart properties
if (string.IsNullOrEmpty(Path))
{
Path = ".";
}

cmsRepeater.ControlContext = this.ControlContext;
cmsRepeater.Path = Path;
cmsRepeater.SelectedItemTransformationName = SelectedItemTransformationName;
cmsRepeater.TransformationName = TransformationName;
cmsRepeater.AlternatingTransformationName = AlternatingTransformationName;
cmsRepeater.ItemSeparator = ItemSeparator;

this.StopProcessing = false;
ReloadData();

}
else
{
//// Set WebPart properties
//if (string.IsNullOrEmpty(Path))
//{
// Path = ".";
//}

//cmsRepeater.ControlContext = this.ControlContext;
//cmsRepeater.Path = Path;
//cmsRepeater.SelectedItemTransformationName = SelectedItemTransformationName;
//cmsRepeater.TransformationName = TransformationName;
//cmsRepeater.AlternatingTransformationName = AlternatingTransformationName;
//cmsRepeater.ItemSeparator = ItemSeparator;
////ReloadData();
}
}

/// <summary>
/// Populate checkboxes with data
/// </summary>
private void InitializeCheckboxes()
{
KT.RetailStructure.ServiceCallResult searchableAmenities = RetailService.GetQueryableStoreFields(System.Configuration.ConfigurationManager.AppSettings["ApiKey"], "StoreLocations");
System.Data.DataTable tFuelFields = searchableAmenities.DataSetResults.Tables[0].Copy();

System.Data.DataView ServicesView = searchableAmenities.DataSetResults.Tables[0].DefaultView;
ServicesView.RowFilter = "KTComVisible = true AND IsFuelField = false";
ServicesView.Sort = "FriendlyName";
cbServices.DataSource = ServicesView;
cbServices.DataBind();

System.Data.DataView FuelOptionsView = searchableAmenities.DataSetResults.Tables[0].DefaultView;
FuelOptionsView.RowFilter = "KTComVisible = true AND IsFuelField = true";
FuelOptionsView.Sort = "FriendlyName";
cbFuel.DataSource = FuelOptionsView;
cbFuel.DataBind();
}

protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}

private void BindData()
{
DataTable dt = new DataTable();
string Where = null;
int distance = -1;
if (ddlDistance.SelectedValue != null)
{
distance = ValidationHelper.GetInteger(ddlDistance.SelectedValue, -1);
}
KT.RetailStructure.ServiceCallResult result = RetailService.GetStoreDataByProximityToCityAndState("WhereWeAre", txtCity.Text.Trim(), ddlState.SelectedItem.Value);
if (result.DataSetResults.Tables.Count > 0)
{
System.Data.DataView view = result.DataSetResults.Tables["StoreData"].DefaultView;
view.RowFilter = "ProxDistance < " + distance.ToString() + " AND ZoneNumber < 9000 AND (LocationType < 3 OR StoreNumber = 870 OR StoreNumber = 850)";

// filter based on checked services
foreach (ListItem i in cbServices.Items)
{
if (i.Selected)
{
view.RowFilter += " AND " + i.Value + " = true";
}
}
// filter based on checked fuels
foreach (ListItem i in cbFuel.Items)
{
if (i.Selected)
{
view.RowFilter += " AND " + i.Value + " = true";
}
}
Where = "StoreNumber IN(";
foreach (DataRowView rv in view)
{
DataRow row = rv.Row;
Where += Convert.ToString(row["StoreNumber"]) + ",";
}
Where += ")";
// do some cleanup to remove the last comma from the IN statement
Where = Where.Replace(",)", ")");
dt = view.ToTable();
}

DataTable dt2 = GetKenticoStores(Where);
if (dt2.Rows.Count > 0 && dt.Rows.Count > 0)
{
foreach (DataRow dr in dt2.Rows)
{
DataRow[] row = dt.Select("StoreNumber = " + Convert.ToString(dr["StoreNumber"]));
dr["ProxDistance"] = row[0]["ProxDistance"];
}
}
cmsRepeater.DataSource = dt;
cmsRepeater.DataBind();

gMaps.MapProperties.LatitudeField = "Latitude";
gMaps.MapProperties.LongitudeField = "Longitude";
gMaps.MapProperties.ZoomScale = 15;
gMaps.MapProperties.Scale = 8;
gMaps.DataSource = cmsRepeater.DataSource;
gMaps.DataBind();
}

/// <summary>
/// Reloads data
/// </summary>
public override void ReloadData()
{
base.ReloadData();

// Reload data in all controls if needed
InitializeCheckboxes();
BindData();
}

/// <summary>
/// Get the kentico store document types based on the select all query
/// </summary>
/// <param name="Where"></param>
/// <returns></returns>
private DataTable GetKenticoStores(string Where)
{
QueryDataParameters parameters = new QueryDataParameters();
GeneralConnection cn = ConnectionHelper.GetConnection();
DataSet ds = cn.ExecuteQuery("KT.Store.selectdocuments", parameters, Where);
return ds.Tables[0];
}

#endregion
}

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/7/2012 3:03:09 AM
   
RE:GetDocumentUrl() not working
Hi,

Just to be sure - the mentioned properties/columns - do they have any values?

Also, could you please try using CMSContext.GetUrl method with parameters the above mentioned columns in the Eval function - what is returned?

Best regards,
Juraj Ondrus

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 8/8/2012 11:41:39 AM
   
RE:GetDocumentUrl() not working
Kind of feel like an idiot on this one now. I looked back in my previously save versions and noticed I had assigned a different datatable as the repeaters datasource for whatever reason. Come to find out, the new datatable had the schema, although didn't have any values in it. Once I changed it back, it worked just fine. Thanks again for the help!

One other question related to this, what do I need to do in order to use the "Selected" transformation? Assuming I need to do databinding again because when I click the link to view the details, it rebinds, brings me to the correct URL but doesn't display anything and I have the Selected transformation set.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/9/2012 3:07:32 AM
   
RE:GetDocumentUrl() not working
Hi,

Thank you for the update :-) I am glad it is working now.

Regarding the selected item - basically, this should be ensured all by you - by your code. If you are using a documents data source, there is a property to enable the selected item and you can set this to true - EnableSelectedItem.

Best regards,
Juraj Ondrus