<script language="javascript">
function HiddenDiv(aid){
document.getElementById("hidepictag"+aid).style.display = "none";
}
</script>在CS我如何调用 JS的呢
private void hideidstag(string aid)
{
在这里怎么调用 HiddenDiv函数的呢
}
function HiddenDiv(aid){
document.getElementById("hidepictag"+aid).style.display = "none";
}
</script>在CS我如何调用 JS的呢
private void hideidstag(string aid)
{
在这里怎么调用 HiddenDiv函数的呢
}
不行的了
把参数改成你传进去的 aid 应该没有问题啊
string str = "aa";
hideidstag(str);private void hideidstag(string aid)
{
this.ClientScript.RegisterStartupScript(this.GetType(), "", "HiddenDiv('“+aid+”')", true);
}
{
StringBuilder strScript = new StringBuilder();
strScript.Append("<script language=javascript>");
strScript.Append("HiddenDiv('" + aid + "');");
strScript.Append("</script>");
this.ClientScript.RegisterStartupScript(this.GetType(), "HiddenDiv('" + aid + "');", strScript.ToString(), true);
} 这样也不成功的 。网上搜索的 为什么呀
function HiddenDiv(aid){
alert('999');
//document.getElementById("hidepictag"+aid).style.display = "none";
}
</script>
js函数里的alert 能弹出来么
我在JS直接 HiddenDiv('1') 都可以的
this.ClientScript.RegisterStartupScript(this.GetType(), "", "HiddenDiv('“+aid+”')", true);
调用