posts - 19,  comments - 3,  trackbacks - 0

最新评论

re: SkipLinkText会惹祸 Jeff Yang 2007-12-23 23:29  
想编辑一下,竟然出错,回复补充一下:
MSDN上明确说这个属性Default为空,但实际上不是,For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.

Screen readers read the alternate text aloud, and the image occupies only one pixel space.

这里虽然说仅针对“屏幕阅读器”这种特殊设备才会出现1px,但PC上的IE6、IE7都会出现。
<%@ Page Language="C#" AutoEventWireup="true" %>

<!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>Untitled Page</title>
<script language="C#" runat="server">
void Page_Load(Object Sender, EventArgs e) {
if (!IsPostBack) {
ArrayList values = new ArrayList();

values.Add(new PositionData("Microsoft", "Msft"));
values.Add(new PositionData("Intel", "Intc"));
values.Add(new PositionData("Dell", "Dell"));

Repeater1.DataSource = values;
Repeater1.DataBind();
}

Response.Write(Repeater1.Controls.Count);
}

public class PositionData {

private string name;
private string ticker;

public PositionData(string name, string ticker) {
this.name = name;
this.ticker = ticker;
}

public string Name {
get {
return name;
}
}

public string Ticker {
get {
return ticker;
}
}
}

</script>

</head>
<body>
<form id="form1" runat="server">
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("name") %>' ToolTip='<%# Eval("ticker") %>'></asp:Label>
<br />
</ItemTemplate>
<FooterTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Text="Footer" ForeColor="red" />
</FooterTemplate>
</asp:Repeater>
</form>
</body>
</html>
re: Repeater中FooterTemplate中的控件提取 心海無涯 2007-10-03 20:13  
無法取得,能否貼一下代碼,
HttpContext.Current.Response.Write(Repeater1.Controls.Count.ToString());結果為0;
其中
<FooterTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
請問是什麼原因?

<2008年9月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

与我联系

搜索

 

常用链接

留言簿

随笔档案

最新评论

阅读排行榜

评论排行榜