Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameters in VB

Status
Not open for further replies.

JoeCool32

Programmer
Sep 26, 2002
50
0
0
US
Is it possible to pass parameters from server-control events to server-side procedures? If it is possible, how is it normally done?

JJ [peace]

"Ignorance and prejudice and fear walk hand in hand" - Witch Hunt, by Rush
 
I am not entirely sure what you mean here Joe. Could you explain what your trying to do for me?

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
You have a few options...

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.

:)
paul

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
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 [peace]

"Ignorance and prejudice and fear walk hand in hand" - Witch Hunt, by Rush
 
Bumping up so link and Zarcom don't forget me.

JJ [peace]

"Ignorance and prejudice and fear walk hand in hand" - Witch Hunt, by Rush
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top