Hello,
I have a problem. I want to place more nested queryrepeaters in the same ascx transformation.
It will return error CS0111
Here is code:
<table>
<tr><td><b>StavbaID</b></td><td><%# Eval("StavbaID")%></td></tr>
<tr><td><b>Stavba</b></td><td><%# Eval("Stavba")%></td></tr>
<tr><td><b>Ulica</b></td><td><%# Eval("Ulica")%></td></tr>
<cms:queryrepeater StopProcessing="false" runat="server" ID="qrObce" QueryName="customtable.Obce.selectall" TransformationName="customtable.Obce.List"/>
<script runat="server">
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (this.Parent is IDataItemContainer)
{
IDataItemContainer cont = this.Parent as IDataItemContainer;
if (cont != null)
{
System.Data.DataRowView drv = (System.Data.DataRowView)cont.DataItem as System.Data.DataRowView;
if (drv != null)
{
string ObecID = ValidationHelper.GetString(drv["ObecId"], "");
if (ObecID != "")
{
qrObce.WhereCondition= "ItemId= " + ObecID;
qrObce.ReloadData(true);
}
}
else
{
Response.Write("Error: DataRowView is null");
}
}
else
{
Response.Write("Error: IDataItemContainer is null");
}
}
}
</script>
<cms:queryrepeater StopProcessing="false" runat="server" ID="qrKategorie" QueryName="customtable.StKategoria.selectall" TransformationName="customtable.StKategoria.List"/>
<script runat="server">
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (this.Parent is IDataItemContainer)
{
IDataItemContainer cont = this.Parent as IDataItemContainer;
if (cont != null)
{
System.Data.DataRowView drv = (System.Data.DataRowView)cont.DataItem as System.Data.DataRowView;
if (drv != null)
{
string KategoriaID = ValidationHelper.GetString(drv["KategoriaID"], "");
if (KategoriaID != "")
{
qrKategorie.WhereCondition= "ItemId= " + KategoriaID;
qrKategorie.ReloadData(true);
}
}
else
{
Response.Write("Error: DataRowView is null");
}
}
else
{
Response.Write("Error: IDataItemContainer is null");
}
}
}
</script>
</table>
Cen you help me, how to write correct code?