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

ÈÃASP.Net HTMLÒ³Ãæ´úÂë ÇåˬÆðÀ´

×Ô´ÓÓÃÁË ASP.Net MVCºó¾Íϲ»¶ÉÏÁËËü £¬ÒòΪMVC¶Ô·þÎñÆ÷¿Ø¼þµÄÒÀÀµ´ó´ó¼õÉÙ£¬ËüÉú³ÉµÄHTMLÒ³Ãæ¾Í±ÈWebFormÇåˬ¶àÁË£¬¼ÓÔØËÙ¶ÈÓÐÁËÃ÷ÏԵĸÄÉÆ¡£
µ«¶ÔÓÚÒ³ÃæÖÐÄÚǶscript£¬»¹ÊDz»Äܳ¹µ×µÄ±ÜÃ⣬È磺
<script type="text/javascript" language="javascript">
//<!--
function DepositPage() {
// ÕâÊÇÒ»¸öµÚ3·½µÄWebControl,ÓÉÓÚÊÇ·þÎñÆ÷¿Ø¼þ£¬ÊÜMasterPageÓ°Ïì,ËüµÄ¿Í»§¶ËID²¢²»ÊÇÈ·¶¨µÄ¡£
this.ctrlRadGrid = "#<%= ctrlRadGrid.ClientID %>";

// ÕâÊÇÒ»¶ÎÓÖ³ôÓÖ³¤µÄJSON£¬´ÓModalÖд«µÝ¹ýÀ´
this.accounts = <%= Modal.JSON %>;
// .............................
}
new DepositPage();
// -->
</script>
ÊÇ·ñÓÐÒ»ÖÖ·½·¨¿ÉÒÔ½«Õâ¶ÎJS²»ÄÚǶÔÚHTMLÖУ¬Ê¹ÓÃ<script src="">±ê¼Ç´ÓÍⲿÎļþ¼ÓÔØ?
´ð°¸Êǿ϶¨µÄ£¬Í¨¹ý×Ô¶¨ÒåWebControlÍêÈ«¿ÉÒÔʵÏÖ£¬ÓÐÈçÏÂWebControl
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
[ParseChildren(false)]
public class ExternalJavascriptControl : WebControl
{
private string SafeFilenamePrefix
{
get
{
return Regex.Replace( this.ClientID
, "(\\\\|\\/|\\:|\\*|\\?|\\\"|\\<|\\>|\\|)"
, "_"
, RegexOptions.ECMAScript | RegexOptions.Compiled
);
}
}
protected override void Render(HtmlTextWriter writer)
{
if (!Visible)
return;
try
{
using (StringWriter sw = new StringWriter())
{
using (HtmlTextWriter htw = new HtmlTextWriter(sw))
{
base.Render(htw);
// get the rendered content
string rendered = sw.ToString();
// remove the script tag if exist
rendered = Regex.Replace(rendered
, @"(<[\s\/]*script\b[^>]*>)"
, string.Empty
, RegexOptions.ECMAScript | RegexOptions.Compiled | RegexOptions.IgnoreCase
);
// get the file pa


Ïà¹ØÎĵµ£º

ÔÚASP.netÖÐʹÓö¯Ì¬¿Ø¼þ

¾­³£¼ûµ½ÓÐÈË˵ÔÚASP.netÖв»ÒªÊ¹Óö¯Ì¬¿Ø¼þ,ÎÒÏëÖ÷ÒªµÄÔ­ÒòÔÚÓÚʹÓö¯Ì¬¿Ø¼þ»á´øÀ´Ò»Ð©ÎÊÌâ,ÔÚ×öÏîÄ¿µÄ¹ý³ÌÖÐ,ÎÒ½«Óɶ¯Ì¬¼ÓÔؿؼþÒý·¢µÄ×ÜÊÇ×÷ÁËÒ»¸öССµÄ×ܽá.
    1 ¡¢ÔÚʹÓÃLoadControl¼ÓÔؿؼþºó,Óû§¿Ø¼þÖеÄijЩ¿Ø¼þ²»ÔÙÏìӦʼþ¡£
    Õâ¸öÎÊÌâÖ÷ÒªÊÇÓÉÓÚ½«¿Ø¼þ¼ÓÔØ·ÅÔÚif (!Page ......

asp.net Ò³ÃæÀàÉú³É¼°´úÂëÒþ²Ø¼¼Êõ

·þÎñÆ÷¶Ë½Å±¾¿é£º
<script runat="server">
     int my = 10;
</script>
    
·ÖÉ¢µÄ½Å±¾    
<%= my.ToString() %>
<% Response.Write(my); %>
        
.aspxÎļþµÄÄÚÈݱ»½âÎöÎ ......

htmlÒ³ÃæÖÐǶÈëflashÎļþ

´Ë´¦Ç¶ÈëµÄflashÀïÃæµÄͼƬÊÇ¿ÉÒÔËæʱ·¢Éú¸Ä±äµÄͼƬ£¨¶¯Ì¬Í¼Æ¬£©
×¢ÒâÀ¶É«×ÖÌåµÄµØ·½£¬ÕâЩµØ·½¶¼ÒªÍ³Ò»
<script language="javascript">AC_FL_RunContent = 0;</script>
  <script src="${ctx}/ui/Login/AC_RunActiveContent.js"
   language="javascript"></script& ......

´ÓÊý¾Ý¿âÖÐÈ¡ÖµÅúÁ¿Éú³ÉhtmlÎļþ

1. web.config
<connectionStrings>
<add name ="myconn" connectionString="Data Source=who\SQLEXPRESS; Initial Catalog=dbname;Integrated Security=True;" providerName="System.Data.SqlClient"/>
</connectionStrings>
2.
string htmlPath = "D:\\htmlFiles";
......

ÓÃASP.Net FormsģʽʵÏÖWebServiceÉí·ÝÑéÖ¤

ÔÚ°²È«ÐÔÒªÇó²»ÊǺܸߵÄASP.Net³ÌÐòÖУ¬»ùÓÚFormsµÄÉí·ÝÑéÖ¤ÊǾ­³£Ê¹ÓõÄÒ»ÖÖ·½Ê½£¬¶øÈç¹ûÐèÒª¶ÔWebService½øÐÐÉí·ÝÑéÖ¤£¬×î³£ÓõĿÉÄÜÊÇ»ùÓÚSoap ±êÍ·µÄ×Ô¶¨ÒåÉí·ÝÑéÖ¤·½Ê½¡£Èç¹û¶ÔÁ½Õß×öһϱȽϵĻ°£¬ÏÔÈ»£¬»ùÓÚFormsµÄÑéÖ¤·½Ê½¸ü¼Ó·½±ãÒ×Óã¬ÄÜ·ñ½«FormsÑéÖ¤·½Ê½Ó¦Óõ½WebServiceÖÐÈ¥ÄØ£¿
    ´ÓÀíÂÛÉ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ