从codebehind打开jQuery Dialog

所以我必须从代​​码隐藏中显示一个jquery UI对话框。
我已经尝试了所有的东西: 这个 , 这个 , 这个 ,并且还改变了那些答案,如果它适用于我但是不起作用。
我正在使用第一个解决方案,因为它是有组织的。 如果我使用alert(’whatever’)而不是我的jquery对话框代码,它可以工作。 所以我知道它的工作,但对话没有任何反应。 我也尝试过用彩盒,也没用。

有人可以给我一个解决方法吗? 这将是apreciated。
谢谢。

我的aspx:

HEAD  function BindEvents() { $.fx.speeds._default = 1000; $(document).ready(function () { var dlg = $("#DivMostrarIguales").dialog({ autoOpen: false, show: "fold", hide: "clip", width: 500, height: 500 }); dlg.parent().appendTo(jQuery("form:first")); }); }  ENDHEAD     Sys.Application.add_load(BindEvents); ....   (*) Número único:       ... 
WhatEver

我的.CSfunction:

 private string getjQueryCode(string jsCodetoRun) { StringBuilder sb = new StringBuilder(); sb.AppendLine("$(document).ready(function() {"); sb.AppendLine(jsCodetoRun); sb.AppendLine(" });"); return sb.ToString(); } private void runjQueryCode(string jsCodetoRun) { ScriptManager requestSM = ScriptManager.GetCurrent(this); if (requestSM != null && requestSM.IsInAsyncPostBack) { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), Guid.NewGuid().ToString(), getjQueryCode(jsCodetoRun), true); } else { ClientScript.RegisterClientScriptBlock(typeof(Page), Guid.NewGuid().ToString(), getjQueryCode(jsCodetoRun), true); } } protected void MostrarVentanaIgualesEntrante(object sender, EventArgs e) { CargarGridMostrarIgualesEntrante(); runjQueryCode("$('#DivMostrarIguales').dialog('open')"); } 

首先调用对话框来创建它。

 .dialog({ autoOpen: false }) //{} = settings 

然后打开它..

 .dialog('open')