I have one static class with two property.
public class SiteDetails
{
public static string MetaIndexKeyword { get; set; }
public static string SiteName { get; set; }
}
And one default page where i need to assign these static value on page load.
<meta name="keywords" content='<%= DealCollector.Model.SiteDetails.MetaIndexKeyword %>' />
<asp:Label id="test" runat="server" Text='<%= DealCollector.Model.SiteDetails.HtmlMetaKeyword %>'></asp:Label>
And Static class and Default page Namespaces are different.
When I am calling simply like this
<%= DealCollector.Model.SiteDetails.HtmlMetaKeyword %>
Then it working fine but in control and meta value it’s not showing value.
please help me to find this solution.
<%= expressionscannot be used as properties, you have to use<%# expressionsinstead.Since
<%# expressionsare evaluated atDataBind()time, if you used that, then you need to callDataBind();method atPreRenderCompletelike..Finally it will be like, if you set the property to your label control