Asp.netÖÐDataBinder.Eval Ó÷¨
Asp.netÖÐDataBinder.EvalÓ÷¨µÄ×ܽá
<%# Bind("Subject") %> //°ó¶¨×Ö¶Î
<%# Container.DataItemIndex + 1%> //ʵÏÖ×Ô¶¯±àºÅ
<%# DataBinder.Eval(Container.DataItem, "[n]") %>
ͨ³£Ê¹Óõķ½·¨(ÕâÈý¸öÐÔÄÜ×îºÃ)
<%# DataBinder.Eval(Container.DataItem, "ColumnName") %>
<%# DataBinder.Eval(Container.DataItem, "ColumnName", null) %>
<%# DataBinder.Eval(Container, "DataItem.ColumnName", null) %>
ÆäËûÓ÷¨
<%# ((DataRowView)Container.DataItem)["ColumnName"] %>
<%# ((DataRowView)Container.DataItem).Row["ColumnName"] %>
<%# ((DataRowView)Container.DataItem)["adtitle"] %>
<%# ((DataRowView)Container.DataItem)[n] %>
<%# ((DbDataRecord)Container.DataItem)[0] %>
<%# (((×Ô¶¨ÒåÀàÐÍ)Container.DataItem)).ÊôÐÔ.ToString() %>//Èç¹ûÊôÐÔΪ×Ö·û´®ÀàÐ;Ͳ»ÓÃToString()ÁË
DataBinder.EvalÓ÷¨·¶Àý
<%# DataBinder.Eval(Container.DataItem, "IntegerValue", "{0:c}") %>
¸ñʽ»¯×Ö·û´®²ÎÊýÊÇ¿ÉÑ¡µÄ¡£Èç¹ûºöÂÔ²ÎÊý£¬DataBinder.Eval ·µ»Ø¶ÔÏóÀàÐ͵ÄÖµ£¬
//ÏÔʾ¶þλСÊý
<%# DataBinder.Eval(Container.DataItem, "UnitPrice", "${0:F2}") %>
//{0:G}´ú±íÏÔʾTrue»òFalse
<ItemTemplate>
<asp:Image Width="12" Height="12" Border="0" runat="server"
AlternateText='<%# DataBinder.Eval(Container.DataItem, "Discontinued", "{0:G}") %>'
ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Discontinued", "~/images/{0:G}.gif") %>' />
</ItemTemplate>
//ת»»ÀàÐÍ
((string)DataBinder.Eval(Container, "DataItem.P_SHIP_TIME_SBM8")).Substring(4,4)
{0:d} ÈÕÆÚÖ»ÏÔʾÄêÔÂÈÕ
{0:yyyy-mm-dd} °´¸ñʽÏÔʾÄêÔÂÈÕ
{0:c} »õ±ÒÑùʽ
<%#Container.DataItem("price","{0:£¤#,##0.00}")%>
<%# DataBinder.Eval(Container.DataItem,"Company_Ureg_Date","{0:yyyy-M-d}")%>
Specifier Type Format Output (Passed Double 1.42) Output (Passed Int -12400)
c Currency {0:c} $1.42 &nbs
Ïà¹ØÎĵµ£º
20090626
javascriptµ÷Óø¸´°¿Ú£¨¸¸Ò³Ã棩µÄ·½·¨
window.parentÓëwindow.openerµÄÇø±ð javascriptµ÷ÓÃÖ÷´°¿Ú·½·¨
1£º window.parent ÊÇiframeÒ³Ãæµ÷Óø¸Ò³Ãæ¶ÔÏó
2£º window.opener ÊÇwindow.open ´ò¿ªµÄ×ÓÒ³Ãæµ÷Óø¸Ò³Ãæ¶ÔÏó
¾ßÌåÀý×ӾͲ»Ð´ÁË¡£
DevExpress.Web¿Ø¼þÖеÄAspxButtonµ ......
ÎÒÃÇÔÚʹÓÃhtml¿Ø¼þµÄʱºòÌáʾ»»ÐзÖΪÈýÖÖ·½Ê½£º
µÚÒ»ÖÖ:
Ö±½Ó»»ÐÐ
<input type="text" tilte="pan
da">
µÚ¶þÖÖ:
²åÈë»»ÐзûºÅ
<input type="text" tilte="pan da">
µÚÈýÖÖ:
<input type="text" tilte="pan da">
ÒÔÉÏÊÇhtmlµÄÌáʾ»»ÐУ¡
Èç¹ûÎÒÃÇÔÚÓõ½webControlµÄʱºò
¾Í ......
template.htmÄ£°åÒ³Ô´Âë:
1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2. <html xmlns="http://www.w3.org/1999/xhtml" >
3. <head>
4. <title ......
Ò»¡¢Ä¿Ç°ÔÚASP.NETÖÐÒ³Ãæ´«Öµ¹²ÓÐÕâô¼¸ÖÖ·½Ê½£º
1¡¢±íµ¥Ìá½»£¬
<form action= "target.aspx" method = "post" name = "form1">
<input name = "param1" value = "1111"/>
<input name = "param2" value = "2222"/>
</form>
....
&nbs ......
<a>±êÇ©
1. <a href=”test.aspx”></a>
2. ÕâÊÇ×î³£¼ûµÄÒ»ÖÖתÏò·½·¨;
HyperLink¿Ø¼þ
1. Asp.net ·þÎñÆ÷¶Ë¿Ø¼þ ÊôÐÔNavigateUrlÖ¸¶ ......