后台~~~~~~~~~~~~ [System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
public static AjaxControlToolkit.CascadingDropDownNameValue[] GetDropDownSubject(string knownCategoryValues, string category)
{
Sq.BLL.TB_Regional bllSubject = new Sq.BLL.TB_Regional();
string where = "RegionalID<>0";
本来在这里想写:
if(Session["code"]!=null)
where +=" and RegionalCode='"+Session["code"].ToString()+"'"
或是
int ProID=Util.Getint(Request.QueryString["adsf"]);
if(ProID>0)
where +="and RegionalCode='"+ProID+"'"
日这里跟本就不能出Request.QueryString或是什么session
List<Sq.Model.TB_Regional> liSubject = bllSubject.GetList(" top 50 *", "" + where + "", ""); List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>(); foreach (Sq.Model.TB_Regional mSubject in liSubject)
{
values.Add(new CascadingDropDownNameValue(mSubject.RegionalName, mSubject.RegionalID.ToString()));
}
return values.ToArray();
}
前台~~~~~~~~~~~~
<asp:DropDownList ID="DDLQ" runat="server">
</asp:DropDownList>
<ajax:CascadingDropDown ID="CascadingDropDown1" runat="server" LoadingText="大类加载中..."
PromptText="请选择大类" Category="Province" ServiceMethod="GetDropDownSubject" TargetControlID="DDLQ">
</ajax:CascadingDropDown>
总结:就是怎么给红色部份传参数呢?搞了一天,郁闷
public static AjaxControlToolkit.CascadingDropDownNameValue[] GetDropDownSubject(string knownCategoryValues, string category)
{
Sq.BLL.TB_Regional bllSubject = new Sq.BLL.TB_Regional();
string where = "RegionalID<>0";
本来在这里想写:
if(Session["code"]!=null)
where +=" and RegionalCode='"+Session["code"].ToString()+"'"
或是
int ProID=Util.Getint(Request.QueryString["adsf"]);
if(ProID>0)
where +="and RegionalCode='"+ProID+"'"
日这里跟本就不能出Request.QueryString或是什么session
List<Sq.Model.TB_Regional> liSubject = bllSubject.GetList(" top 50 *", "" + where + "", ""); List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>(); foreach (Sq.Model.TB_Regional mSubject in liSubject)
{
values.Add(new CascadingDropDownNameValue(mSubject.RegionalName, mSubject.RegionalID.ToString()));
}
return values.ToArray();
}
前台~~~~~~~~~~~~
<asp:DropDownList ID="DDLQ" runat="server">
</asp:DropDownList>
<ajax:CascadingDropDown ID="CascadingDropDown1" runat="server" LoadingText="大类加载中..."
PromptText="请选择大类" Category="Province" ServiceMethod="GetDropDownSubject" TargetControlID="DDLQ">
</ajax:CascadingDropDown>
总结:就是怎么给红色部份传参数呢?搞了一天,郁闷
解决方案 »
- gridview更新的问题
- 在控制台输出内容为何输不出来呢?
- 刚下载了一个源码, 准备查看, 却出现了问题
- 碰到一个怪问题
- 再问:datagrid.aspx与frame的奇怪问题!好几天了,老没解决!!非常奇怪!
- DBhelper&DBhelper&DBhelper&DBhelper来看看这个有缺陷吗?
- 请问,自定义服务器控件的属性,直接写在tag中,和在调用它的页面的某个地方用代码赋予,有什么不同?
- 怎样获得两个IP地址之间所有可能的IP?
- 关于asp.net中类似iframe的问题!!
- 怎样将两个DropDownList关联起来
- ASP.NET按钮颜色
- gridview中服务器端全选和客户端全选有什么区别?
HttpContext.Current.Session[""]