Ïò ASP.NET Web ·þÎñÆ÷¿Ø¼þÌí¼Ó¿Í»§¶Ë½Å±¾Ê¼þ
¸üУº2007 Äê 11 Ô ¿ÉÒÔÏñ¶Ô HTML ÔªËØÄÇÑù£¬ÒÔÉùÃ÷·½Ê½Ïò ASP.NET ÍøÒ³ÉϵĿؼþÌí¼Ó¿Í»§¶Ë½Å±¾¡£»òÕߣ¬Èç¹ûʼþ»ò´úÂëÒÀÀµ½öÔÚÔËÐÐʱ¿ÉÓõÄÐÅÏ¢£¬¿ÉÒÔͨ¹ý±à³Ì·½Ê½Ïò ASP.NET Web ·þÎñÆ÷¿Ø¼þÌí¼Ó¿Í»§¶Ë½Å±¾Ê¼þ¡£ ˵Ã÷£º ¿ÉÒÔÔÚ¿Í»§¶Ë½Å±¾ÖÐͨ¹ý ID ÒýÓÿؼþ¡£Óйظü¶àÐÅÏ¢£¬Çë²Î¼û ASP.NET ÍøÒ³ÖеĿͻ§¶Ë½Å±¾¡£ Ïò°´Å¥Ìí¼Ó¿Í»§¶Ë½Å±¾ onclick ʼþÐèÒªÒ»¸öרÃŹý³Ì£¬±¾Ö÷ÌâºóÃæµÄÄÚÈÝ»á¶Ô´Ë½øÐнéÉÜ¡£ ˵Ã÷£º ¶Ô¿Í»§¶Ë½Å±¾µÄÖ§³ÖÈ¡¾öÓÚä¯ÀÀÆ÷¡£ÀýÈ磬Internet Explorer¡¢Mozilla ºÍÒƶ¯É豸ä¯ÀÀÆ÷¿ÉÄÜ»á¶Ô¿Í»§¶Ë½Å±¾Ìṩ²»Í¬ÀàÐ͵ÄÖ§³Ö¡£ ÒÔÉùÃ÷·½Ê½Ïò ASP.NET ·þÎñÆ÷¿Ø¼þÌí¼Ó¿Í»§¶Ëʼþ´¦Àí³ÌÐò ÔڿؼþµÄ±ê¼ÇÖÐÌí¼ÓʼþÊôÐÔ£¬ÀýÈ磬onmouseover »ò onkeyup¡£Õë¶ÔÊôÐÔÖµÌí¼ÓÒªÖ´ÐеĿͻ§¶Ë½Å±¾¡£ ˵Ã÷£º ʼÖÕ¶¼ÒªÔÚÊôÐÔÖеĿͻ§¶Ë½Å±¾Ö®ºóÌí¼ÓÒ»¸ö·ÖºÅ (;)¡£ÕâÊDZØÐèµÄ£¬ÕâÑù¾Í¿ÉÒÔÔÚ ASP.NET Éú³É¿Ø¼þµÄ¿Í»§¶Ë½Å±¾£¨ÀýÈ磬Èç¹û¿Ø¼þµÄ AutoPostBack ÊôÐÔÉèÖÃΪ true£©Ê±Ê×ÏÈÔËÐд˴úÂë¡£ ¿Ø¼þ±ê¼ÇÖÐÈκβ»Óë¿Ø¼þÊôÐÔ (property) ¶ÔÓ¦µÄÊôÐÔ (attribute)/Öµ¶Ô¶¼»á°´ÔÑù´«µÝ¸øä¯ÀÀÆ÷¡£ ÏÂÃæµÄ´úÂëʾÀýÑÝʾһ¸ö°üº¬¿Í»§¶Ë½Å±¾µÄ ASP.NET ÍøÒ³£¬µ±Óû§½«Êó±êÒƵ½°´Å¥ÉÏ·½Ê±£¬´Ë½Å±¾¾Í»á¸ü¸Ä¸Ã°´Å¥µÄÎı¾ÑÕÉ«¡£
Untitled Page
< type="text/javascript">
var previousColor;
function MakeRed()
{
previousColor = window.event.srcElement.style.color;
window.event.srcElement.style.color = "#FF0000";
}
function RestoreColor()
{
window.event.srcElement.style.color = previousColor;
}
ÒÔ±à³Ì·½Ê½Ïò ASP.NET ¿Ø¼þÌí¼Ó¿Í»§¶Ëʼþ´¦Àí³ÌÐò
ÔÚÒ³ÃæµÄ Init »ò Load ʼþÖе÷ÓÿؼþµÄ Attributes ¼¯ºÏµÄ Add ·½·¨¡£
ÏÂÃæµÄ´úÂëʾÀýÑÝʾÈçºÎÏò TextBox ¿Ø¼þÌí¼Ó¿Í»§¶Ë½Å±¾¡£¸Ã¿Í»§¶Ë½Å±¾ÏÔʾ TextBox ¿Ø¼þÖеÄÎı¾³¤¶È¡£¸Ã½Å±¾¼Ù¶¨Ò³Ãæ°üº¬Ò»¸öÃûΪ spanCounter µÄ span ÔªËØ¡£
protected void Page_Load(object sender, EventArgs e)
{
String displayControlName = "spanCounter";
TextBox1.Attributes.Add("onkeyup", displayControlName +
".innerText=this.value.length;");
}
Ïò°´Å¥¿Ø¼þÌí¼Ó¿Í»§¶Ë Onclick ʼþ
Ïà¹ØÎĵµ£º
·ÖÀà: ר¼ÒBlog ÍƼöÕߣºadmin| ä¯ÀÀÁ¿£º489 views| 1 ¸öÆÀÂÛ
Èç¹ûÎÒÃÇÓÃIISËÞÖ÷ASP.net£¬µ¥²½µ÷ÊÔʱ£¬»áÓпÉÄÜÏÂÃæµÄÒì³£±¨³öÀ´£º
—————————
Microsoft Visual Studio
—————————
The web serv ......
ÓÃASP.NETÓëSQL SERVER¿ÉÊÇÔµ·Ý×îºÃÁË£¬ÉÔ´óµÄ³ÌÐòÒ»°ãµÚÒ»ÏÈ¿¼ÂǵÄÊÇSQL SERVER£¬Ö»ÊÇһЩºÜ¿¼ÂǾ¼ÃµÄ²ÅʹÓÃACCESSµÈÁË¡£ÓÃSQL SERVER£¬ÎªÁËʹÊý¾Ý¿âµÄЧÂʸüºÃ£¬Ò»°ã¶¼»á²ÅÈ¡´æ´¢¹ý³Ì£¬Òò´æ´¢¹ý³ÌÖ´ÐÐËٶȿ죬²¢ÇÒ¿ÉÒÔʵÏÖһЩ¸ß¼¶µÄ²éѯµÈ¹¦ÄÜ¡£±ÈÈç´«ÈëһЩÊý¾Ý²ÎÊý£¬µ«Ö´ÐеÄSQL¹ý³Ì¿ÉÄܲ»Í¬µÈ¡£
¡¡¡¡ÏÂÃæ¾ÍÀ´¸öÀý× ......
ÔÚasp.netÀïÔõô¸ú¾ÝÓû§È¨ÏÞÀ´Éú³ÉÊ÷Ðβ˵¥
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
......
Asp.NetÖÐÓÐÒ»Ì×ÓëÓû§Ïà¹ØÁªµÄÊôÐÔÉèÖ㬿ÉÒÔͨ¹ýÔÚWebConfigÀïÅäÖÃÀ´Ö±½ÓʹÓã¬ËûµÄ×÷ÓÃΪ
´æ´¢ºÍʹÓÃΨһÓëÓû§¶ÔÓ¦µÄÐÅÏ¢
Õ¹ÏÖ¸öÈË»¯°æ±¾µÄWebÓ¦ÓóÌÐò
Óû§µÄΨһÉí·Ý±êʶÔÚÔٴηÃÎÊʱʶ±ðÓû§
Asp.Net ProfileÌṩµÄ¸úÓû§Ïà¹ØµÄÀàÐͶ¼ÊÇÇ¿ÀàÐÍ
Ê×ÏÈÉú³ÉÊý¾Ý¿â½Å±¾£¬Ê¹ÓÃVisual Studio 2005 ÃüÁîÌáʾ£¬ÊäÈëÃü ......
ÔÚÒ»¸öÏîÄ¿¿ª·¢ÖУ¬showdialogµ¯³ö¶Ô»°¿òʱ£¬ÎÒ֮ǰÐ޸ĹýµÄÊý¾Ý²»»á¼°Ê±¸üУ¡
ʹÓýûÓÃURL»º´æµÄ·½·¨,½â¾öÕâ¸öÎÊÌâ
ÔÚasp.netÒ³ÃæµÄºǫ́
if (!IsPostBack)
{
Response.Buffer = true;
......