javascriptµ÷ÓÃASPº¯Êý - Web ¿ª·¢ / JavaScript
<%
function getName(num)
......
end function
%>
<script>
var num=1;
var xx=<%=getName(num)%>
</script>
ÈçºÎ²ÅÄÜÔÚjavascriptÖе÷ÓÃASP×Ô¶¨ÒåµÄº¯Êý,²¢ÇÒ¿ÉÒÔ´«²ÎÊýÄØ?
asp ÔÚ·þÎñÆ÷¶ËÔËÐеÄ
jsÔÚ¿Í»§¶Ë
²»Äܵ÷ÓõÄ
Â¥Ö÷ÏÈÒªÃ÷°×£ºJSÔÚÇ°¶Ëä¯ÀÀÆ÷ÉÏÖ´ÐУ¬¶øASPÊÇÔÚºó¶Ë·þÎñÆ÷ÉÏÖ´ÐУ¬
¿ÉÒÔͨ¹ýAJAXµÄ·½Ê½£¬
Òì²½ÇëÇó·þÎñÆ÷¶ËÖ´ÐÐASPº¯Êý£¬²¢ÇÒ¿ÉÒÔ½«²ÎÊý´©¹ýÈ¥£¬È»ºóASP½«Êä³ö½á¹û´òÓ¡£¬Ç°Ì¨¼´¿É»ñµÃ·µ»ØµÄÄÚÈÝ¡£
<%
function getName(num)
......
end function
%>
<script>
var xx=<%=getName("1")%>
</script>
Õâ¶Î±¾Éí¾Í¿ÉÒÔÔËÐС£
Èç¹ûÄãÒª½»»¥¡£µÃÓÃajax
<%
function getName(num)
getName = num*2
end function
%>
<script>
var xx="<%=getName(5)%>";
alert(xx);
</script>
ÕâÑù¿ÉÒÔ
Ïà¹ØÎÊ´ð£º
aspÐéÄâÖ÷»úʵÏÖα¾²Ì¬µÄ·½·¨£º
1¡¢ ÖØдurl²ÎÊý
Step1: ½¨Á¢Ç°Ì¨Îļþindex.asp£¬ÐÞ¸Äurl²ÎÊýÐÎʽ¡£ÓÉÓÚ¶ÁÈ¡Êý¾Ý¿âÖеļǼ²»ÊÇרÌâµÄÖص㣬¹ÊÖ±½Ó¸ø³ö:
<!--#include file="config.asp" -->
&l ......
C# code:
SqlConnection conn = CsDB.sqlcon();
SqlDataAdapter da = new SqlDataAdapter("select fwCoding from bjmuma_fwCoding where OrderNumber='" + Order + & ......
asp.netÅúÁ¿ÉÏ´«Í¼Æ¬×îºÃÓÐÔ´Â룬ÔÚÏߵȣ¡£¡£¡£¡£¡£¡£¡
Ô´ÂëºÜ³¤µÄ¡£
²Î¿¼
C# code:
HttpFileCollection files = HttpContext.Current.Request.Files;
if (files.Count <= 1)
{
......
ÇóÒ»¸öjavascript½Å±¾..
µ±µã»÷Õâ¸ö<a>Ìí¼Ó¸½½ü</a>Á´½Óʱ¾Í»áÌí¼Ó¶àÒ»ÐÐÉÏ´«¿òºÍ°´Å¥,ºÍ×îºóÒ»¸öÅԱ߻áÏÔʾ"È¡Ïû"µÄÁ´½Ó,µã»÷Õâ¸öÈ¡Ïû¾Í»áÈ¥µô×îºóÒ»ÐÐ,Ò»¸öÕâ¸ö½Å±¾Ôõôд?Íò·Öлл..
Ò ......
C# code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Runtime.InteropServices;
nam ......