Reputation: 5670
My code is like this
<asp:TextBox type="text" name="txtEndDate" Text="<%#library.GetDictionaryItem("ProfilePages_CVR nummer")%>" runat="server"></asp:TextBox>
Everything looks okay to me, But i don't know why its throwing an error
The server tag is not well formed.
Upvotes: 0
Views: 152
Reputation: 5258
The issue is that because of the ASP.net brackets which contain double quotes inside them
<asp:TextBox Text="<%# someMethod("someValue") %>" />
inside the Text field, you need to use single quotes instead of double quotes on that property, like this:
<asp:TextBox type="text" name="txtEndDate"
Text='<%# library.GetDictionaryItem("ProfilePages_CVR nummer")%>'
runat="server">
</asp:TextBox>
And it will work.
Note also that you are using the DataBinding notation ( <%#
) which will only work if your TextBox is inside a DataBound control, or you call DataBind on the control or page containing this TextBox.
Upvotes: 1
Reputation: 745
Use single quotes like:
<asp:TextBox type="text" name="txtEndDate" Text='<%#library.GetDictionaryItem("ProfilePages_CVR nummer")%>' runat="server"></asp:TextBox>
Upvotes: 2