比如我有一个onserverclick="select(1)",这样传递参数,,结果报错,,晕,,一定要写成onserverclick="select“,才行,但是这样我怎么传参数啊。。我要根据.cs文件里的函数的参数做相应的判断的啊,请教解决方法。。

解决方案 »

  1.   

    需要用这样的做法吗?
    button 的click 的参数在cs文件中写的很清楚的啊,你传入一个1是什么情况呢?
      

  2.   

    传参你可以用Button的OnCommand 和 CommandArgument="参数"
    在CS中相应的事件中,通过Convert.ToInt32(e.CommandArgument)取参数
      

  3.   


    //try..
    create table #temp(num varchar(50))
    insert into #temp
    select '3.3GB' union all
    select '523.6MB' union all
    select '823.5KB'
    select * from #temp order by num descselect * from #temp order by 
    case when charindex('GB',num)>0 then convert(decimal,substring(num,1,charindex('GB',num)-1))*1024*1024 
         when charindex('MB',num)>0 then convert(decimal,substring(num,1,charindex('MB',num)-1))*1024 end descdrop table #temp
    /*
    3.3GB
    523.6MB
    823.5KB
    */