悬赏园豆:10
[已解决问题]
解决于 2007-11-25 22:45
<P>在updatepanel里面的三个下拉框初始化的时候为什么取不到值呢?</P>
<P>代码如下:</P>
<P>private void BindCountry()<BR> {<BR> //绑定下拉框<BR> NewsClass.t_set_countryClass countrylib = new NewsClass.t_set_countryClass();<BR> DataSet dsCountry = countrylib.GetList("1=1 ");<BR> this.DdlCountry.DataSource = dsCountry;<BR> this.DdlCountry.DataBind();<BR> if (null != dsCountry)<BR> {<BR> NewsClass.ProvinceClass provincelib = new NewsClass.ProvinceClass();<BR> DataSet dsprovince = provincelib.GetList(" 1=1 and [Country_Id]='" + this.DdlCountry.SelectedValue.ToString() + "'");<BR> this.DdlProvince.DataSource = dsprovince;<BR> this.DdlProvince.DataBind();<BR> if (dsprovince != null)<BR> {<BR> NewsClass.CityClass citylib = new NewsClass.CityClass();<BR> DataSet dsCity = citylib.GetList(" 1=1 and [Province_Id]='" + this.DdlProvince.SelectedValue.ToString() + "'");<BR> this.DdlCity.DataSource = dsCity;<BR> this.DdlCity.DataBind();<BR> }<BR> }<BR> }</P>
<P mce_keep="true">this.DdlCountry.SelectedValue.ToString() 取到的是<FONT face=Arial>'System.Data.DataRowView' </FONT></P>
<P mce_keep="true"><FONT face=Arial>错误提示是:</FONT></P>
<P mce_keep="true"><FONT face=Arial>将varchar 值 'System.Data.DataRowView' 转换为数据类型为 int 的列时发生语法错误</FONT></P>
<P mce_keep="true"><FONT face=Arial>可是在没有用updatepanel的时候就能够取到。</FONT></P>
<P mce_keep="true"><FONT face=Arial>是需要设置什么吗?还是怎么样呐?</FONT></P>
<P mce_keep="true"><FONT face=Arial>麻烦大家帮帮忙....<BR></P></FONT>
<P mce_keep="true"> </P>
如烟
|
菜鸟二级
|
园豆:
210
提问于:2007-11-23 17:47