日期:2014-05-17  浏览次数:20588 次

GridView 编辑获取ID
GridView点击编辑 弹出JS框,JS方法:javascript:getEdit(buildid );buildid怎么获取?

JS代码:
    <script language="Javascript" type="text/javascript">
        function getEdit() {
            var zuobiao = 0;
            var properties = 'status:no;resizable:no;toolbar=no;menubar=no;location=no;scroll:no;dialogWidth:640px;dialogHeight:522px;'
            var ret = showDialog("build_edit.aspx?buildid=268", 890, 738, "编辑楼盘", "#DFDFDF");
        }
    </script>
ASP.NET:
   <asp:GridView ID="gvBuildList" runat="server" EnableModelValidation="True" AutoGenerateColumns="False"
        BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"
        CellPadding="4" ForeColor="Black" GridLines="Vertical" Width="100%" AllowPaging="True"
        AllowSorting="True" DataKeyNames="id" OnRowDataBound="gvBuildList_RowDataBound"
        OnRowDeleting="gvBuildList_RowDeleting" OnSorting="gvBuildList_Sorting" 
        PageSize="20" onpageindexchanging="gvBuildList_PageIndexChanging"
        >
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="Pid" HeaderText="编号" ReadOnly="True" 
                ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" >
<ItemStyle HorizontalAlign="Center" Width="5%"></ItemStyle>
            </asp:BoundField>
            <asp:BoundField DataField="id" HeaderText="ID" ReadOnly="True" 
                ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" >
<ItemStyle HorizontalAlign="Center" Width="5%"></ItemStyle>
            </asp:BoundField>