473,396 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

NeatUpload - Control Event Handler won't fire

I'm using NeatUpload to provide upload progress status bar. Can anyone please help me understand why the registered event handler did not get called after the file was completely uploaded?

I'm using SqlServerUploadStorageProvider extender from NeatUpload 1.3.26 to stream the file directly into the database. The system event handler was registered in Page_Load method as follows:
Expand|Select|Wrap|Line Numbers
  1. private void Page_Load(object sender, EventArgs e)
  2. {
  3.     button.Click += new System.EventHandler(this.Button_Clicked);
  4.     ...
  5. }
I monitored the DB and did see the file got pushed into the DB. After the file was completely uploaded, a postback did occurred, however, the Button_Clicked event handler was never called so I couldn't execute SqlInputFile.verify() to retain the file inside the DB. So eventually, the file which I uploaded got removed from the DB.

Is there a way to list all the registered event handlers outstanding? I want to understand why the event was not invoked.... It almost seems as if the Button_Clicked event handler was lost somehow (or never registered). Do you know what might be the cause of this? I'm in great need of getting this to work, so if you can provide some feedback, I would greatly appreciate it.

Regards,
Loc Pham
Jun 22 '11 #1
3 2530
I'm able to find out more detail on this problem, still, I have no solution yet....

After more debugging, the Button which triggered the SqlServerUpload never postback, however the Page_Load event did occur. Because no postback occurred, the control event handler UploadBtn_Clicked was never invoked.

When I set the triggered button's UseSubmitBehavior="false", the postback did occur, but SqlServerInputFile1.HasFile evaluted to FALSE.

Another interesting fact, when I upload an image that is about 10KB, everything works fine. When I upload an image that is about 700KB or larger, the problem is reproduced and postback won't occur.

With these information, the postback event is definitely relate to the timing of the file being streamed into the DB. This explain why it works on my local development but does not work on the production. On my local development, all images 700KB or greater takes about 1 second to complete. The missing postback is only encountered when streaming the file takes 5 seconds or more ...

So my question remains... where do I set this timeout and why does it occur???
Jun 22 '11 #2
Frinavale
9,735 Expert Mod 8TB
Check out this article: How to use dynamic controls in ASP.NET

Try moving the following code out of the PageLoad event and into the PageInit event:

Expand|Select|Wrap|Line Numbers
  1. button.Click += new System.EventHandler(this.Button_Clicked)
The problem is that I don't think that "button" will exist at that point...
Jun 23 '11 #3
Rob S
14
Have you tried adding the handler in Page_Init?
Jun 24 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
9
by: J.Marsch | last post by:
I must be missing something here: The Init event for controls does not seem to fire. What I did: Drop a textbox on a blank webform, hook the textbox's Init event. Code: this.Textbox1.Value =...
3
by: Big D | last post by:
I have a class that inherits from System.Web.Ui.Usercontrol... all is basically is is a button which is created progammatically such as: public abstract class BaseFrontEndEditor :...
2
by: Wee Bubba | last post by:
my user control (usercontrol1.ascx) is added dynamically into a placeholder on page_load. within usercontrol1.ascx there is a button. When a user presses this button I want the page to reload with...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
2
by: Sam Miller | last post by:
Hi, I have a button event that won't fire. I left it on Friday and it worked fine. I came back in on Monday and it won't fire. I tried putting another button and just putting a...
2
by: Bundy | last post by:
Hi On my webpages I have replaced the submit button with a rolling submit button using the script below (Script 1). This script is used by many of my webpages and is included in a external...
5
by: rn5a | last post by:
Consider the following user control which resides in Address.ascx: <script runat="server"> Public Property Address() As String Get Address = txtAddress.Text End Get Set(ByVal value As String)...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
3
by: Christian Blackburn | last post by:
Hi Gang, I have written a product registration screen that has three text boxes. They take 4 numbers each (I know that's too few, but I'm not the originator of this code). In any event I want...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.