2
// JScript File
function fnCheckBrowserType(var k)
{
if(k>0)
{
document.getElementByID('<%=HhdnBrowsertype.ClientID%>').value="1"
return true;
}
else
{
document.getElementByID('<%=HhdnBrowsertype.ClientID%>').value="0"
return false;
}
in.cs页面加载如何从javascript获取返回值的.cs页
Page.ClientScript.RegisterStartupScript(typeof(string), "fnCheckBrowserType", "fnCheckBrowserType();", true);
在这里,我需要获取基于返回值的回报谷“真”或“假“ 我需要检查的条件
请帮助我摆脱JavaScript中的值.CS页
感谢 王子
你希望得到一个JavaScript函数的返回值在后面的代码假设这个JavaScript函数在客户端上要晚得多和服务器端代码后运行已执行完毕,怎么办。在这个JavaScript运行的时候,不再有代码。您最好的选择是将此值在随后的HTTP请求中发送到服务器。这可以通过使用AJAX或者将结果包含在隐藏字段中来完成。 – 2011-05-03 14:28:15