//ItemCreated事件
protected void rptMeuShow_ItemCreated(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
//判断Button是否存在
if (e.Item.FindControl("lbtnMoue") != null)
{
//如果存在,把对象转换为Button。
LinkButton ibtnShow = (LinkButton)e.Item.FindControl("lbtnMoue");
//产生Click事件
ibtnShow.Click += new EventHandler(ibtnShow_Click);
}
}
} //绑定各类型线路
private void ibtnShow_Click(object sender, EventArgs e)
{
LinkButton lbtnTypeLine = (LinkButton)sender;
anpShow.RecordCount = L_Line.ShowLineCount("", lbtnTypeLine.Text,shopID);
BindLine(lbtnTypeLine.Text, "");
}
private void show()
{
//这个地方我想获得上面方法中lbtnTypeLine 按纽的文本值;请问这个要怎么做啊
}
BindLine是调用另外一个绑定数据的方法; 我HTML里面的那个按纽叫:lbtnMoue
private void ibtnShow_Click(object sender, EventArgs e)
{
LinkButton lbtnTypeLine = (LinkButton)sender;
anpShow.RecordCount = L_Line.ShowLineCount("", lbtnTypeLine.Text,shopID);
BindLine(lbtnTypeLine.Text, "");
ViewState["btn"]=lbtnTypeLine.Text; }
private void show()
{
//这个地方我想获得上面方法中lbtnTypeLine 按纽的文本值;请问这个要怎么做啊
string b=ViewState["btn"].ToString(); }
就可以获得按钮上面的文字了