开发者

Pageload and Postback problem for Visual Studio(ASP.Net)

I have a page that calls a control. The control has 3 tables. For the first time when the page is loading, it displays 1 & 2 tables. There is a next button, when the user clicks , takes you to the same page but with just 3rd control. In table 1, I have an update button, and even in table 2,i have an update button. When any of these buttons are clicked, it takes me to the page with 3rd table. But it should take me to the same page with 2 tables. Can you guys help me out on this, please!! Thanks so much in advance!!!

protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    if (Page.IsPostBack)
    { 
        string strCheckOrderandPackageHideStatus = Session["HidePackageAndOrderSummary"].ToString();

        if(!(string.IsNullOrEmpty(strCheckOrderandPackageHideStatus)))
        {
            if(string.Equals(strCheckOrderandPackageHideStatus, "PleaseHide"))
            {

                tdOrderSummary.Visible = false;
                trpackage.Visible = false;
                trCCandBilling.Visible = true;
                UpdatePanel3.Visible = false;
                imgbtnSubmit.Visible = true;


 开发者_开发百科           }
        }
    }
}

protected void Page_Load(object sender, EventArgs e)
{
    if (isAdmin)
        HandleAdminRestrictions();

    HandleLoad();

    RecalculateClick();
}   
Update1_Click(object sender, eventargs e)
{
PromoCode();
}
Update2_Click(object sender, eventargs e)
{
Recalculate();
}
Next_Click(object sender, eventargs e)
{
Takes me to the same page but with just 3rd table
}

Here when you click Update1_Click() or Update2_Click(), I want same page with 2 same controls but updated!!

Please help me out!!


Why don't you use a wizard control? Not much point in reinventing this behaviour.


I think you can do it without session tricks... Maybe this can help.

protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    if (!Page.IsPostBack)
    { 
       // Make table 1 and table 2 visible
       // Hide table 3         
    }
}

Update1_Click(object sender, eventargs e)
{
    PromoCode();
}
Update2_Click(object sender, eventargs e)
{
    Recalculate();
}
Next_Click(object sender, eventargs e)
{
    // Hide table 1 and 2
    // Make table 3 visible
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜