A nice and really slick way to do it is to add items to the items collection of the HttpContext.Current. It works like a temporary session in that it only lives as long as a single http request, and then it's gone.
To use this, though, load order is a huge consideration. Whatever is placing things into the .Items collection must be loaded prior to someone wanting that item out. If you can jump that hurdle, though, you're golden.
Alternatively, you can setup:
(a)properties that you can evaluate in your code, which your control will have to handle via ViewState
-or-
(b)for a custom control that has custom event handling, you can put any needed information into a derived EventArgs class and pull it out in an event handler, i.e.
private void HandleSomeCustomEvent(object o, CustomEventArgs e){
//e.YourCustomPropertyHere
}
For information on custom controls, search out Google on "Composite Web Controls ASP.NET". There's a wealth of information out there for your enjoyment.
link: I'll keep your comments in mind. This is for my lead's benefit but he won't be back 'til Friday.
Zarcom: This question came from our efforts to be able to delete a record off a datalist and the SQL table it came from. We've been trying to pass the value of the rec's primary key to a Delete_Click event that uses a stored procedure, and so far no luck.
JJ
"Ignorance and prejudice and fear walk hand in hand" - Witch Hunt, by Rush
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.