在jquery ui Dialog里面的gridview

我设法让我的jquery ui Dialog从codebehind工作。 现在我面临另一个问题。
我在div里面有一个gridview,用于.dialog()。 该gridview未在对话框中显示。
如果我输入另一个控件as asp:它确实显示,所以我有点困惑。 例如:

<asp:GridView ID="gvMostrarIgualesEntrante" ...

在这种情况下,对话框加载并显示按钮,但不是gridview。

我从这个按钮调用MostrarVentanaMostrarVentanaIgualesEntrante:

  

一切都在更新面板内。

我检查了用于绑定数据的数据表,它包含一行,因此gridview确实有数据。

有人可以帮我吗?
谢谢。

我的代码:

 

我的.CS:

 private void CargarGridMostrarIgualesEntrante() { //revisar que el texto del textbox vaya con su formato correcto. if (Regex.IsMatch(tbNumeroUnico.Text, @"\d{2}-\d{6}-\d{4}-\w\w")) { lbNumeroUnicoEntrante.Visible = false; //cargar solo los documentos entrantes que tengan ese mismo número único. _documentosEntrantesNumeroUnicoIgual = _documentosHandler.ObtenerDocumentosEntrantesPorNumeroUnico(tbNumeroUnico.Text); if (_documentosEntrantesNumeroUnicoIgual.Count > 0) { DataTable table = new DataTable(); table.Columns.Add(new DataColumn("DocumentoEntranteID", typeof (long))); table.Columns.Add(new DataColumn("FechaIngreso", typeof (DateTime))); table.Columns.Add(new DataColumn("FuncionarioRecibe", typeof (string))); table.Columns.Add(new DataColumn("NumeroOficio", typeof (string))); table.Columns.Add(new DataColumn("NumeroUnico", typeof (string))); table.Columns.Add(new DataColumn("Remitente", typeof (string))); table.Columns.Add(new DataColumn("OficinaRemitente", typeof (string))); table.Columns.Add(new DataColumn("Dirigido", typeof (string))); table.Columns.Add(new DataColumn("Asignado", typeof (string))); table.Columns.Add(new DataColumn("OficinaArea", typeof (string))); table.Columns.Add(new DataColumn("EstadoDocumento", typeof (string))); foreach (DocumentoEntrante documentoEntrante in _documentosEntrantesNumeroUnicoIgual) { DataRow row = table.NewRow(); row["DocumentoEntranteID"] = documentoEntrante.DocumentoEntranteID; row["FechaIngreso"] = documentoEntrante.FechaIngreso; row["FuncionarioRecibe"] = documentoEntrante.FuncionarioRecibe.NombreFuncionario; row["NumeroOficio"] = documentoEntrante.NumeroOficio; row["NumeroUnico"] = documentoEntrante.NumeroUnico; row["Remitente"] = documentoEntrante.Remitente; row["OficinaRemitente"] = documentoEntrante.Oficina.Nombre; row["Dirigido"] = documentoEntrante.FuncionarioDirigido.NombreFuncionario; row["Asignado"] = documentoEntrante.FuncionarioAsignado.NombreFuncionario; row["OficinaArea"] = documentoEntrante.Area.Oficina.Nombre + " - " + documentoEntrante.Area.Nombre; row["EstadoDocumento"] = documentoEntrante.EstadoDocumento.Nombre; table.Rows.Add(row); } gvMostrarIgualesEntrante.DataSource = table; gvMostrarIgualesEntrante.DataBind(); }else { gvMostrarIgualesEntrante.DataSource = null; gvMostrarIgualesEntrante.EmptyDataText = "No existe un documento entrante con el mismo número único"; gvMostrarIgualesEntrante.DataBind(); } runjQueryCode("dlg = $('#DivMostrarIguales').dialog({autoOpen: false,show: 'fold',hide: 'clip',width: 1272,height: 211,close: function(ev, ui) { $('.ui-effects-wrapper').remove(); }}); $('#DivMostrarIguales').dialog('open')"); } else { lbNumeroUnicoEntrante.Visible = true; } } protected void MostrarVentanaIgualesEntrante(object sender, EventArgs e) { CargarGridMostrarIgualesEntrante(); } 

我认为这是因为来自UpdatePanel的回发,其原因可能源于此处提到的内容 。

很高兴知道它对你有用。