views:

35

answers:

2

Hi all!

Do any of you know why this won't work?

<asp:BoundField HeaderText='<%=Lang.GetString("ManCan_Descripcion")%>' DataField="OcdObs" />

It's like the server is ignoring the <%%> tags, the page gets rendered like this:

<th scope="col"><%=Lang.GetString("ManCan_Descripcion")%></th>
+1  A: 

runat="server" missing for the control?

Edit: Wait, aren't you supposed to use the <%# delimiter syntax instead?

I've never used that kind of binding so I'm not 100% sure here.

kprobst
If I do that it shows me this error: Error 1 Literal content ('<asp:BoundField HeaderText="') is not allowed within a 'System.Web.UI.WebControls.DataControlFieldCollection'.
Unlimited071
A: 

You need to do what you want in the code behind file before databinding. Something like this:

GridView1.Columns[0].HeaderText = Globalizer.GetGlobalizedString("TXT_HEADER_NAME");
Frank Perry