1

I have two pages: Default.aspx and Target.aspx. On Default.aspx are two buttons:

Button1 redirects to ("~/Target.aspx?mode=\"drop\"");
Button2 redirects to ("~/Target.aspx?mode=\"textbox\"");

On Target.aspx is following behind code:

string display = Request.QueryString["mode"];
    switch (display)
    {
        case "textbox":
            TextBox1.Visible = true;
            DropDownList1.Visible = false;
            break;
        case "drop":
            TextBox1.Visible = false;
            DropDownList1.Visible = true;
            break;

    }

As you can see, in case of Button1, Target.aspx should hide TextBox1 and display DropDownList1. However this doesn't work. Can you help me ? Thanks

1 Answer 1

4

Make redirect to ("~/Target.aspx?mode=drop"); drop / textbox without quotes in redirect URL

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

3 Comments

@polohy nice to hear it solved you problem :) Don't forget to mark an answer, thx :)
maybe one more issue. This works with button, but not with asp:hyperlink. Do you know why ?
Check what is the output of hyperlink on client (HTML)...hyperlink redirects to URL without submiting, so it's required to see the output on client.

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.