0

I want to use a click button to go to next page, and display the detail info of the person i select. but this code wont work. help help!

void ButtonHandler(Object sender, EventArgs e)
        {
            Button ViewReports = (Button)sender;
            switch (ViewReports.CommandName)
            {
                case "ViewReportsClick":
                    Response.Redirect(ViewReports.CommandArgument.ToString());
                    break;
                case "ViewRemunerationClick":
                    Response.Redirect(ViewRemuneration.CommandArgument.ToString());
                    break;
                case "ViewPerformanceClick":
                    Response.Redirect(ViewPerformance.CommandArgument.ToString());
                    break;
            }
        }
3
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by missbeginner
0

when i was a beginner and asked such questions, my co-workers would ask me "have you debugged the code". that is what i suggest to you, put a break point to your switch case and then start debugging. you will see what is wrong with it.

0

What doesn't work about your code? Does it not compile, does it not redirect, does it never get called?

0

What doesn't work about your code? Does it not compile, does it not redirect, does it never get called?

in other words, why dont you debug it ? :)

0

I have three different button, and i use this code. if i click any of the buttons, it will return to page load. There's an employee detail and i want to show their further details; either their reports, remuneration, or performance; using the button, according to which the user select.

0

yes. everything looks fine it's just the button won't lead me to selected detail of an ID, it leads to the first page of database

0

oh! find it, i think i suppose to use the "request ID" command in the other page. i'll try that one, thanks everyone, sorry for the hassle

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.