public partial class management_EsseyDU : System.Web.UI.Page
{
private int pn;
protected void Page_Load(object sender, EventArgs e)
{
string pns = Request.QueryString["pno"];
if (pns == null) pn = 0;
else pn = Convert.ToInt32(pns);
atcllist.PageIndex = pn;
EsseyOperator eop = new EsseyOperator();
atcllist.DataSource = eop.DisplayList();
atcllist.DataBind();
eop.ConnFree();
}//atcllist是一个GridView控件~~
//eop.DisplayList()的返回值是一个DataView...
//显示的时候全是正常的..就是下面这个出问题!!! protected void atcllist_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
Response.Write(atcllist.Rows[e.RowIndex].Cells[0].Text == ""? "EMPTY" : "NOT");
}
}为什么atcllist.Rows[e.RowIndex].Cells[0].Text 老是""呢??
显示都是正常的啊..其它操作也都正常~~
上面输不出来..想删数据就不好干啊..atcllist.Rows[e.RowIndex].Cells.Count 输出的时候为 2...atcllist.Rows[e.RowIndex].Cells[1].Text 也是 ""e.Keys.Count.ToString() 输出为 0e.Values.Count.ToString() 输出为 0这是怎么回事啊..搞不懂了..搞了好久都没搞通...DX们 救人啊啊啊啊啊!!!!!~~
{
private int pn;
protected void Page_Load(object sender, EventArgs e)
{
string pns = Request.QueryString["pno"];
if (pns == null) pn = 0;
else pn = Convert.ToInt32(pns);
atcllist.PageIndex = pn;
EsseyOperator eop = new EsseyOperator();
atcllist.DataSource = eop.DisplayList();
atcllist.DataBind();
eop.ConnFree();
}//atcllist是一个GridView控件~~
//eop.DisplayList()的返回值是一个DataView...
//显示的时候全是正常的..就是下面这个出问题!!! protected void atcllist_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
Response.Write(atcllist.Rows[e.RowIndex].Cells[0].Text == ""? "EMPTY" : "NOT");
}
}为什么atcllist.Rows[e.RowIndex].Cells[0].Text 老是""呢??
显示都是正常的啊..其它操作也都正常~~
上面输不出来..想删数据就不好干啊..atcllist.Rows[e.RowIndex].Cells.Count 输出的时候为 2...atcllist.Rows[e.RowIndex].Cells[1].Text 也是 ""e.Keys.Count.ToString() 输出为 0e.Values.Count.ToString() 输出为 0这是怎么回事啊..搞不懂了..搞了好久都没搞通...DX们 救人啊啊啊啊啊!!!!!~~
{
string str = atcllist.Rows[e.RowIndex].Cells[0].Text.Trim();
this.Response.Write("<script>alert('"+str+"');</script>");
//.................................
}
//看看str是什么
主要是atcllist的
<Columns>
<asp:BoundField DataField="s_typeid" HeaderText="新闻类别编码" ReadOnly="True">
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" Width="120"/>
</asp:BoundField>
<asp:TemplateField HeaderText="新闻类别名称">
<EditItemTemplate>
<asp:TextBox ID="txtName" runat="server" Text='<%# Bind("s_name") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblName" runat="server" Text='<%# Bind("s_name") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left"/>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
Text="更新"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
Text="取消"></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
Text="编辑"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
OnClientClick='return confirm("确认要删除吗?")' Text="删除"></asp:LinkButton>
</ItemTemplate>
<HeaderStyle Width="100px" />
</asp:TemplateField>
</Columns>
<HeaderStyle Font-Size="14px" />
</asp:GridView>
-----------------------------------------------------------------------------------------
<PagerSettings Visible="False" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table width="100%" cellpadding="1" cellspacing="2">
<tr valign="top">
<td valign="bottom"><table width="100%" cellpadding="1" cellspacing="2" bgcolor="#efffef"><tr>
<td align="left" valign="bottom"><span class="at"><a href="EsseyEdit.aspx?aid=<%#DataBinder.Eval(Container.DataItem,"alId") %>"><%#DataBinder.Eval(Container.DataItem,"alTitle") %></a></span></td>
<td align="right" valign="bottom"><span class="at">添加时间:<%#DataBinder.Eval(Container.DataItem,"alAddTime","{0:D}") %></span></td>
</tr></table></td>
</tr>
<tr>
<td valign="bottom"><table width="100%" cellpadding="1" cellspacing="2" bgcolor="#dddddd"><tr>
<td valign="bottom" align="left"><span class="at">所属分类:<a href="../Article.aspx?tid=<%#DataBinder.Eval(Container.DataItem,"alCId") %>">[<%#DataBinder.Eval(Container.DataItem,"acName") %>]</a></span></td>
<td valign="bottom" align="center"><span class="at">点击次数:<%#DataBinder.Eval(Container.DataItem,"alHit") %></span></td>
<td valign="bottom" align="right"><span class="at">作者:<%#DataBinder.Eval(Container.DataItem,"alAuthor") %></span></td>
</tr></table></td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField CancelText="Cancel" DeleteText="Delete" EditText="Edit" HeaderText="Operate"
InsertText="Insert" NewText="new" SelectText="select" ShowEditButton="false" ShowDeleteButton="true" UpdateText="update"
ItemStyle-CssClass="at" ItemStyle-BackColor="#ddefef" />
</Columns>
</asp:GridView>
但是我现在想自定义格式啊..
就不行了...