encode the output<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem,"ColumnName").ToString()) %>

解决方案 »

  1.   

    Server是asp中的对象吧?那我在vb.net中对应的对象应该是什么呢?
      

  2.   

    same in ASP.NET, or<%# HttpUtility.HtmlEncode(DataBinder.Eval(Container.DataItem,"ColumnName").ToString()) %>
      

  3.   

    再请问一个,这里Container指的是我的DataGrid吗?
      

  4.   

    this is supposed to be in an <ItemTemplate>Container refers to a DataGridItem
      

  5.   

    <asp:DataGrid id="INFODG" runat="server" AllowPaging="True" AutoGenerateColumns="False" BorderWidth="0px"
    CellPadding="3" PageSize="20" DataKeyField="TEMPLATE_ID" Width="736px" BorderColor="DarkGray">
    <AlternatingItemStyle BackColor="White"></AlternatingItemStyle>
    <ItemStyle BackColor="SkyBlue"></ItemStyle>
    <Columns>
    <asp:BoundColumn HeaderText="No">
    <HeaderStyle Width="10px"></HeaderStyle>
    <ItemStyle Width="10px"></ItemStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="TEMPLATE_FILE" HeaderText="僼傽僀儖柤丗">
    <HeaderStyle Width="150px"></HeaderStyle>
    <ItemStyle Width="150px"></ItemStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="EXPLANE" HeaderText="愢柧丗">
    <HeaderStyle Width="450px"></HeaderStyle>
    <ItemStyle Width="450px"></ItemStyle>
    </asp:BoundColumn>
    <asp:ButtonColumn Text="愝掕" ButtonType="PushButton" CommandName="ReviseRecord">
    <HeaderStyle Width="50px"></HeaderStyle>
    <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
    </asp:ButtonColumn>
    <asp:ButtonColumn Text="嶍彍" ButtonType="PushButton" CommandName="DeleteRecord">
    <HeaderStyle Width="50px"></HeaderStyle>
    <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
    </asp:ButtonColumn>
    <asp:BoundColumn Visible="False" DataField="TEMPLATE_ID" HeaderText="TEMPLATE_ID">
    <HeaderStyle Width="0px"></HeaderStyle>
    <ItemStyle Width="0px"></ItemStyle>
    </asp:BoundColumn>
    </Columns>
    <PagerStyle NextPageText="師偺俀侽審 &gt;&gt;" Font-Size="10pt" PrevPageText="&lt;&lt; 慜偺俀侽審  " HorizontalAlign="Right"
    Position="Top"></PagerStyle>
    </asp:DataGrid>我这里面没有用到<ItemTemplate>??
      

  6.   

    你将要转换列改为用<ItemTemplate>就可以了!
      

  7.   

    小弟刚接触asp.net不久,楼上说的转换列改为用<ItemTemplate>怎么做呢?
    汗一个~~让大家见笑了
      

  8.   

    还是有点问题
    :(
    我改成<ItemTemplate>后,页面上就是创建控件出错