[问题] ASP gridview按钮 开启当行的详细子画面

楼主: hildaz (小呆熊)   2018-03-22 11:36:57
以下是我前端的程式码
<asp:GridView ID="GridView1" runat="server"
Width="970px" BackColor="White" BorderColor="White" BorderStyle="Ridge"
BorderWidth="2px" CellPadding="3"
CellSpacing="1" GridLines="None" AutoGenerateColumns="False"
ShowHeaderWhenEmpty="True" EnableEventValidation="false"
Visible="False"
EmptyDataText="查无资料,请用新增按钮新增"
onselectedindexchanged="GridView1_SelectedIndexChanged" >
<Columns>
<asp:BoundField DataField="序号" HeaderText="序号"
SortExpression="序号" />
<asp:BoundField DataField="病历号" HeaderText="病历号"
SortExpression="病历号" />
<asp:BoundField DataField="病患名称" HeaderText="病患名称"
SortExpression="病患名称" />
<asp:BoundField DataField="建档日期" HeaderText="建档日期"
SortExpression="建档日期" />
<asp:BoundField DataField="主治医师" HeaderText="主治医师"
SortExpression="主治医师" />
<asp:HyperLinkField NavigateUrl="Cancerplan-edit.aspx" Text="修改
" />
<asp:ButtonField ButtonType="Button" CommandName="mys" Text="修改
" />
</Columns>
</asp:GridView>
以下是我 ButtonField的内容
想知道是否有抓取到该行序号
然后要如何修正能跳到子画面 把对应详细内容呼叫出来
protected void GridView1_RowCommand1(object sender, GridViewCommandEventArgs
e)
{
Response.Write("e.CommandName = " + e.CommandName+"</br>");
if (e.CommandName == "mys")
{
int i = Convert.ToInt32(e.CommandArgument);
Response.Write("e.CommandArgument=" + i);
Response.Write("第" + i + "列" + "第1格是
作者: chen5252 (锋炮炸裂)   2018-03-26 20:36:00
跳页?

Links booklink

Contact Us: admin [ a t ] ucptt.com