Solved

asp.net previous page

Posted on 2011-09-26
2
150 Views
Last Modified: 2012-05-12
TmpSelectedPolicyType parameter value came from the previous aspx that I set up.
Everything is working. and I added the code as following: Page.Items.Add("PassSelectedPolicyType",TmpSelectedPolicyType);

The purpose is to make "PassSelectedPolicyType" as public for ascx file for other purpose.

However, when the page is refresh....the parameter value is disappeared...How can I prevent that?

Thanks,


           
protected void Page_Load(object sender, EventArgs e)
    {
//=================================================================================
        if (PreviousPage != null)
        {
            string TmpSelectedPolicyType=PreviousPage.TmpSelectedPolicyType.ToString();
            string TmpGeneralLiability=PreviousPage.TmpGeneralLiabilityValue.ToString();
            string TmpAutoLiability = PreviousPage.TmpAutoLiabilityValue.ToString();
            //Name Parameter,Actual Value
            Page.Items.Add("PassSelectedPolicyType",TmpSelectedPolicyType);
            Page.Items.Add("PassSelectedGeneralLiability",TmpGeneralLiability);
            Page.Items.Add("PassSelectedAutoLiability", TmpAutoLiability);
        }
//================================================================================
     }

Open in new window

0
Comment
Question by:Webboy2008
2 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 36602512
Do you have the PreviousPageType directive set?

<%@ PreviousPageType VirtualPath="~/SourcePage.aspx" %>

Reference:

http://msdn.microsoft.com/en-us/library/6c3yckfw.aspx
0
 

Author Comment

by:Webboy2008
ID: 36602536
yes
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now