Postback object

B

Buddy Ackerman

Is there a way to determine (in the page_load procedure) what object casued
the postback? I have a page that I'm converting from "simple" dynamically
generated HTML into a ASP.NET web form using server controls. However one
section of the form has some pretty complex logic that returns a table of
items including some HTML buttons. I do not want to rewrite this piece
right now. So, when one of these HTML buttons is clicked it posts the form
however, I can't tell if I should process the data updates or not because
unlike the other buttons on the page don't (i.e. can't) have eventhandlers
for them. Some of the buttons need to call a data update routine some don't
(these HTML buttons do need to call it) so I need to determine what casued
the update so that I don't call the routine when a non-updating button is
pressed versus one of these HTML buttons that do need to update the data.
Any suggestions?

--Buddy
 
L

Lau Lei Cheong

I suppose you can name every button with common prefix like "bt_" "button_",
then search for them
in Request.Form.AllKeys[] at Page_Load.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top