<asp:HyperLinkField HeaderText="Status" DataTextField="AppStatus" DataNavigateUrlFields="NavigateUrl,Id,EncrypedStatusId"
SortExpression="AppStatus" DataNavigateUrlFormatString="{0}?Id={1}"></asp:HyperLinkField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("NavigateUrl","{0}").Replace(":", Server.UrlEncode(":")) %>'
DataTextField="AppStatus"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
背后的代码:
List<DTO> listDto;
IApplication engine;
engine = new Engine();
listDto = engine.ReadHistory(Session["UserID"].ToString());
this.dvHistory.DataSource = listDto;
this.dvHistory.DataBind();
答案 0 :(得分:0)
你有没有在gridview属性datakeynames = [EncrypedStatusId,...]
答案 1 :(得分:0)
检查数据源中是否存在列EncrypedStatusId
列。