有人可以帮我处理这个 gridview 和 fancybox 吗?
can someone help me with this gridview and fancybox?
我在 gridview 中有一个按钮,但我无法放入按钮字段 class 所以我可以调用 fancybox 谁能帮我一些选择?
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
CssClass="table table-bordered bs-table"
allowpaging="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" EnableModelValidation="True">
<HeaderStyle BackColor="#FE2E2E" Font-Bold="true" ForeColor="white" />
<Columns>
<asp:BoundField DataField="Nombre" HeaderText="Nombre" ReadOnly="True" SortExpression="Nombre" ControlStyle-Width="70px" >
</asp:BoundField>
<asp:BoundField DataField="FechaNac" HeaderText="FechaNac" SortExpression="FechaNac" >
</asp:BoundField>
<asp:BoundField DataField="Teléfono Casa" HeaderText="Teléfono Casa" SortExpression="Teléfono Casa" />
<asp:BoundField DataField="Teléfono Celular" HeaderText="Teléfono Celular" SortExpression="Teléfono Celular" />
<asp:BoundField DataField="Edad" HeaderText="Edad" SortExpression="Edad" ReadOnly="True" />
<asp:BoundField DataField="Estatus" HeaderText="Estatus" SortExpression="Estatus" ReadOnly="True" />
<asp:BoundField DataField="Atendido por" HeaderText="Atendido por" SortExpression="Atendido por" ReadOnly="True" />
<asp:ButtonField CommandName="Select" ControlStyle-CssClass="btn glyphicon glyphicon-earphone" />
</Columns>
</asp:GridView>
如果您想在 select 命令中添加它,请将 DatosCiudadanos class 添加到您的按钮字段:
<asp:ButtonField CommandName="Select" ControlStyle-CssClass="btn glyphicon glyphicon-earphone DatosCiudadanos" />
添加在 href 中提供 aspx 页面 属性 :
<script type="text/javascript"> $(document).ready(function () {
$(".DatosCiudadanos").
fancybox(
{
'autoScale': false,
'transitionIn': 'none',
'transitionOut': 'none', 'width': 680,
'height': 450,
'type': 'iframe',
'href': "/youraspxpage.aspx"
}
);
});
</script>
我在 gridview 中有一个按钮,但我无法放入按钮字段 class 所以我可以调用 fancybox 谁能帮我一些选择?
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
CssClass="table table-bordered bs-table"
allowpaging="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" EnableModelValidation="True">
<HeaderStyle BackColor="#FE2E2E" Font-Bold="true" ForeColor="white" />
<Columns>
<asp:BoundField DataField="Nombre" HeaderText="Nombre" ReadOnly="True" SortExpression="Nombre" ControlStyle-Width="70px" >
</asp:BoundField>
<asp:BoundField DataField="FechaNac" HeaderText="FechaNac" SortExpression="FechaNac" >
</asp:BoundField>
<asp:BoundField DataField="Teléfono Casa" HeaderText="Teléfono Casa" SortExpression="Teléfono Casa" />
<asp:BoundField DataField="Teléfono Celular" HeaderText="Teléfono Celular" SortExpression="Teléfono Celular" />
<asp:BoundField DataField="Edad" HeaderText="Edad" SortExpression="Edad" ReadOnly="True" />
<asp:BoundField DataField="Estatus" HeaderText="Estatus" SortExpression="Estatus" ReadOnly="True" />
<asp:BoundField DataField="Atendido por" HeaderText="Atendido por" SortExpression="Atendido por" ReadOnly="True" />
<asp:ButtonField CommandName="Select" ControlStyle-CssClass="btn glyphicon glyphicon-earphone" />
</Columns>
</asp:GridView>
如果您想在 select 命令中添加它,请将 DatosCiudadanos class 添加到您的按钮字段:
<asp:ButtonField CommandName="Select" ControlStyle-CssClass="btn glyphicon glyphicon-earphone DatosCiudadanos" />
添加在 href 中提供 aspx 页面 属性 :
<script type="text/javascript"> $(document).ready(function () {
$(".DatosCiudadanos").
fancybox(
{
'autoScale': false,
'transitionIn': 'none',
'transitionOut': 'none', 'width': 680,
'height': 450,
'type': 'iframe',
'href': "/youraspxpage.aspx"
}
);
});
</script>