strSql="Select PMS_Leave.Reasons from table"
.
.
.
.
ds=New DataSet
dGrdLoc.DataSource=nothing
dGrdLoc.DataBind()
dt=New SqlDataAdapter(strSql,con)
dt.Fill(ds)
dGrdLoc.DataSource=ds
dGrdLoc.DataBind()
<asp:DataGrid id="dGrdLoc" Runat="Server">
<column>
<asp:TemplateColumn ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="100" HeaderStyle-HorizontalAlign="Center" HeaderStyle-CssClass="content_title" HeaderText="Reasons">
<ItemTemplate >
<asp:label id="Label1" text=<%#Container.DataItem("Reasons")%> runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
.
.
.
The columnfiled Reasons has been encoded using Server.HTMLEncode before entering the DB, my problem is i dont know where to write the Server.HTMLDecode to decode it...
plz helpI think you could just place it around the container tag like this:
<asp:Label id="label1" text="<%# Server.HTMLDecode(Container.DataItem("Reasons"))%>" runat="server" />
regards,
Maurits
0 comments:
Post a Comment