日期:2014-05-18  浏览次数:20429 次

求,如何动态设置参数个数,及调用?
页面代码:
<script   type= "text/javascript ">
function   CallBack1_Load(sender,   eventArgs)
{
    selectProduct( 'NewsInfo ');
}

function   selectProduct(param)
{
    CallBack1.callback(param);
}
</script>

后台cs:
private   void   CallBack1_Callback(object   sender,   ComponentArt.Web.UI.CallBackEventArgs   e)
{
uc.SortID   =   e.Parameter;
}

问题是,我须要动态转递多个参数值,应该怎么做呢,请详细点说明,本人还很菜,谢谢了.
想达到的效果是
private   void   CallBack1_Callback(object   sender,   ComponentArt.Web.UI.CallBackEventArgs   e)
{
uc.SortID   =   e.Parameter;
uc.TypeID   =   e.Parameter;
uc.TypeID_2   =   e.Parameter;
}

------解决方案--------------------
没看明白你这个代码中的关系
不过如果参数个数不定的话,一种办法可以通过传递对象来实现
另一种可以用Params参数,

用Params参数方便点
------解决方案--------------------
到底是要干撒子?

js OR cs ???
------解决方案--------------------
uc 又是虾米东东?
------解决方案--------------------
JS对参数个数没有限制
你也可以用arguments
------解决方案--------------------
用字符串组合

还是不太明白什么意思
uc.SortID = e.Parameter;
uc.TypeID = e.Parameter;
uc.TypeID_2 = e.Parameter;

string strMy= " ";
if(SortID!= " "&&SortID!=null)
{
strMy+= "123 ";
}
if(TypeID_2!= " "&&TypeID_2 !=null)
{
strMy+= "789 ";
}

------解决方案--------------------
传个arraylist过去