Apply Layer Definition Query at startup
Hi,
I want a layer definition query to be applied on my parcels layer based on the user who is logged in. Can someone throw some insight into how it could be done in Geocortex web ADF version 2.2
best Regards,
Yakeen
0
-
Hi all,
I have tried to make a custom startup action to apply a layer definition query to the parcels layer at start up. The followingcode which gives error at the bold line of the code below.
namespace CustomStartupActions
{
public class UserVerifyStartupAction : StartupAction
{
public override void ExecuteAfterConstruct()
{
if (!Page.IsPostBack && !Page.IsCallback)
{
ESRI.ArcGIS.ADF.Web.UI.WebControls.Map adfMap = (ESRI.ArcGIS.ADF.Web.UI.WebControls.Map)Page.FindControl("Map1");
ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality agsMapFunctionality = (ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality)adfMap.GetFunctionality(0);
if (agsMapFunctionality != null)
{
LayerDescription ld;
ld = agsMapFunctionality.MapDescription.LayerDescriptions[3];
ld.DefinitionExpression = "parcel_id=121";
adfMap.Refresh();
}
}
}
}The Error Message is “Index was out of range. Must be non negative or less than the size of the collection”. Could someone out there help??
Regards,
Yakeen
0 -
I get this error when the query doesn't exist - e.g is parcel ID = 121 a valid number? is it the right format? does this work instead? "parcel_id='121'" 0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
2 kommentarer