Hello
Does anybody know if it is the way to set control's child attributes properties by inline code? I mean something like that
<asp:MenuItem Text="text" NavigateUrl='<%# GetItemURL("val") %>' ></asp:MenuItem>
CodeBehind
protected string GetItemURL(string tag)
{
if (string.IsNullOrEmpty(_pageUrl))
_pageUrl = UrlManager.CastQueryString(Request.Url.ToString());
return string.Format("{0}?item={1}", _pageUrl, tag);
}
Neither of approaches work, whatever you use <%#, <%= , Page.DataBind() etc, you get an obstacle.
It would be very ugly to set such properties in code-behind. I hope the some method allowing to set such properties in code render blocks is available
thanks in advance.