Asp.net³£ÓõÄ51¸ö´úÂë(·Ç³£ÊµÓÃ)
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.DataBind();
this.dealincode.Items.FindByValue(dv[0]["dealincode"].ToString()).Selected=true;
5.//ʱ¼äÈ¥ÃëÏÔʾ
[¸´ÖƵ½¼ôÌù°å]
CODE:
<%# System.DateTime.Parse(DataBinder.Eval(Container.DataItem,"begtime").ToString()).ToShortDateString()%>
6.//±êÌâ´øÁ´½Ó
[¸´ÖƵ½¼ôÌù°å]
CODE:
<%# "<a class=\"12c\" target=\"_blank\" href=\"http://www.51aspx/CV/_"+DataBinder.Eval(Container.DataItem,"procode")+".html\">"+ DataBinder.Eval(Container.DataItem,"proname")+"</a>"%>
7.//ÐÞ¸ÄתÏò
[¸´ÖƵ½¼ôÌù°å]
CODE:
<%# "<A href=\"editpushpro.aspx?id="+DataBinder.Eval(Container.DataItem,"code")+"\">"+"ÐÞ¸Ä"+"</A>"%>
8.//µ¯³öÈ·¶¨°´Å¥
[¸´ÖƵ½¼ôÌù°å]
CODE:
<%# "<A
Ïà¹ØÎĵµ£º
ÓÉÓÚÆäÖÂÁ¦ÓÚÔÚÒ»¸öµ¥¶ÀÒ³ÃæÉÏÃæÌṩ¹¦ÄÜ£¬Ajax web ÃÅ»§¶¼ÊÇ Ajax ¼¼ÊõµÄ½Ü×÷¡£ÔÚÒ³ÃæÉÏÌṩÖÚ¶àµÄ¹¦ÄÜ£¬Í¬Ê±ÓÖÓзþÎñÆ÷¶ËºÍ¿Í»§¶ËÁ¼ºÃµÄÐÔÄÜ£¬¶ÔÓڼܹ¹ÊÇÒ»¸ö·Ç³£´óµÄÌôÕ½¡£Ò»Ð©ÌôÕ½Ö»ÓÐÔÚÕûºÏÖÚ¶àÌØÐ﵀ web Ó¦ÓóÌÐò»òÕß¾ÛºÏÆäËûÍøÕ¾ÄÚÓõijÌÐòÉÏÃæ²ÅÓеġ£
±¾Õ½âÊÍÁË Dropthings µÄ¼Ü¹¹£¬ÄãÒ²¿ÉÒÔÔÚÄãµÄÓ¦ÓóÌÐòʹÓà ......
Àý×Ó£º
using system.web.caching
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<script language="C#" runat="server">
void Page_Load(Object Src, EventArgs E) {
DataView Source;
// Retrieve the DataView obj ......
1. Êý¾Ý¿â·ÃÎÊÐÔÄÜÓÅ»¯
Êý¾Ý¿âµÄÁ¬½ÓºÍ¹Ø±Õ
·ÃÎÊÊý¾Ý¿â×ÊÔ´ÐèÒª´´½¨Á¬½Ó¡¢´ò¿ªÁ¬½ÓºÍ¹Ø±ÕÁ¬½Ó¼¸¸ö²Ù×÷¡£ÕâЩ¹ý³ÌÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»»ÐÅÏ¢ÒÔͨ¹ýÉí·ÝÑéÖ¤£¬±È½ÏºÄ·Ñ·þÎñÆ÷×ÊÔ´¡£ASP.NETÖÐÌṩÁËÁ¬½Ó³Ø(Connection Pool)¸ÄÉÆ´ò¿ªºÍ¹Ø±ÕÊý¾Ý¿â¶ÔÐÔÄܵÄÓ°Ï졣ϵͳ½«Óû§µÄÊý¾Ý¿âÁ¬½Ó·ÅÔÚÁ¬½Ó³ØÖУ¬ÐèҪʱȡ³ö£¬¹Ø±ÕÊ ......
ASP.NET Êý¾Ý¿Ø¼þ:GridView,DataList,Repeater ,DetailsView,FormView¡£
ASP.NET Êý¾Ý¿Ø¼þ×ÛÊö£º
1.Ç°3¸öÓÃÓÚ³ÊÏÖ¶àÌõ¼Ç¼,ºóÃæ2¸öÓÃÓÚ³ÊÏÖµ¥ÌõÊý¾ÝÃ÷ϸ,¼´³£ÓõļǼÃ÷ϸ¡£
2.GridView
ºÍDetailsView¿Ø¼þµÄ²¼¾Ö¹Ì¶¨,×Ô¶¨ÒåÊý¾ÝÏÔʾµÄ²¼¾Ö¹¦ÄÜÓÐÏÞ,Ò»°ãÊʺϲ¼¾Ö¼òµ¥µÄÊý¾Ý³ÊÏÖ¡£3.DataList,RepeaterºÍ
FormViewÊý¾Ý ......