我正在开发一个Web应用程序,它包含多个Web窗体。 我需要的是:我的网页表单中的一个包含IFrame(它将打开另一个带有几个文本框和按钮控件的aspx页面),并带有关闭按钮。呼叫按钮单击事件从一个Web窗体到另一个
If i click on the button in the child form(Iframe form), once complete its action it should call the close button function of the parent form.
here is the code.
父窗体代码
protected void BTNCClose_Click(object sender, EventArgs e)
{
MethodToExecute();
}
public void MethodToExecute() //call this method
{
UPCCharges.Update();
if (HttpContext.Current.Session["CCost"] != null)
{
TxtCCost.Text = Session["CCost"].ToString();
}
if (HttpContext.Current.Session["CYeild"] != null)
{
TxtCYeild.Text = Session["CYeild"].ToString();
}
if (HttpContext.Current.Session["CName"] != null)
{
TxtCName.Text = Session["CName"].ToString();
}
if (TxtCName.Text != "" && TxtCYeild.Text != "" && TxtCCost.Text != "")
{
TxtCrJobId.Text = Session["CJobID"].ToString();
Session.Remove("CCost"); Session.Remove("CYeild");
Session.Remove("CName"); Session.Remove("CJobID");
}
Diva.Visible = false;
IFMC.Visible = false;
}
,这是子窗体(在iframe中)
protected void BTNCCloseChild_Click(object sender, EventArgs e)
{
for (int vLoop2 = 0; vLoop2 < gvInner.Items.Count; vLoop2++)
{
if (TxtTotalCFrom1 != null && TxtTotalCFrom2 != null)
{
TextBox TxtTotalCFrom = (TextBox)gvInner.Items[vLoop2].FindControl("TxtTCFrom");
TextBox TxtTotalCYeild = (TextBox)gvInner.Items[vLoop2].FindControl("TxtTCYeild");
Session["CCost"] = (mobjGenlib.ConvertDecimal(TxtTFrom1.Text) + mobjGenlib.ConvertDecimal(TxtTFrom2.Text)).ToString();
Session["CYeild"] = (mobjGenlib.ConvertDecimal(TxtRO.Text) - mobjGenlib.ConvertDecimal(TxtTFrom.Text)).ToString();
Session["CName"] = gvInner.Items.Count.Items[vLoop2].Cells[1].Text;
Session["CJobID"] = gvInner.Items.Count.Items[vLoop2].Cells[2].Text;
}
}
//after this i want to call that parent form BTNCClose_Click
}
任何一个可以帮助我提前解决这个感谢。
谢谢对冲!!!!! – Appdev 2015-02-25 04:46:41