小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

html能彈出消息框嗎?

 ShangShujie 2007-04-25
ASP.NET中能彈出消息框嗎?
就是在應(yīng)用程序中使用MessageBox等彈出來的消息框!
不知道可以做到不,可以的話,該如何實(shí)現(xiàn)?
______________________________________________________________________________________________
答1:
Response.Write("<script language=‘javascript‘>alert(‘hello!‘)</script>");
______________________________________________________________________________________________
答2:
Javascript有許多內(nèi)建的方法來產(chǎn)生對(duì)話框,如:window.alert(), window.confirm(),window.prompt().等。 然而IE提供更多的方法支持對(duì)話框。如:showModalDialog() (IE 4+ 支持)
   
    test1.htm
====================
   <script>
 var mxh1 = new Array("mxh","net_lover","孟子E章")
 var mxh2 = window.open("about:blank","window_mxh")
 // 向?qū)υ捒騻鬟f數(shù)組
 window.showModalDialog("test2.htm",mxh1)
 // 向?qū)υ捒騻鬟fwindow對(duì)象
 window.showModalDialog("test3.htm",mxh2)
   </script>
    test2.htm
====================
    <script>
 var a = window.dialogArguments
 alert("您傳遞的參數(shù)為:" + a)
   </script>
   test3.htm
====================
   <script>
 var a = window.dialogArguments
 alert("您傳遞的參數(shù)為window對(duì)象,名稱:" + a.name)
   </script>
   可以通過window.returnValue向打開對(duì)話框的窗口返回信息,當(dāng)然也可以是對(duì)象。例如:
    test4.htm
===================
    <script>
 var a = window.showModalDialog("test5.htm")
 for(i=0;i<a.length;i++) alert(a[i])
    </script>
    test5.htm
===================
    <script>
       function sendTo()
       {
 var a=new Array("a","b")
 window.returnValue = a
 window.close()
        }
    </script>
    <body>
 <form>
 <input value="返回" type=button onclick="sendTo()">
 </form>
 常見問題:
 1,如何在模態(tài)對(duì)話框中進(jìn)行提交而不新開窗口?
 如果你 的 瀏覽器是IE5.5+,可以在對(duì)話框中使用帶name屬性的iframe,提交時(shí)可以制定target為該iframe的name。對(duì)于IE4+,你可以用高度為0的frame來作:例子,
 test6.htm
 ===================
 <script>
  window.showModalDialog("test7.htm")
 </script>
 test7.htm
 ===================
 if(window.location.search) alert(window.location.search)
 <frameset rows="0,*">
  <frame src="about:blank">
  <frame src="test8.htm">
 </frameset>
 test8.htm
 ===================
 <form target="_self" method="get">
 <input name=txt value="test">
 <input type=submit>
 </form>
 <script>
 if(window.location.search) alert(window.location.search)
 </script>
 2,可以通過http://servername/virtualdirname/test.htm?name=mxh方式直接向?qū)υ捒騻鬟f參數(shù)嗎?
 答案是不能。但在frame里是可以的。
______________________________________________________________________________________________
答3:
使用我的WebMessageBox控件,下載地址:
http://www.
______________________________________________________________________________________________
答4:
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
   {   
    e.Item.Cells[7].Attributes["onclick"]="return confirm(‘確認(rèn)這條記錄刪除?‘);";
   }
______________________________________________________________________________________________
答5:
if(MessageBox.Show( 要顯示的話,"標(biāo)題",MessageBoxButtons.YesNo,MessageBoxIcon.Information,MessageBoxDefaultButton.Button1,MessageBoxOptions.ServiceNotification )==DialogResult.Yes)
{
//確認(rèn)處理后要執(zhí)行的代碼
}
______________________________________________________________________________________________
答6:
記得引用:
using System.Windows.Forms;
______________________________________________________________________________________________
答7:
ubc(做程序員“挺”好!)
在asp.net中能添加system.windows.forms這個(gè)命名空間嗎?
______________________________________________________________________________________________
答8:
解決方案(右邊)有個(gè)引用,右擊添加引用
System.Windows.Forms.dll
之后才可以使用
using System.Windows.Forms;
之后就可以按 ubc(做程序員“挺”好!) 說的那樣使用MessageBox.Show啦

______________________________________________________________________________________________
答9:
JScript.Net同樣與javascript一樣的功能,還能實(shí)現(xiàn)如下:
window.showModelDialog("yourhtm.htm","center=yes,toolbar=no,status=no")且可以:
window.showModellessDialog(...同上)的功能,實(shí)現(xiàn)自定義對(duì)話框,
具體請(qǐng)參閱微軟的相關(guān)幫助。
______________________________________________________________________________________________
答10:
http://lucky_elove.www1./
______________________________________________________________________________________________
答11:
http://lucky_elove.www1./ShowList.aspx?id=1
http://lucky_elove.www1./ShowDetail.aspx?id=9EEAFE96-3393-4228-A19C-C85A1456D104
______________________________________________________________________________________________
答12:
Response.Write("<script language=‘javascript‘>alert(‘hello!‘)</script>");

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多