Solved

asp.net previous page

Posted on 2011-09-26
2
149 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

11 Experts available now in Live!

Get 1:1 Help Now