lhgdialogV2.37 使用
/Files/tiger8000/lhgdialogV2.37完整版.rar
?
parent.aspx 父頁面:
?
?<script src="../lhgdialog/lhgcore.min.js" type="text/javascript"></script>
?<script src="../lhgdialog/lhgdialog.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">????????
????
??? ?function opdlg2(weburl)
??????? {
??????????? J.dialog.get( 'test2', { page: weburl,width:780,height:400,title:'部門添加車輛信息', cover: false, range: true,foot: false } );
??????? }?????????????????
</script>
<body>
??? <form id="form1" runat="server">
<table>
<tr>
? <td? align="center" width="100">
????????????????????????????????????????????? <a? style="cursor:hand"? οnclick="opdlg2('../AdminCenter/SendMonthReporter.aspx?id=<%#Eval("ID")%>&type=<%#Eval("ID")%>')">上報油耗</a>
??????????????????????????????????????????? </td>
</tr>
</table>
??? </form>
</body>
</html>
如果是 gridview ,則要在 .CS 中
?
?protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
??????? {
??????????? if (e.Row.RowType == DataControlRowType.DataRow)
??????????? {
??????????????? e.Row.Attributes.Add("onmouseover", "if(this!=prevselitem){this.style.backgroundColor='#D2E9FF'}");//當鼠標停留時更改背景色
??????????????? e.Row.Attributes.Add("onmouseout", "if(this!=prevselitem){this.style.backgroundColor='#ECF5FF'}");//當鼠標移開時還原背景色
??????????????? e.Row.Attributes.Add("onclick", e.Row.ClientID.ToString() + ".checked=true;selectx(this)");
??????????????? e.Row.Attributes.Add("ondblclick", "opdlg22(" + e.Row.Cells[1].Text + ")");
??????????? }
??????? }
?
實現(xiàn)彈出窗口:e.Row.Attributes.Add("ondblclick", "opdlg22(" + e.Row.Cells[1].Text + ")");
-------------
?
然后,彈出的子頁:Child.aspx
?
關閉窗口代碼:
<script type="text/javascript">
????? var P = window.parent, E = P.setDialog();
????? function closdlg()
????? {
???????? //E.location.reload();? //此句為關閉此子窗口同時刷新父窗口
???????? //E.location.href="ListData.aspx"; //此句為關閉此子窗口同時父窗口跳轉到? ListData.aspx 頁面
???????? P.cancel();
????? }
?</script>
?
法一、在 html 中直接關閉
?<td>
??????????? <asp:Button ID="Button2" runat="server" Text="取消" OnClientClick="closdlg()"
??????????????????? Width="75px" />
????????????? </td>
?
----------------------------------------------
法二、在Button1 的 CS 代碼中關閉:
?protected void Button1_Click(object sender, EventArgs e)
??????? {
??????????? ClientScript.RegisterStartupScript(GetType(), "alert", "closdlg();alert('數(shù)據(jù)上傳成功!');", true);
??????? }
?
?
轉載于:https://www.cnblogs.com/tiger8000/archive/2010/10/09/1846686.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結
以上是生活随笔為你收集整理的lhgdialogV2.37 使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 孕妇梦到二条蛇是双胞胎吗
- 下一篇: 梦到自己喜欢别人了什么意思