在 Repeater 中,怎么根据不同的取值,来绑定不同的控件呢

在 Repeater 中,如何根据不同的取值,来绑定不同的控件呢?
开发环境:VS 2005 

HTML CODE 
<asp:Repeater ID="Repeater1" runat="server"> 
<ItemTemplate> 
<tr> 
// 如果 Eval("Type") == "1"
<td> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </td> 
// 如果 Eval("Type") == "2"
<td> <asp:CheckBox ID="CheckBox1" runat="server"></asp:CheckBox> </td> 
</tr> 
</ItemTemplate> 
</asp:Repeater> 


------解决方案--------------------
不如放两个控件,根据不同的值隐藏显示好了。
------解决方案--------------------
ItemTemplate里内容在后台Repeater的ItemDataBound根据Type值得动态创建

protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
DataRowView drv = e.Item.DataItem as DataRowView;
if (drv["Type"].ToString()=="1")
{
//HtmlTableRow
//HtmlTableRow里add HtmlTableCell, HtmlTableCell add TextBox 
}
else //2
{
//save as code up, and CheckBox
}

}

------解决方案--------------------
ItemTemplate里内容在后台根据Type值得动态创建 
可以这样写
public string IsType( string Type)
{
if (Type== "1")
{
return "";
}
else
{
return "提前结束投票:未启动";
}
}

------解决方案--------------------
ItemTemplate里内容在后台根据Type值得动态创建 
可以在后太这样写 
public string IsType( string Type) 

string Show;
if (Type== "1") 

return Show="<input =\"text\" id=\"TextBox\">"; 
}
else 

return Show="<input =\"Radi\" id=\"Radio\">"; 



前台
<asp:Repeater ID="Repeater1" runat="server"> 
<ItemTemplate> 
<tr> 

<td> <%#IsType(Eval("Type").ToString())%> </td> 
</tr> 
</ItemTemplate> 
</asp:Repeater> 


我这就直接写的不是在IDE写的 要用的话自己在好好弄下