if(!string.IsNullOrEmpty(Request.QueryString["CITY_ID"]))
{
// 加载 CITY_ID
}
if(!string.IsNullOrEmpty(Request.QueryString["CATEGORY_ID"]))
{
// 加载 CATEGORY_ID
}
这是我以前用VB.net写得,转换成C#就行了,很简单:
Select Case Request.QueryString("reqid")
Case "000"
Dim ccll As C_CourseLevelList
ccll = Me.LoadControl("~/basic/C_CourseLevelList.ascx")
MainLoader.Controls.Add(ccll)
Case "001"
Dim c_cfl As C_ComeFromList
c_cfl = Me.LoadControl("~/basic/C_ComeFromList.ascx")
MainLoader.Controls.Add(c_cfl)
Exit Select
Case Else
Exit Select
End Select
其中MainLoader是我定义的一个服务器端的容器控件,例如form,panel,div等都行!