Last post Mar 25, 2010 02:30 PM by KentWA
Mar 24, 2010 05:44 PM|KentWA|LINK
I have a server control that handles uploading of a file, importing quite a few data elements based on the file and doing a bunch of SQL Inserts which returns a GUID reference to the data (Control #1). However once this is done I need to display another
control to the user with some specific data and give them the the chance to edit some information (Control #2). Both of these are built and Control #2 is used for several other items.
My problem right now is how do I ensure Control #1 has completed its task and returned the GUID, so I can pass that value to Control #2? The last time I did something simular it was pretty ugly and convoluted and I believe there has to be a simpler way.
Mar 24, 2010 11:29 PM|alok.arora|LINK
First of all I would like to know what exactly is the approach you have taken to upload files, such as JQuery Post method?,"
Some flash uploader? or may be it's a custom third party control, then you may tell me the name.
In any case you have do it as a chain reaction, whenever your upload is finished and processing is done (GUID is generated)
Trigger the Callback completed function and you can assign the GUID to Control#2
so just let me know the approach then I can be specific about what you need to do achieve the same. :)
Mar 24, 2010 11:43 PM|Sarahn|LINK
The easiest way would be to make an ajax call to control 2 upon completion of processing by control 1.
either way this should be a simple( not very complex) solution.
Mar 24, 2010 11:50 PM|codeasp|LINK
Add a Public Eventhandler in the Usercontrol1 which can be consumed by other controls. Raise this event once uploading is finished. Because both controls are in the page use the page to consume the Event. Use a public method in Usercontrol2 that can
be called from the Page.
See these links to see if it helps:
Mar 25, 2010 02:30 PM|KentWA|LINK
Thanks Sarahn, that is just the info that I needed.
To answer another question, it currently users the ASP.NET uplaod control within Control #1 since there are other functions and UI elements other than simple upload, however upload control will have to be replaced before long to provide for larger file size.