Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

asp.net¶¯Ì¬×¢²ájavascript×ܽá

Ò».ʹÓÃRegisterStartUpScript×¢²áÖ»Ö´ÐÐÒ»´ÎµÄjavascript
µÚ1²½(´´½¨²¢×¢²á²¢Ê¹ÓÃjavascript)£ºPage.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
//´´½¨JavaScript
string info = "<mce:script type="text/javascript"><!--alert('ÄãºÃ£¬ÎÒÊÇXXX£¡')// --></mce:script>";
//ÅжÏWelcomeÊÇ·ñÒѱ»×¢²á
if (!Page.ClientScript.IsStartupScriptRegistered("Welcome"))
{
//¶¯Ì¬×¢²á²¢Ö´ÐÐJavaScript
Page.ClientScript.RegisterStartupScript(this.GetType(), "Welcome", info);
}
}

¶þ.ʹÓÃRegisterClientScriptBlock×¢²ájavascript
µÚ1²½(´´½¨²¢×¢²ájavascript)£ºPage.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
     //´´½¨JavaScript
     string info="";
     info += "function showName(username)";
     info += "{ alert('ÄúµÄÃû×ÖÊÇ£º'+ username); }"; 
    //ÅжÏmyNameÊÇ·ñÒѱ»×¢²á
    if (!Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), "myName"))
    {
    //¶¯Ì¬×¢²áJavaScript
    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "myName", info,true);
     }
 }
µÚ2²½(µ÷ÓÃjavascript)£ºPage.aspx
<form id="form1" runat="server">
   <div>
        ÐÕÃû£º<input id="txtUserName" type="text" />
        <input id="btnSubmit" type="button" value="È·¶¨" onclick="showName(txtUserName.value)" />
   </div>
</form>
Èý.ʹÓÃRegisterClientScriptInclude×¢²ájavascript
µÚ1²½(´´½¨javascript)£ºScript/Info.js
function showName(username)
{
    alert('ÄúµÄÐÕÃûÊÇ£º'+username);
}
µÚ2²½(µ÷ÓÃjavascript)£ºPage.aspx
<form id="form1" runat="server">
   <div>
      ÐÕÃû£º<input id="txtUserName" type=


Ïà¹ØÎĵµ£º

asp.net treeview°ó¶¨Êý¾Ý¿â£¬²¢È¡½ÚµãºÍ½ÚµãµÄÄÚÈÝ

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AlltripDLL;
public pa ......

javascript ʵÏÖÊý¾Ý±í¸ñÏÔʾµÄÕ¹¿ªÓëÕÛµþ

<script   language="javascript">  
  function   ShowTableRow(id)
 
  { 
  var _Row = document.getElementById(id)   <!-- »ñÈ¡IDΪTableRowID µÄ¶ÔÏó -->
  var _Img = document.getElementById("Img"+id)
 
&nb ......

9 ¸ö»ùÓÚJavaScript ºÍ CSS µÄ Web ͼ±í¿ò¼Ü


      jQuery, MooTools, Prototype µÈÓÅÐãµÄ
JavaScript ¿ò¼ÜÓµÓи÷ÖÖÇ¿´óµÄ¹¦ÄÜ£¬°üÀ¨»æÖÆ Web ͼ±í£¬Ê¹ÓÃÕâЩ¿ò¼ÜÒÔ¼°ÏàÓ¦²å¼þ£¬ÎÒÃÇ¿ÉÒԷdz£ÇáËɵØʵÏÖÇúÏßͼ£¬Ô²±ýͼ£¬Öù״ͼµÈ
Web ͼ±íµÄ»æÖÆ£¬¶ø²»±ØÏóÒÔÍùÄÇÑùͨ¹ý¸´Ô Flash ¼¼ÊõʵÏÖ¡£±¾ÎĽéÉÜÁË9¸öÓÅÐãµÄ»ùÓÚ JavaScript Óë CSS& ......

JavaScript ½âÎö JSON Êý¾Ý

JSON £¨JavaScript Object Notation£©Ò»ÖÖ¼òµ¥µÄÊý¾Ý¸ñʽ£¬±Èxml¸üÇáÇÉ¡£ JSON ÊÇ JavaScript Ô­Éú¸ñʽ£¬ÕâÒâζ×ÅÔÚ JavaScript Öд¦Àí JSON Êý¾Ý²»ÐèÒªÈκÎÌØÊâµÄ API »ò¹¤¾ß°ü¡£
JSONµÄ¹æÔòºÜ¼òµ¥£º ¶ÔÏóÊÇÒ»¸öÎÞÐòµÄ“‘Ãû³Æ/Öµ’¶Ô”¼¯ºÏ¡£Ò»¸ö¶ÔÏóÒÔ“{”£¨×óÀ¨ºÅ£©¿ªÊ¼£¬“}&rdq ......

asp.net¿Ø¼þµÄ±éÀú

foreach(Control   con   in   this.Controls[1].Controls)  
  {  
  if(con   is   TextBox)  
  {  
  ((TextBox)con).Text="";  
  }  
  }//Õâ¶Î´úÂëÖ´Ðгɹ¦£¬µ«ÎÒ²»Ã÷°×ÕâÀïµÄ1´úÂëʲô£¿  
  µ«ÊÇ» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ