Assume i have 3 buttons button1, button2, button3
And each of them are firing the same method onClick="Redirect"

PROBLEM

How can i able to redirect them different pages by checking whether which button is clicked
button1.click; redirect(page1), button2.click; redirect(page2), button3.click; redirect(page)
how can i do this instead of fired different methods.

Recommended Answers

All 2 Replies

You can include the CommandName property on your buttons and use the switch blocks to perform different actions.

See documentation and examples here:

Button.Command Event

Thanks JorgeM. It's work fine.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.