C# aspx Êý¾Ý°ó¶¨·½·¨¼¯
Eval("")ºÍBind("")¡¡ÕâÁ½ÖÖÒ»¸öµ¥Ïò°ó¶¨£¬Ò»¸öË«Ïò°ó¶¨£¬bindÊÇË«Ïò°ó¶¨,µ«ÐèÊý¾ÝÔ´Ö§³Ö
ASP.NET 2.0¸ÄÉÆÁËÄ£°åÖеÄÊý¾Ý°ó¶¨²Ù×÷£¬°Ñv1.xÖеÄÊý¾Ý°ó¶¨Óï·¨DataBinder.Eval(Container.DataItem, fieldname)¼ò»¯ÎªEval(fieldname)¡£Eval·½·¨ÓëDataBinder.EvalÒ»Ñù¿ÉÒÔ½ÓÊÜÒ»¸ö¿ÉÑ¡µÄ¸ñʽ»¯×Ö·û´®²ÎÊý¡£Ëõ ¶ÌµÄEvalÓï·¨ÓëDataBinder.EvalµÄ²»Í¬µãÔÚÓÚ£¬Eval»á¸ù¾Ý×î½üµÄÈÝÆ÷¶ÔÏó£¨ÀýÈçDataListItem£©µÄDataItemÊôÐÔ À´×Ô¶¯µØ½âÎö×ֶΣ¬¶øDataBinder.EvalÐèҪʹÓòÎÊýÀ´Ö¸¶¨ÈÝÆ÷¡£ÓÉÓÚÕâ¸öÔÒò£¬EvalÖ»ÄÜÔÚÊý¾Ý°ó¶¨¿Ø¼þµÄÄ£°åÖÐʹÓ㬶ø²»ÄÜÓÃÓÚ Page£¨Ò³Ã棩²ã¡£µ±È»£¬ASP.NET 2.0Ò³ÃæÖÐÈÔȻ֧³ÖDataBinder.Eval£¬Äã¿ÉÒÔÔÚ²»Ö§³Ö¼ò»¯µÄEvalÓï·¨µÄ»·¾³ÖÐʹÓÃËü¡£
ÏÂÃæµÄÀý×ÓÑÝʾÁËÈçºÎʹÓÃеļò»¯µÄEvalÊý¾Ý°ó¶¨Óï·¨°ó¶¨µ½DataListÊý¾ÝÏîÄ£°å£¨ItemTemplate£©ÖеÄImage¡¢LabelºÍHyperLink¿Ø¼þ¡£
<asp:DataList ID="DataList1" RepeatColumns="5" Width="600" runat="server" DataSourceID="ObjectDataSource1">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("PhotoID","PhotoFormViewPlain.aspx?ID={0}")%>'> <asp:Image ID="Image1" Runat="server" ImageUrl= <%# Eval("FileName","images/thumbs/{0}")%>/></asp:HyperLink>
<asp:Label ID="CaptionLabel" runat="server" Text='<%# Eval("Caption") %>' />
</ItemTemplate>
</asp:DataList>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="DataComponentTableAdapters.PhotosTableAdapter"SelectMethod="GetPhotosForAlbum">
¡¡¡¡Êý¾Ý°ó¶¨Ò²¿ÉÒÔ×÷Ϊ¿Ø¼þµÄÖ÷ÌⶨÒ壨theme definition£©µÄÒ»²¿·Ö£¬ÕâÑùÎÒÃǾͿÉÒÔͨ¹ý¸Ä±äÖ÷ÌâÀ´ËæÒâµØ¸Ä±äÄ£°å»¯¿Ø¼þµÄ²¼¾ÖºÍÍâ¹Û¡£µ«ÊÇTheme£¨Ö÷Ì⣩ģ°åÖÐÖ»ÄÜʹÓÃEval£¨»òÕß ºóÃæÌÖÂÛµÄBind£©¡£°ó¶¨µ½ÈÎÒâµÄÓû§´úÂëÊDZ»½ûÖ¹µÄ¡£
1.DataBinder.EvalÓ÷¨
//ÏÔʾ¶þλСÊý
<%# DataBinder.Eval(Container.DataItem,"UnitPrice","${0:F2}") %>
//{0:G}´ú±íÏÔʾTrue»òFalse
<ItemTemplate>
<asp:Image Width="12" Height="12" Border="0" runat="server"
Ïà¹ØÎĵµ£º
תÒåÐòÁÐ ×Ö·ûÃû³Æ Unicode ±àÂë
\' µ¥ÒýºÅ 0x0027
\" Ë«Òýº ......
ÀûÓÃWM_COPYDATAÔÚÓ¦ÓóÌÐò¼ä´«µÝÊý¾ÝºÜ¼òµ¥,¿ªÏúҲС
Ò»¡¢´«µÝÊý¾Ý²¿·Ö
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace ThreeTorches
{
public struct Copydatastru ......
ÎÊ£º
1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
ÎÊÌâ1´ð°¸ÈçÏ£º
javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
·½·¨Ò»£º1¡¢Ê×ÏȽ¨Á¢Ò»¸ö°´Å¥£¬ÔÚºǫ́½«µ÷Óûò´¦ÀíµÄÄÚÈÝдÈëbutton_clickÖÐ;
2¡¢ÔÚǰ̨дһ¸öjsº¯Êý£¬ÄÚÈÝΪ ......
ÊÖ»úÒôÀÖ²¥·¢Æ÷ÀïÓÐ×ÜÎļþ×Üʱ¼äµÄͳ¼Æ£¬ÔÚ¿á¹·²¥·ÅÆ÷ÀïÕÒÁËÒ»ÏÂûÕÒµ½¡£ÄÇÎÒÏëÖªµÀÕâЩ¸èÇúµÄ×Üʱ¼ä£¬¸ÃÔõô°ì£¿
ÆäʵºÜ¼òµ¥£¬ÉÔÉÔ¶¯¶¯ÊÖ£¬¾ÍÄÜÕÒµ½´ð°¸£¡
Çë²Î¿¼Èçϲ½Ö裺
µÚÒ»²½£¬±£´æ²¥·ÅÁÐ±í£¬°ÑÀïÃæµÄ¸èÇú±£´æµ½Ò»¸öÄãϲ»¶µÄÃû×Ö¡£
µÚ¶þ²½£¬ÔÚ²¥·ÅÁбíÉÏÃæµãÓÒ¼ü£¬µ½´¦²¥·ÅÁÐ±íµ½ÄãÕҵĵ½µÄµØ·½¡£
¾²âÊÔ£¬×îР......