1

I am on MyPage.aspx?questionNumber=1 and I am navigating to MyPage.aspx?questionNumber=2. I am using this code create the navigation between the two:

EwfUiStatics.SetContentFootActions( new ActionButtonSetup( "Next",
                                                                           EwfLink.Create(
                                                                               new Info( es.info, new OptionalParameterPackage { QuestionNumber = info.QuestionNumber + 1 } ),
                                                                               new ButtonActionControlStyle() ) ) );

Notice I am using "new Info" and re-using the entity's info object. Maybe I should be using GetInfo or something else, instead.

When I get to the next question, I am scrolled halfway down the page. I want to be at the top. How do I force the scroll position to be cleared (or more generally, how do I specify the info object so that I don't have undesired carry-over from the previous page)?

William Gross
  • 2,083
  • 2
  • 17
  • 35
Greg Smalter
  • 6,571
  • 9
  • 42
  • 63

1 Answers1

1

The way you navigate (including whether you reuse Info objects or not) makes no difference in what is retained. Even something like this (in a DataModification) would produce the same results you're seeing:

parametersModification.QuestionNumber += 1;

Currently EWL does not have strong support for picking and choosing the state you want to retain after an intra-page navigation. But for scroll position in particular, you may be able to override EwfPage.scrollPositionForThisResponse to get what you want. You could unconditionally return ScrollPosition.TopLeft as long as the page never does post backs in which you want to retain scroll position.

William Gross
  • 2,083
  • 2
  • 17
  • 35
  • I'm ok with not being able to pick and choose state I want to retain. Is there a way to say that I don't want any state retained at all? – Greg Smalter Mar 25 '13 at 15:32
  • No; EWL doesn't support that right now either. But it could definitely be implemented. Also, if your page was *not* acting as an auto data modifier, your `EwfLink` would render just as a link and clicking it would not retain anything. – William Gross Mar 25 '13 at 17:40