<tr>
<th width="219" scope="row">公司编号</th>
<td width="197"><input name="cid" type="text" id="cid" value="" /></td>
</tr>
<tr>
<th scope="row">公司名称</th>
<td><input type="text" name="cname" id="cname"/></td>
</tr>
<tr>
<th scope="row">公司描述</th>
<td><input type="text" name="cdesc" id="cdesc"/></td>
</tr>//这是前台的代码
string cid = dt.Rows[0]["cid"].ToString();
string cname= dt.Rows[0]["cname"].ToString();
string cdesc= dt.Rows[0]["cdesc"].ToString();
这是后台的 我获得的数据
我怎么才能让 cid cname cdesc等数据显示到前台上去啊
<th width="219" scope="row">公司编号</th>
<td width="197"><input name="cid" type="text" id="cid" value="" /></td>
</tr>
<tr>
<th scope="row">公司名称</th>
<td><input type="text" name="cname" id="cname"/></td>
</tr>
<tr>
<th scope="row">公司描述</th>
<td><input type="text" name="cdesc" id="cdesc"/></td>
</tr>//这是前台的代码
string cid = dt.Rows[0]["cid"].ToString();
string cname= dt.Rows[0]["cname"].ToString();
string cdesc= dt.Rows[0]["cdesc"].ToString();
这是后台的 我获得的数据
我怎么才能让 cid cname cdesc等数据显示到前台上去啊
1、定义变量为前台可以访问
protected string cid = ...;
or
public ... then
<%= cid %>即可
2、服务器控件
<asp:Literal ID="lCid" runat="server">
class中赋值 lCid.Text = ...