模式窗口
public void Bind2()
{
if (Request.QueryString["Oid"] != null)
{
string oid = Request.QueryString["Oid"].ToString();
GridView2.DataSource = LIDal.GetLineItem(0, 0, "0", oid, "0");
GridView2.DataBind();
this.MessageStr.Text = "<script>sAlert();</script>";
}
}
<script type="text/javascript"> function unselectall(){ if(document.form1.ckAll.checked){ document.form1.ckAll.checked = document.form1.ckAll.checked&0; } } function CheckAll(form){ for (var i=0;i<form.elements.length;i++){ var e = form.elements[i]; if (e.Name != 'ckAll'&&e.disabled==false) e.checked = form1.ckAll.checked; } } function sAlert(){ var msgw,msgh,bordercolor; msgw=600;//提示窗口的宽度 msgh=100;//提示窗口的高度 titleheight=80;//提示窗口标题高度 bordercolor="#336699";//提示窗口的边框颜色 titlecolor="#99CCFF";//提示窗口的标题颜色 var sWidth,sHeight; sWidth=document.body.offsetWidth; sHeight=document.body.offsetHeight; if (sHeight<screen.height) { sHeight=screen.height; } var bgObj=document.createElement("div"); bgObj.setAttribute('id','bgDiv'); bgObj.style.position="absolute"; bgObj.style.top="-8"; bgObj.style.background="#777"; bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75"; bgObj.style.opacity="0.6"; bgObj.style.left="0"; bgObj.style.width=sWidth + "px"; //bgObj.style.width = "100%"; bgObj.style.height=sHeight + "px"; //bgObj.style.height = "100%"; bgObj.style.zIndex = "10000"; document.body.appendChild(bgObj); var msgObj=document.getElementById("divG2"); // msgObj.setAttribute("id","msgDiv"); msgObj.setAttribute("align","center"); msgObj.style.background="white"; msgObj.style.border="1px solid " + bordercolor; msgObj.style.position = "absolute"; msgObj.style.left = "50%"; msgObj.style.top = "50%"; msgObj.style.display = "block"; msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif"; msgObj.style.marginLeft = "-225px"; msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px"; msgObj.style.width = msgw + "px"; msgObj.style.height =msgh + "px"; msgObj.style.textAlign = "center"; msgObj.style.lineHeight = (msgh-titleheight) + "px"; msgObj.style.zIndex = "10001"; } </script> <div id="divG2" style="display:none;"> 邮递公司:<asp:DropDownList ID="ddlDiCSend" runat="server"> </asp:DropDownList> 取货方式:<asp:DropDownList ID="ddlGetType" runat="server"> <asp:ListItem Value="1">现取</asp:ListItem> <asp:ListItem Value="2">邮寄</asp:ListItem> </asp:DropDownList> <%-- 缴费方式:<asp:DropDownList ID="ddlChargeType" runat="server"> <asp:ListItem Value="1">现结</asp:ListItem> <asp:ListItem Value="2">赊欠</asp:ListItem> </asp:DropDownList>--%> <asp:Button ID="btnOk" runat="server" Text="完成" OnClick="btnOk_Click" CssClass="button2" Height="24px" Width="53px" /> <asp:Button ID="btnCancle" runat="server" Text="取消" OnClick="btnCancle_Click" CssClass="button2" Height="24px" Width="53px" /> <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" Width="600px" AllowPaging="True" OnPageIndexChanging="GridView2_PageIndexChanging"> <RowStyle CssClass="gvitem" /> <Columns> <asp:TemplateField HeaderText="是否缴费"> <ItemTemplate> <input name="Checkbox1" type="checkbox" value='<%# Eval("OrderUnitId") %>' onclick='unselectall()'/> </ItemTemplate> <HeaderTemplate> 选择<input id="ckSelectAll" name="ckAll" type="checkbox" onclick='CheckAll(this.form)'/> </HeaderTemplate> </asp:TemplateField> <asp:BoundField DataField="OrderUnitName" HeaderText="商品名称" /> <asp:BoundField DataField="SalesQuantity" HeaderText="商品数量" /> </Columns> <PagerTemplate> <br /> <asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1) + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label> <asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="First" ></asp:LinkButton> <asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="Prev" ></asp:LinkButton> <asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Next" ></asp:LinkButton> <asp:LinkButton ID="lbnLast" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Last" ></asp:LinkButton> </PagerTemplate> <PagerStyle BackColor="#F1F7FC" /> <HeaderStyle CssClass="gvheader" /> </asp:GridView> </div>