我在DataGrid里加入模板列:
<asp:DataGrid ID="DataGrid1" CellPadding="1" ShowHeader="false"   AutoGenerateColumns="false" BorderWidth="0" OnItemCommand="DataGrid1_ItemCommand" runat="server">
     <columns>
<asp:TemplateColumn>
<itemtemplate>
<table width="65%" height="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="body2">
<tr height="28px">
<td width="200" align="right" bgcolor="#9999CC">注册名称:</td>
<td bgcolor="#CCCCFF">
         <%# DataBinder.Eval(Container.DataItem,"Cl_RegID").ToString() %></td>
</tr>
<tr height="28px">
<td align="right" bgcolor="#9999CC">客户地址:</td>
<td bgcolor="#CCCCFF">
         <asp:TextBox ID="Cl_Address" Text='<%# DataBinder.Eval (Container.DataItem,"Cl_Address").ToString() %>' runat="server"/></td>
</tr>
<tr height="28px">
<td align="right" bgcolor="#9999CC">客户官方网址:</td>
<td bgcolor="#CCCCFF">
          <asp:TextBox ID="Cl_WebAddr" Text='<%# DataBinder.Eval(Container.DataItem,"Cl_WebAddr").ToString() %>' runat="server"/></td>
</tr>
         .
         .
         .
         .
</table>
</itemtemplate>
</asp:TemplateColumn>
     </columns>
</asp:DataGrid>
再在取出页面DataGrid中TextBox的数据:
string Cl_Address = ((TextBox)e.Item.Cells[0].Controls[0]).Text;
string Cl_Webaddr = ((TextBox)e.Item.Cells[0].Controls[1]).Text;
int Cl_Postalcode = Int32.Parse(((TextBox)e.Item.Cells[0].Controls[2]).Text);
运行说转换类别无效...请教!
哪位大侠能指教这类所有的转换方法吗?谢谢~~~~~~