ASP.Net ÀûÓ÷´Éäµ÷ÓÃÒ³Ãæ·½·¨
¡¡¡¡ÏÖÔںܶàµÄÕ¾µã¶¼ÊÇ»ùÓÚJQueryUI¡¢ExtJSµÈµÈ½çÃæ¿â¿ª·¢µÄ£¬¿ÉÒÔ˵ǰ̨ʹÓÃÁË´óÁ¿µÄ½Å±¾¼°¾²Ì¬Ò³Ã棬¶øºǫ́ÍùÍùÖ»×öΪÇëÇóÒ³ÃæÊý¾ÝÀ´Óã¬ÄÇôºÏÀíµÄÀûÓ÷´É䣬ͨ¹ý´«µÝÖ¸Á»ò¶¯×÷£©µÄ²ÎÊý£¬µ÷ÓÃÒ³ÃæµÄÏà¹Ø·½·¨£¬±ã¿ÉÒÔ¼õÉٺܶàµÄ´úÂëÁ¿¡£
1¡¢ËùÓеÄÒ³Ã涼¼Ì³ÐÓÚÒ»¸ö»ùÀàBasePage
2¡¢ÔÚBasePageÀàÖÐOnLoadʼþÔö¼Ó·´ÉäµÄ´úÂë
3¡¢Ò³ÃæÖÐÔö¼ÓÏàÓ¦µÄ·½·¨
string action = Request.QueryString["action"];
if (action != null)
{
Type t = this.GetType();
string result = (string)t.InvokeMember(action, BindingFlags.Instance | BindingFlags.Public | BindingFlags.InvokeMethod, null, this, null);
Response.Write(result);
Response.Flush();
Response.End();
}
ÀýÈ磬ÇëÇóµÄµØÖ·£ºhttp://www.test.com/test.aspx?action=GetOperList
ÄÇô£¬Ö»ÐèÒªÔÚtest.aspxÒ³ÃæÖÐÓÐÏàÓ¦µÄ private string GetOperList() ·½·¨£¬±ãÄÜ·´ÉäÖ´ÐУ¬·µ»ØÏàÓ¦µÄÊý¾Ý¡£
¿´ÆðÀ´ÓеãÏñMVC¿ò¼ÜÖеÄController ^_^
Ïà¹ØÎĵµ£º
Ê×ÏÈÏÈÖØÎÂһϹØÓÚb/sģʽµÄÕû¸öÇëÇó¹ý³Ì:
¿Í»§¶Ëͨ¹ýÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÇÃÈëµØÖ·À´·¢ËÍÇëÇóµ½·þÎñÆ÷¶Ë -> ·þÎñÆ÷½ÓÊÕµ½ÇëÇóÖ®ºó£¬·¢¸øÏàÓ¦µÄ·þÎñÆ÷¶ËÒ³Ã棨Ҳ¾ÍÊǽű¾£©À´Ö´ÐУ¬½Å±¾²úÉú¿Í»§¶ËµÄÏìÓ¦£¬·¢Ëͻؿͻ§¶Ë -> ¿Í»§¶Ëä¯ÀÀÆ÷½ÓÊÕµ½·þÎñÆ÷´«»ØµÄÏìÓ¦£¬¶ÔHtml½øÐ ......
<asp:FileUpload /> ÎļþÉÏ´«¿Ø¼þ
ʵÏÖÒ»¸ö¼òµ¥µÄͼƬÎļþÉÏ´«
//ÉÏ´«Îļþ¿Ø¼þʹÓãºÊµÏÖÉÏ´«Í¼Æ¬¹¦ÄÜ£¬ÉÏ´«Í¼Æ¬Ö»ÄÜÊÇjpg£¬gif£¬bmpÈýÖÖÀàÐÍ£¬Í¼Æ¬´óС²»³¬¹ý60kb
ºǫ́´úÂ룺
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using ......
˵Ã÷: Ö´Ðе±Ç° Web ÇëÇóÆڼ䣬³öÏÖδ´¦ÀíµÄÒì³£¡£Çë¼ì²é¶ÑÕ»¸ú×ÙÐÅÏ¢£¬ÒÔÁ˽âÓйظôíÎóÒÔ¼°´úÂëÖе¼Ö´íÎóµÄ³ö´¦µÄÏêϸÐÅÏ¢¡£
Òì³£ÏêϸÐÅÏ¢: System.ArgumentException: ²»Ö§³Ö URI ¸ñʽ¡£
Ô´´íÎó:
ÐÐ 30: protected void BTNCLick(object sender, EventArgs e)
ÐÐ 31: {
ÐÐ 32: System.IO. ......
ÌõÐÎÂëÊÇÆù½ñΪֹ×á¢ÊµÓõÄÒ»ÖÖ×Ô¶¯Ê¶±ð¼¼Êõ¡£ÌõÐÎÂë¼¼Êõ¾ßÓÐÒÔϼ¸¸ö·½ÃæµÄÓŵã
¡¡¡¡A£®ÊäÈëËٶȿ죺Óë¼üÅÌÊäÈëÏà±È£¬ÌõÐÎÂëÊäÈëµÄËÙ¶ÈÊǼüÅÌÊäÈëµÄ5±¶£¬²¢ÇÒÄÜʵÏÖ“¼´Ê±Êý¾ÝÊäÈ딡£
¡¡¡¡B£®¿É¿¿ÐԸߣº¼üÅÌÊäÈëÊý¾Ý³ö´íÂÊΪÈý°Ù·ÖÖ®Ò»£¬ÀûÓùâѧ×Ö·ûʶ±ð¼¼Êõ³ö´íÂÊΪÍò·ÖÖ®Ò»£¬¶ø²ÉÓÃÌõÐÎÂë¼¼ÊõÎóÂëÂʵ ......
¿ÉÒÔʹÓà ISAPI ɸѡÆ÷ÔÚ IIS Web ·þÎñÆ÷¼¶±ðʵÏÖ URL ÖØд£¬Ò²¿ÉÒÔʹÓà HTTP Ä£¿é»ò HTTP ´¦Àí³ÌÐòÔÚ
ASP.NET ¼¶±ðʵÏÖ URL ÖØд¡£±¾ÎÄÖصã½éÉÜÈçºÎʹÓà ASP.NET ʵÏÖ URL ÖØд£¬Òò´ËÎÒÃǽ«²»¶ÔʹÓà ISAPI ɸѡÆ÷ʵÏÖ
URL ÖØдµÄϸ½Ú½øÐÐÉîÈë̽ÌÖ¡£µ«ÊÇ£¬ÓдóÁ¿µÄµÚÈý·½ ISAPI ɸѡÆ÷¿ÉÓÃÓÚ URL ÖØд£¬ÀýÈ磺 ......