asp.net前台调用后台方法传参数
2009-07-09 10:54
531 查看
方法一:前台调用后台方法传参数
<script>
function Show()
{
var Keys=0;
var a="<%=ButtShow(""+strid+"") %>"; //调用后台变量
}
</script>
public string strid = "000";
public string ButtShow(string strs)
{
return strs;
}
方法二:不传参数
<script>
function Show()
{
var Keys=0;
var a="<%=ButtShow() %>"; //调用后台变量
}
</script>
public string strid = "000";
public string ButtShow(string strs)
{
return "123";
}
方法三:直接传参数
<script>
function Show()
{
var Keys=0;
var a="<%=ButtShow("0") %>";
}
</script>
public string strid = "000";
public string ButtShow(string strs)
{
return "123";
}
<script>
function Show()
{
var Keys=0;
var a="<%=ButtShow(""+strid+"") %>"; //调用后台变量
}
</script>
public string strid = "000";
public string ButtShow(string strs)
{
return strs;
}
方法二:不传参数
<script>
function Show()
{
var Keys=0;
var a="<%=ButtShow() %>"; //调用后台变量
}
</script>
public string strid = "000";
public string ButtShow(string strs)
{
return "123";
}
方法三:直接传参数
<script>
function Show()
{
var Keys=0;
var a="<%=ButtShow("0") %>";
}
</script>
public string strid = "000";
public string ButtShow(string strs)
{
return "123";
}
相关文章推荐
- ASP.NET后台中调用前台Javascript函数的几种方法
- ASP.NET后台代码调用前台javascript脚本的方法
- .NET后台调用前台Js参数与方法
- ASP.NET前台AJAX方法调用后台的方法写法
- 【原创】ASP.NET后台代码调用前台javascript脚本的方法
- javascript与cs代码互相调用 asp.net中前台javascript与后台C#交互 这里主要包括了javascipt与后台CS代码四种方法互调(其中包括函数与变量的访问)
- asp.net前台调用后台方法(或asp.net中Repeater控件绑定后台方法)
- asp.net前台js调用后台方法
- AjaxPro.dll,asp.net 前台js调用后台方法(无刷新)
- ASP.NET 前台Ajax技术调用后台方法
- 00asp.net前台调用后台方法以及后台调用前台JS
- asp.net后台调用前台js脚本方法
- asp.net中前台js变量与后台c#的相互调用方法
- ASP.NET,C#后台调用前台javascript的五种方法
- asp.net 后台调用前台js方法
- 关于asp.net前台js调用后台方法的问题
- ASP.Net前台调用后台变量的方法
- ASP.NET后台中调用前台Javascript函数的几种方法
- asp.net如何在前台利用jquery Ajax调用后台方法
- ASP.NET后台代码调用前台javascript脚本的方法