如何在同一时间多次在另一个页面中显示页面 [英] How to display a page in another page multiple times at same time

查看:77
本文介绍了如何在同一时间多次在另一个页面中显示页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我有一个显示员工薪水的页面。在另一个页面中,我想显示这个页面,就像我们有10个工作人员然后为所有10个工作人员同时单独显示特定页面。



我'我使用I帧这样做,但它只显示一个员工的单页。请帮我解决这个问题。

我的代码后面是访问工资页面的





  protected   void  BindPrimaryGrid()
{
con。打开();
SqlDataAdapter sda = new SqlDataAdapter( select *来自薪水年份=' +年+ 'AND Month =' + PreviousMonth + 'AND Updated ='True';,con);
DataTable dt = new DataTable();
sda.Fill(dt);
con.Close();
if (dt.Rows.Count > 0
{
for int i = < span class =code-digit> 0 ; i < dt.Rows.Count; i ++)
{
HtmlIframe ifrm = new HtmlIframe();
ifrm.ID = dt.Rows [i] [ REFNo]。ToString( );
ifrm.Src = StaffSalaryPrint.aspx?REFNo = + dt.Rows [i ] [ REFNo]。ToString();
pnlContents.Controls.Add(ifrm);
}
}





我的尝试:



我试图用动态添加iframe。

但遗憾的是它不起作用。 iframe仅适用于单行,而不适用于循环。

解决方案

您不需要iframe。当您在StaffSalaryPrint.aspx页面上传递QueryString(REFNo)时,在这里您可以创建锚标记并将href设置为像StaffSalaryPrint.aspx?REFNo ='您的参考ID'。



在staffsalaryprint页面上的Access查询字符串之后,根据RerNo显示数据。



现在每当您点击任何锚标记时,相应的员工详细信息将显示在下一页。< br $>


问候,

AARIF SHAIKH


使用ASP:中继器控制



将您需要显示的表格放入itemtemplate并在repeateritemdatabound事件中绑定数据以显示单独的表格。



祝你好运

Hello,
I have a page that displays salary of a staff. In another page I want to show this page like if we have 10 staff then for all the 10 staff that particular page is shown separately at the same time.

I'm using I frame to do so but it only shows single page for one staff only. Please help me with the issue.
My code behind to access the salary page is


protected void BindPrimaryGrid()
    {
        con.Open();
        SqlDataAdapter sda = new SqlDataAdapter("select * from Salary Where Year='" + Year + "' AND Month='" + PreviousMonth + "' AND Updated='True'";, con);
        DataTable dt = new DataTable();
        sda.Fill(dt);
        con.Close();
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                HtmlIframe ifrm = new HtmlIframe();
                ifrm.ID = dt.Rows[i]["REFNo"].ToString();
                ifrm.Src = "StaffSalaryPrint.aspx?REFNo=" + dt.Rows[i]["REFNo"].ToString();
                pnlContents.Controls.Add(ifrm);
            }         
        }



What I have tried:

I've tried to add Iframes dyanamically to do so.
But sadly it doesn't work. Iframe only works for a single row and not in a loop.

解决方案

You need not to iframe for it. when you passing QueryString (REFNo) on StaffSalaryPrint.aspx page, Here you can create anchor tag and give href as like StaffSalaryPrint.aspx?REFNo='your ref id'.

After that Access querystring on staffsalaryprint page and show data according to RerNo.

now whenever you click any anchor tag, corresponding employee Detail will show on next page.

Regards,
AARIF SHAIKH


Use ASP:Repeater control

put the form you need to show into itemtemplate and bind the data in repeateritemdatabound event to show separate forms.

Good luck


这篇关于如何在同一时间多次在另一个页面中显示页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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