首页 新闻 会员 周边 捐助

Request.QueryString["CITY_ID"]和Request.Q

0
悬赏园豆:5 [已解决问题] 解决于 2008-12-22 16:35

Request.QueryString["CITY_ID"]和Request.QueryString["CATEGORY_ID"],我想获取CITY_ID和CATEGORY_ID,根据不同参数名来加载不同的用户控件,该怎么获取?

liangjer的主页 liangjer | 初学一级 | 园豆:0
提问于:2008-12-22 14:25
< >
分享
最佳答案
0

if(!string.IsNullOrEmpty(Request.QueryString["CITY_ID"]))
{
  // 加载 CITY_ID
}
if(!string.IsNullOrEmpty(Request.QueryString["CATEGORY_ID"]))
{
  // 加载 CATEGORY_ID
}

码尔代夫iimax | 老鸟四级 |园豆:3138 | 2008-12-22 15:42
其他回答(1)
0

这是我以前用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等都行!

GUO Xingwang | 园豆:3885 (老鸟四级) | 2008-12-22 14:47
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册