在页面中有一个自定义的控件ID= VehicleSelector1 控件内包含三个文本框 分别是:tbVIN、tbLicense、tbModel、tbColor、tbVehicleID在从另外 一个页面传过来一个 ID 通过ID 查询 绑定到自定义控件的内容如何绑定 下面脚本在另外的页面已经实现此功能 但不知 在此页面不能实现 望高手 指点!!代码如下:string vCtlID=this.Request["vCtlID"].ToString();
string uCtlID=Session["uCtlID"].ToString();
Session.RemoveAll();
string strWhere=null;
if(VIN.Text != "")
 {
   strWhere = "bit_vin ='" + VIN.Text + "'";
  }
else
 {
   strWhere = "bit_LicenseCode = '" + LicenseCode.Text + "'";
 }
strWhere += " and (BIT_Position = 'D') AND (BIT_Owner = 'D')";
DataSet ds = this.m_cardBL.GetVehicleAndCustomerInfoByCondition(strWhere);                                        
if(ds.Tables[0].Rows.Count==0)
{
  this.lblError.Text="找不到对应的车辆!";
  this.lblError.Visible=true;
}
else if(ds.Tables[0].Rows.Count>1)
{
  this.lblError.Text="找到不止一辆车!请检查输入的信息";
  this.lblError.Visible=true;
}
else
{
DataRow row=ds.Tables[0].Rows[0];      
string strScript="<script language=javascript>"
+ "window.opener.document.all('" +vCtlID + "_tbVIN').value = '" + row["bit_vin"].ToString() + "';"
+ "window.opener.document.all('" + vCtlID + "_tbLicense').value = '" + row["bit_LicenseCode"].ToString() + "';"
+ "window.opener.document.all('" + vCtlID + "_tbModel').value = '" + row["BandName"].ToString() + " " + row["SeriesName"].ToString() + " " + row["ModelName"].ToString() + "';"
+ "window.opener.document.all('" + vCtlID + "_tbColor').value = '" + row["ColorName"].ToString() + "';"
+ "window.opener.document.all('" + vCtlID + "_tbVehicleID').value = '" + row["bit_vehicle_id"].ToString() + "';";if (!row.IsNull("bit_customer_name"))
{
strScript += "window.opener.document.all('" +uCtlID + "_tbCustomerName').value = '" + row["bit_customer_name"].ToString() + "';";
}
if (!row.IsNull("bit_customer_code"))
{
strScript += "window.opener.document.all('" + uCtlID + "_tbCustomerCode').value = '" + row["bit_customer_code"].ToString() + "';";
}
if (!row.IsNull("bit_customer_gender"))
{
strScript += "window.opener.document.all('" + uCtlID + "_tbCustomerGender').value = '" + (row["bit_customer_gender"].ToString().ToUpper().Equals("M")?"男":"女") + "';";
}
strScript += "window.opener.document.all('" + uCtlID+ "_tbCustomerID').value = '" + row["bit_customer_id"].ToString() + "';";
strScript += "window.close();" + "</script>";
this.RegisterClientScriptBlock("result",strScript);