在Popup中没有在IFrame中显示数据 [英] in Popup is not displaying the data in IFrame

查看:82
本文介绍了在Popup中没有在IFrame中显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了如下代码





源页面代码如下

I tried my code as follows


source page code as follows

 <asp:HiddenField ID="HFpkgid" runat="server" />

<iframe id="frm" src="Package_Grid.aspx?pkgid=<%=HFpkgid.Value %>"  height="545" 

   width="795" style="z-index: 1"></iframe>





asp.net页面代码如下





asp.net page code as follows

protected void rpt_sample(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "sample")
        {
                     MPE.Show();
        }
}





Package_gird页面代码如下





Package_gird page code as follows

protected void Page_Load(object sender, EventArgs e)
  {
      try
      {
          using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["himtConnectionString"].ConnectionString))
          {
              using (var cmd = new SqlCommand("OH_PKG_DATE_COMBINATION '" + Request.QueryString["pkgid"].ToString().Trim() + "'", con))
              {
                  con.Open();
                  SqlDataAdapter da = new SqlDataAdapter(cmd);
                  da.Fill(dt);
              }
          }
      }
      catch (Exception ex)
      {
          ex.Message.ToString();
      }
  }



但是当我在Iframe中运行时,没有显示它是空的



存储过程如下



当我按如下方式执行存储过程输出时


But when i run in Iframe nothing is displayed it is empty

Stored procedure as follows

When i execute the store procedure output as follows

exec OH_PKG_DATE_COMBINATION 'PKG0000005'







Sno Course Startdate Enddate描述



1 AFF 2015年7月6日2015年7月11日座位20

1 MFA 2015年7月13日2015年7月17日席位25

1 PSCRB 2015年7月20日2015年7月25日席位30



我希望上面的商店程序结果显示在IFrame中。



错误是什么我在上面的代码中做了。




Sno Course Startdate Enddate Description

1 AFF 6th july 2015 11th july 2015 Seats 20
1 MFA 13th july 2015 17th july 2015 Seats 25
1 PSCRB 20th july 2015 25th july 2015 seats 30

I want the above store procedure result to be shown in IFrame.

what is the mistake i made in my above code.

推荐答案

添加网格查看Package_Grid页面并将数据绑定到它。目前你没有做任何事情来从数据库返回数据。如果你需要显示数据,首先使用一些控件并在页面中显示。



add gridview to your Package_Grid page and bind the data to it. currently you are not doing anything to returned data from database. if you need to display the data, first use some control and display in the page.

protected void Page_Load(object sender, EventArgs e)
  {
      try
      {
          using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["himtConnectionString"].ConnectionString))
          {
              using (var cmd = new SqlCommand("OH_PKG_DATE_COMBINATION '" + Request.QueryString["pkgid"].ToString().Trim() + "'", con))
              {
                  con.Open();
                  SqlDataAdapter da = new SqlDataAdapter(cmd);
                  da.Fill(dt);
                  Gridview1.DataSource= dt;
                  Gridview1.DataBind();
              }
          }
      }
      catch (Exception ex)
      {
          ex.Message.ToString();
      }
  }


这篇关于在Popup中没有在IFrame中显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆