"Hugo Flores" wrote...
I don't know if you can add an event to a dinamically generated
control. I'd say you can, but don't know how.
Hi Hugo,
Yes, it appears you can...and cant...
You can use AddHandler to wire up and event handler to an event, ie
MyButton.Click etc
The problem is, from reading on the net, it seems that it only works if the
button is added in the Page.Load sub, not in any other subs of your own
(testing this at the moment), if so, this is no good to me...a work around
seems to be storing a value of the clicked item somewhere, say for example
in a form field or a session variable - just feels a sloppy way of doing
things to me..
Now, if you want to send the information via the querystring. How about
generating the images as links, and then just look for the parameter
that you are sending to sort, and based on that you can use the sort
method of the dataview as you mentioned.
Yeah, thats what I have on my "other" page, thats a nice one as it always
does the same thing, returns a specific set of results from the database, so
there I use the querystring/images to sort by, because there's no "form" as
such where the user can search, on this page however, if I do that then the
hyperlink on the image has to be something like:
MySearchPage.aspx?column=employee&order=desc
Downside of this is that then my search criteria is lost, as it is sent as a
form submission, more of a redirect.
I could of course put the search criteria in the querystring also, however
this is then changing my search page so much it doesn't feel like the right
solution (plus I'd have to add more validation of the querystring results,
and start populating form fields if there was a value in the querystring and
on it goes :))
Regards
Rob