ViewState efficiency

It is efficient to use a view state to handle moving back to previous page.

see below:  (has to be a better way to do that

 Session["PreviousPageURL"] = "D.ASPX";

        try
        {
            m_nUserID = Profile.PA;
            m_strProviderAHID = Profile.ExtID.ToString();
        }
        catch  (Exception) //(Exception ex) trs removed 09/29/2011
        {
            //log.Error("Error n pace_Demographic:Page_Load-1, get m_nUserId and m_strProviderAHCCCSID", ex);
            //Removed trs 09/29/2011
           Session.Abandon();
            FormsAuthentication.SignOut();
            try
            {
                Response.Redirect("~/SessionTimeout.htm");
            }
            catch (ThreadAbortException)
            { }
        }

        PaceFunctions.GetPaceRoles(m_strProviderAHCCCSID, ref m_bMemberManagement, ref m_bSuperUser, ref m_bDeleteMemberRole, ref m_bUndoTransferRole);
        m_bFinancialEligibility = PaceFunctions.IsFinancialEligibility();
        m_bReadOnly = PaceFunctions.IsReadOnly();
        m_bPaceUser = PaceFunctions.IsPaceUser();
        Page.MaintainScrollPositionOnPostBack = true;
       
        if (!Page.IsPostBack)
        {
            ViewState["PaceStatus"] = Session["PaceStatus"].ToString();
            ViewState["PACEID"] = Session["PACEID"].ToString();
            ViewState["ASSESSMENTID"] = Session["ASSESSMENTID"].ToString();
            ViewState["COOLEnabled"] = "YES";
            FillDropDowns();
            LoadDemographic();
            if (ViewState["PaceStatus"].ToString() == "Add")
            {
                m_bMemberManagement = false;
                tdEdit.Visible = false;
                tdEdit2.Visible = false;
                btnDelete.Visible = false;
                tdSave.Visible = true;
                tdSave2.Visible = true;
                ddlStage.SelectedIndex = -1;
                SetControlState("Enabled");
            }
            else
            {
                tdSave.Visible = false;
                tdSave2.Visible = false;
            }

            if (ViewState["PaceStatus"].ToString() == "Edit")
            {
                SetControlState("Disabled");
                //CPSA-721 JCALL 2-7-05
                //CPSA-862 JCALL 4-20-05 allow superusers to edit archived demographics
                if ((lblStage2.Text == " Current Stage: 11 - Archived" & m_bSuperUser == false) || (lblStage2.Text == " Current Stage: 08 - Disenrolled" && m_bSuperUser == false))
                {
                    btnEdit.Visible = false;
                    btnEdit2.Visible = false;
                }

                if (m_bDeleteMemberRole == false)
                    btnDelete.Visible = false;
            }
            if (m_bMemberManagement || m_bSuperUser)
            {
                tblMemberServices.Visible = true;
                lblStage.Visible = false;
                ddlStage.Visible = true;
            }
            else
            {
                tblMemberServices.Visible = false;
                lblStage.Visible = true;
                ddlStage.Visible = false;
            }

            trClose.Visible = false;
            trClose2.Visible = false;
            trSaveConfirm.Visible = false;
            trSaveConfirm2.Visible = false;

            Session["LastMMPage"] = "Demographic";
            string smsg = IsMissingProvider().ToString();
            if (smsg != "")
            {
                lblMessage.Visible = true;
                lblMessage.Text = lblMessage.Text + "  " + smsg.ToString();
            }

        }

        if (m_bReadOnly)
        {
            tdEdit.Visible = false;
            tdEdit2.Visible = false;
            tdSave.Visible = false;
            tdSave2.Visible = false;
        }

    }
TimSweet220Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.