Asp.net Ajax javascript²»ÄÜдÔÚjsÎļþÖÐ
ÈçÌâ¡£
ͬÑùµÄ´úÂ룬ÎÒÔÚaspxÒ³ÃæÖоÍÊÇÄÜÖ´Ðеģ»
·ÅÔÚjsÎļþÖУ¬Í¨¹ýÒýÓÃʹÓþͲ»ÐÐÁË£¬ÎªÊ²Ã´£¿
ÎÒ²ÂÊÇScriptManagerµÄÔÒò£»
ÄÜÔÚjsÎļþÖÐÒýÈëScriptManagerô£¿
up
°Ñµ¼Èë´úÂëÒƵ½aspxÖ´ÐÐЧ¹û´úÂëºóÃæÊÔÊÔ
ʵÔÚ²»¶®ÄãÎÊʲô£¿
·ÅÔÚaspxÒ³ÃæÖеĶ«Î÷¾ÍÓ¦¸Ã·ÅÔÚjsÎļþÖпÉÒÔÔËÐУ¿²»¶®¡£
ÔÚjsÎļþÖÐÒýÈëScriptManager£¿¸ü²»¶®Ôõô»áÕâô±È΢Èí»¹³¬Ç°Ðí¶àÄꣿ
·Ï»°¶àЩ°É£¬ Ôݲ»¿¼ÂÇajax.
1¡¢Äã²»ÄÜÔÚ.jsÀïÓÃdocument.getElementById(' <%= TextBox1.ClientID %>');ÕâÑùµÄ¶«Î÷¡£
JScript code:
//Scripts/JScript.js
function showMessage(s) {
alert(s); //¼òµ¥½ÓÊÕÒ»×Ö·û´®£¬ ÓÃalert()ÏÔʾ¡£
}
C# code:
// Default.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{ // Æäʵû±ØÒª¶¯Ì¬×¢²á£¬ÕâÀïÖ»ÊǹÊÒâÓÃһ϶¯Ì¬×¢²á¡£
if (!Page.ClientScript.IsClientScriptIncludeRegistered(this.GetType(), "myMessage"))
{
Page.ClientScript.Register
Ïà¹ØÎÊ´ð£º
aspÏÂÃ棬µ±Òª¸ù¾Ý²»Í¬µÄȨÏÞÏÔʾһЩ¹¦ÄÜ°´Å¥µÄ»°»áд³É
<%
if ȨÏÞ=1 then
%>
<input type="submit" name="Submit" value="Ìá½»" />
<%
end i ......
±¾ÈËʹÓÃswfobject.jsÔÚ±¾»ú¿ÉÒÔÕý³£²¥·Å£¬µ«·¢²¼µ½win2003·þÎñÆ÷¾ÍÎÞ·¨²¥·Å£¬ÍøÉÏÕÒÁËÐí¶à¶¼ËµÐèÒªÅäÖÃMIMEÀàÐÍ£¬ÎÒÅäÖÃÁËҲûÓгɹ¦£¬Çë¸ßÊÖÖ¸µãÒ»ÏÂ
·þÎñÆ÷ÊÇ·ñÖ§³Ö£¬Â·¾¶ÊÇ·ñÕýÈ·
ÓеķþÎñÆ÷¿ÉÄܲ»Ö§³Ö
......
asp.net repeater ¿Ø¼þÔõô¿ÉÒÔÈ¡µ½×ӿؼþµÄÖµ£¬ÉèÖöϵãÔÚ ItemDataBound ʼþÔõôûÓÐÓõÄ
Request.Form["name"]
Â¥Ö÷ÄãÒªÔÚ°ÑrepeaterÖÐµÄ Ò»¸öÊôÐÔÉèÖÃһϲÅÄܽøÈëitemdataboundʼþ
¿ÉÒÔ ......
rt ÎÒÉú³ÉµÄÎļþµÄ±£´æ¶¼ÊÇutf-8 ÈçºÎÄÜÊÖ¶¯¿ØÖƳÉASCII
System.IO.File.WriteAllText(@"c:\a.txt", "hello", Encoding.ASCII);
ÄÇÊ×ÏÈ¿´Äã¶Á½øÀ´µÄÎļþÊǸöʲô±àÂë¸ñʽ,Èç¹ ......
ÕýÔÚѧϰÕâ¸ö¶«¶« ¸Ð¾õºÜ¶àµØ·½²»ÊǺܶ® ÕýÔÚŬÁ¦ É¢µã·Û¸øasp.netµÄͬÈÊÃÇ Çó½ÌºÃµÄѧϰ×ÊÁÏ Ð»Ð»
²Î¿¼
asp.net/mvcÉÏÓкܶàÄÚÈÝ¡£
×î½üÒ²ÔÚ¿´¡£
ͬÁÄ¡£
JF,3Q
±ÈÎÒÓÐǰ;, ÎÒÖÁÉÙÄ¿Ç° ......