0

Ok so while back I asked question Beginner ASP.net question handling url link

I wanted to handle case like this www.blah.com/blah.aspx?day=12&flow=true I got my answer string r_flag = Request.QueryString["day"];

Then what I did is placed a code in Page_Load()

that basically takes these parameters and if they are not NULL, meaning that they were part of URL.

I filter results based on these parameters.

It works GREAT, happy times.... Except it does not work anymore once you try to go to the link using some other filter. I have drop down box that allows you to select filters. I have a button that once clicked should update these selections.

The problem is that Page_Load is called prior to Button_Clicked function and therefore I stay on the same page.

Any ideas how to handle this case.

Once again in case above was confusing. So I can control behavior of my website by using URL, which I parse in Page_Load() and using controls that are on the page.

If there is no query in URL it works great (controls) if there is it overrides controls. Essentially I am trying to find a way how to ignore parsing of url when requests comes from clicking Generate button on the page.

1 Answer 1

1

Maybe you can put your querystring parsing code into IsPostBack control if Generate button is the control that only postbacks at your page.

if (!IsPostBack)
{
    string r_flag = Request.QueryString["day"];
}

As an alternative way, at client side you can set a hidden field whenever user clicks the Generate button, then you can get it's value to determine if the user clicked the Generate button and then put your logic there.

Sign up to request clarification or add additional context in comments.

1 Comment

awesome it kind causes another problem but thats the one I know how to fix. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.