0
我想從cs文件後面的代碼打開jquery colorbox。它工作在Chrome,但mozila或Internet Explorer其不工作ScriptManager.RegisterStartupScript不工作在mozila
的.aspx代碼:
<script type="text/javascript">
function OpenColorBox() {
$.colorbox({
opacity: 0.1,
width: '350px',
height: '350px',
iframe: true,
href: 'Test.aspx',
onLoad: function() {
$('#cboxClose').remove();
},
});
}
</script>
<asp:Button ID="Button2" runat="server" Text="Save this Search Criteria" CssClass="srchBtn btnNew"
OnClick="Call_Click" />
cs文件
protected void Call_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this,this.GetType(), "alert", "OpenColorBox(); return false;", true);
}
什麼,我缺少這個???如果任何人有任何想法關於它比請在這幫助我。
你打電話的'Call_Click'是CS代碼? – yogi 2012-07-24 08:46:48
@yogi:我在Call_Click事件中寫了腳本管理器代碼 – user968441 2012-07-24 08:48:08
謝謝所有....我發現了這個問題。這是愚蠢的錯誤,我已經改變了我的代碼這一行....'ScriptManager.RegisterStartupScript(this,this.GetType(),「alert」,「OpenColorBox();」,true);' – user968441 2012-07-24 08:52:59