C# if else statement not working exactly right

Hello, we are working on a web form project where the first page asks the visitor a question. Depending on the radio group selection value, the user should redirect to a page based on their selected value. Below is the code we are using. What seems to happen, is that if you pick "home", it will go to home.aspx correctly, but if you hit your browser back button and then select "church", it will take you to home.aspx incorrectly.

If I open a different web browser (just to use a totally different browser that has no history of this site) and select "church", it will go to church.aspx, but if you hit your browser back button and then select home, it will take you to church.aspx incorrectly.

Does anyone have any advise on how to get this to work well? Thanks in advance, It seems like we are close but missing something simple.


<%
if (AdorRec.FieldValue("landingQ1", null) == "home")
{
uCreateXMCtrls.uCreateXMCommonCSharp.XMP_RedirectCompatibleWithHelicon3("home.aspx");
}
else if (AdorRec.FieldValue("landingQ1", null) == "church")
{
uCreateXMCtrls.uCreateXMCommonCSharp.XMP_RedirectCompatibleWithHelicon3("church.aspx");
}
else
{
uCreateXMCtrls.uCreateXMCommonCSharp.XMP_RedirectCompatibleWithHelicon3("sorrypage.html");
}
%>
Mark BDirector ITAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
Hi,

Just check what do you get in AdorRec.FieldValue("landingQ1", null) in both cases.
It seems your related value is not updating/rendering properly.

Thanks
0

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
Mark BDirector ITAuthor Commented:
Thank you for the comment on this, we found that we needed to turn off user caching. Ed added this to code and is working now.
0
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
.NET Programming

From novice to tech pro — start learning today.