我有內部ASP一個div:內容:C#asp.net調用JavaScript的
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="slidebar" style="display:none;" >There are some pending approvals.Please approve by the 25th of this month
<a href="#" id="slink" style="margin-left:10px;" onclick="fade('slidebar');">Click here to close <sup style="font:caption;color:#373636;">X</sup></a>
</div>
<script language="javascript" type="text/javascript">
function showbanner()
{
document.getElementById("slidebar").style.visibility="visible";
}
</script>
<\asp:content>
和後面的代碼:
ClientScript.RegisterClientScriptBlock(Page.GetType(), "displaybanner", "return showbanner();", true);
我不能調用從代碼的功能showbanner後面,即使我直接使用registerclientscript調用showbanner中的語句...它不會被調用。
請幫
你的aspx將<\ asp:content>作爲您的第一個內容佔位符的關閉標記。這是發佈時發生錯誤,還是在您的代碼中? – Tony 2011-03-03 19:35:01
檢查您的結束標記: – 2011-03-03 19:35:12
這是一個打字錯誤...沒有問題的標記 – abbas 2011-03-03 19:36:32