Asp.net³£ÓõÄ51¸ö´úÂë(·Ç³£ÊµÓÃ)
1.//µ¯³ö¶Ô»°¿ò.µã»÷תÏòÖ¸¶¨Ò³Ãæ
CODE:
Response.Write("<script>window.alert('¸Ã»áԱûÓÐÌá½»ÉêÇë,ÇëÖØÐÂÌá½»£¡')</script>");
Response.Write("<script>window.location ='http://www.51aspx.com/bizpulic/upmeb.aspx'</script>");
2.//µ¯³ö¶Ô»°¿ò
CODE:
Response.Write("<script language='javascript'>alert('²úÆ·Ìí¼Ó³É¹¦£¡')</script >");
3.//ɾ³ýÎļþ
CODE:
string filename ="20059595157517.jpg";
pub.util.DeleteFile(HttpContext.Current.Server.MapPath("../file/")+filename);
4.//°ó¶¨ÏÂÀÁбí¿òdatalist
CODE:
System.Data.DataView dv=conn.Exec_ex("select -1 as code,'ÇëÑ¡Ôñ¾ÓªÄ£Ê½' as content from dealin union select code,content from dealin");
this.dealincode.DataSource=dv;
this.dealincode.DataTextField="content";
this.dealincode.DataValueField="code";
this.dealincode. ......
1. Êý¾Ý¿â·ÃÎÊÐÔÄÜÓÅ»¯
¡¡¡¡Êý¾Ý¿âµÄÁ¬½ÓºÍ¹Ø±Õ
¡¡¡¡·ÃÎÊÊý¾Ý¿â×ÊÔ´ÐèÒª´´½¨Á¬½Ó¡¢´ò¿ªÁ¬½ÓºÍ¹Ø±ÕÁ¬½Ó¼¸¸ö²Ù×÷¡£ÕâЩ¹ý³ÌÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»»ÐÅÏ¢ÒÔͨ¹ýÉí·ÝÑéÖ¤£¬±È½ÏºÄ·Ñ·þÎñÆ÷×ÊÔ´¡£ASP.NETÖÐÌṩÁËÁ¬½Ó³Ø(Connection Pool)¸ÄÉÆ´ò¿ªºÍ¹Ø±ÕÊý¾Ý¿â¶ÔÐÔÄܵÄÓ°Ï졣ϵͳ½«Óû§µÄÊý¾Ý¿âÁ¬½Ó·ÅÔÚÁ¬½Ó³ØÖУ¬ÐèҪʱȡ³ö£¬¹Ø±ÕʱÊÕ»ØÁ¬½Ó£¬µÈ´ýÏÂÒ»´ÎµÄÁ¬½ÓÇëÇó¡£Á¬½Ó³ØµÄ´óСÊÇÓÐÏ޵ģ¬Èç¹ûÔÚÁ¬½Ó³Ø´ïµ½×î´óÏ޶ȺóÈÔÒªÇó´´½¨Á¬½Ó£¬±ØÈ»´ó´óÓ°ÏìÐÔÄÜ¡£Òò´Ë£¬ÔÚ½¨Á¢Êý¾Ý¿âÁ¬½ÓºóÖ»ÓÐÔÚÕæÕýÐèÒª²Ù×÷ʱ²Å´ò¿ªÁ¬½Ó£¬Ê¹ÓÃÍê±ÏºóÂíÉϹرգ¬´Ó¶ø¾¡Á¿¼õÉÙÊý¾Ý¿âÁ¬½Ó´ò¿ªµÄʱ¼ä£¬±ÜÃâ³öÏÖ³¬³öÁ¬½ÓÏÞÖÆµÄÇé¿ö¡£
¡¡¡¡Ê¹Óô洢¹ý³Ì
¡¡¡¡´æ´¢¹ý³ÌÊÇ´æ´¢ÔÚ·þÎñÆ÷ÉϵÄÒ»×éÔ¤±àÒëµÄSQLÓï¾ä£¬ÀàËÆÓÚDOSϵͳÖеÄÅú´¦ÀíÎļþ¡£´æ´¢¹ý³Ì¾ßÓжÔÊý¾Ý¿âÁ¢¼´·ÃÎʵŦÄÜ£¬ÐÅÏ¢´¦Àí¼«ÎªÑ¸ËÙ¡£Ê¹Óô洢¹ý³Ì¿ÉÒÔ±ÜÃâ¶ÔÃüÁîµÄ¶à´Î±àÒ룬ÔÚÖ´ÐÐÒ»´ÎºóÆäÖ´Ðй滮¾ÍפÁôÔÚ¸ßËÙ»º´æÖУ¬ÒÔºóÐèҪʱֻÐèÖ±½Óµ÷Óûº´æÖеĶþ½øÖÆ´úÂë¼´¿É¡£ÁíÍ⣬´æ´¢¹ý³ÌÔÚ·þÎñÆ÷¶ËÔËÐУ¬¶ÀÁ¢ÓÚASP.NET³ÌÐò£¬±ãÓÚÐ޸ģ¬×îÖØÒªµÄÊÇËü¿ÉÒÔ¼õÉÙÊý¾Ý¿â²Ù×÷Óï¾äÔÚÍøÂçÖеĴ«Êä¡£
¡¡¡¡ÓÅ»¯²éѯÓï¾ä
¡¡¡¡ASP.NETÖÐADOÁ¬½ÓÏûºÄµÄ×ÊÔ´Ï൱´ó£ ......
»áajaxµÄÆ®¹ý
¿´ÂÛ̳ÀïºÃ¶àÈËÔÚÕÒºǫ́»ñÈ¡js±í¸ñµÄÊý¾Ý£¬¾Í°ÑÒÔǰµÄ·½·¨·ÅÔÚÕâÀïÁË
ǰ̨£º
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>asp.net»ñȡǰ̨js±í¸ñµÄÊý¾Ý</title>
<style type="text/css"><!--
.dis-ime
{
ime-mode:disabled;
}
-->
</style>
</head>
<body>
<form id="form1" runat="server">
<h3>ʹÓÿͻ§¶ËÌí¼Ó±í¸ñµÄ±£´æ</h3>
<p>
Ö÷ÊǾÍÊÇÔÚÌá½»µ½·þÎñÆ÷֮ǰ£¬´¦ÀíºÃ±í¸ñÀïµÄÐÅÏ¢£¬È»ºó¸³Öµ¸øhidden<br />
to mqtheone:ÕâÀïÎÒÉèÖÃ×îºóÒ»ÁÐÖ»ÄÜÊäÈëÊý×ÖÁË£¬Äã¿ÉÒԲο¼Ò»ÏÂ
</p>
<div>
<table id="tab1">
<tr>
......
csÎļþ£º
using System.IO;
string context = "";
string path = HttpContext.Current.Server.MapPath("") + "\\test\\test.html";
System.Text.Encoding code = System.Text.Encoding.GetEncoding("utf-8");
StreamReader sr = null;
try
{
sr = new StreamReader(path, code);
context = sr.ReadToEnd();
context = context.Replace("<firstname>", "С³æ");
&nbs ......
*
* ʹÓÃ˵Ã÷£º1. ÔÚApplication_Start()ÖÐÆô¶¯¶¨Ê±Æ÷(¶¨Ê±Çå¿Õ´íÎóÐÅÏ¢)£ºErrorManager.Instance.Start()£¬
* ĬÈÏ12СʱÔËÐÐÒ»´Î£¬»òÓÃErrorManager.Instance.SetTimerInterval()ÉèÖá£
* 2. ÔÚApplication_Error()ÖУ¬µ±·¢Éú´íÎóʱ£¬±£´æÕâ¸ö´íÎóÐÅÏ¢²¢×ªµ½error.aspxÖÐÏÔʾÕâ¸ö´íÎó
* string key = ErrorManager.Instance.AddError();
* Response.Redirect("error.aspx?key=" + key);
* 3. ÔÚerror.aspxÖÐͨ¹ýurl´«À´µÄkey£¬È¡µÃ²¢ÏÔʾ´íÎóÐÅÏ¢£º
*&nb ......
aspxÒ³:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" CssClass="b">
<asp:ListItem Value="5">5 per page</asp:ListItem>
<asp:ListItem Selected="True" Value="10">10 per page</asp:ListItem>
<asp:ListItem Value="50">50 per page</asp:ListItem>
</asp:DropDownList> --ÿҳÏÔʾÌõÊý
<asp:Label ID="lbpageof" runat="server"></asp:Label> --ÏÔʾ·½Ê½
<asp:LinkButton ID="lbpre" runat="server" CommandArgument="prev" OnClick="PagerButtonClick">Previous</asp:LinkButton> --ǰһҳ
<asp:LinkButton ID="lbnext" runat="server" CommandArgument="next" OnClick="PagerButtonClick">Next</asp:LinkButton> --ºóÒ»Ò³
<asp:LinkButton ID="l ......
aspxÒ³:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" CssClass="b">
<asp:ListItem Value="5">5 per page</asp:ListItem>
<asp:ListItem Selected="True" Value="10">10 per page</asp:ListItem>
<asp:ListItem Value="50">50 per page</asp:ListItem>
</asp:DropDownList> --ÿҳÏÔʾÌõÊý
<asp:Label ID="lbpageof" runat="server"></asp:Label> --ÏÔʾ·½Ê½
<asp:LinkButton ID="lbpre" runat="server" CommandArgument="prev" OnClick="PagerButtonClick">Previous</asp:LinkButton> --ǰһҳ
<asp:LinkButton ID="lbnext" runat="server" CommandArgument="next" OnClick="PagerButtonClick">Next</asp:LinkButton> --ºóÒ»Ò³
<asp:LinkButton ID="l ......
aspxÒ³:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" CssClass="b">
<asp:ListItem Value="5">5 per page</asp:ListItem>
<asp:ListItem Selected="True" Value="10">10 per page</asp:ListItem>
<asp:ListItem Value="50">50 per page</asp:ListItem>
</asp:DropDownList> --ÿҳÏÔʾÌõÊý
<asp:Label ID="lbpageof" runat="server"></asp:Label> --ÏÔʾ·½Ê½
<asp:LinkButton ID="lbpre" runat="server" CommandArgument="prev" OnClick="PagerButtonClick">Previous</asp:LinkButton> --ǰһҳ
<asp:LinkButton ID="lbnext" runat="server" CommandArgument="next" OnClick="PagerButtonClick">Next</asp:LinkButton> --ºóÒ»Ò³
<asp:LinkButton ID="l ......