473,395 Members | 1,368 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,395 software developers and data experts.

Upload file field

42
Hey everybody.

I have problem with my upload input control. My form contains input controls calendars and check boxes with conditions to show text field. I can do the file selection normally and it will be shown in a text field. However if I after this choose a date from my calendar or check a conditioned check box the chosen upload file disappears from text field. So user has to choose the file again.

Does anyone know cause or a solution for this problem?
Jan 31 '07 #1
11 1362
kenobewan
4,871 Expert 4TB
I believe that you have a postback problem and may need a Not Page.IsPostBack in the page_load...

Hope that this helps.
Feb 1 '07 #2
zamuel
42
Thanks for the answer. I'm not totally sure if I know what you mean by that. I have following code on the beginning or the page

private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
//contains strings for opening SQL connection
}

All the conditioned controls are separately on their private functions.
Feb 1 '07 #3
kenobewan
4,871 Expert 4TB
Thought that there may be a problem with postback or viewstate... Is the textbox readonly set to true?
Feb 2 '07 #4
zamuel
42
Well, the readonly has to be "False" in every field in page cause user has to be able to edit the contents of the fields. I believe this is not possible with "True" value on readonly. Correct me if I'm wrong.
Feb 6 '07 #5
kenobewan
4,871 Expert 4TB
Just checking that they were set to false... Try posting relevant code...
Feb 7 '07 #6
zamuel
42
Ok, here some code from one of the check boxes which opens text box and causes upload file to disappear.

private void WoNumberCheckbox_CheckedChanged(object sender, System.EventArgs e)
{
if (WoNumberCheckbox.Checked==true)
{
WoNumberTextbox.Visible=true;
WoNumberLabel.Visible=true;
}
else
{
WoNumberLabel.Visible=false;
WoNumberTextbox.Visible=false;
}
}

Functionalities of other checkboxes are similar. I cannot figure that there is something false in code.
Feb 8 '07 #7
kenobewan
4,871 Expert 4TB
I believe that this function is where you need to make use of the If not page.ispostback. Here is an article that explains why:
If Not Page.IsPostBack

Hope that this helps.
Feb 9 '07 #8
zamuel
42
Thank you for answer kenobewan. The article was really informative. I understand need for 'not Page.IsPostback'. Actually I have placed my db bind dropdown list inside of 'not Page.IsPostback'. The biggest consern however are the check boxes. I have understood that you need 'private void CheckBox_CheckedChanged...' etc. as event handler to check the change and then execute condition, in this case open textbox where user can enter information. I don't know how to do this in 'not Page.IsPostback'.
Feb 9 '07 #9
Just a tidbit of information

When the calender or checkboxes are causing a postback, the file the user has selected is actually being uploaded to the server and the file input textbox cleared.

You can work around this by using the MS AJAX Lib and wrapping the calendar , checboxes and relevant controls in an UpdatePanel.
AJAX HERE
and do a full page submit when all options are selected and file chosen.

or force the user to select a file later in the process
or even use JS based calander and update the checklists to use JS to hide/show the label instead of a postback
Feb 10 '07 #10
zamuel
42
Thanks for the information chazcross. Actually in my form in doesn't work that way. The form doesn't even know the path of upload folder before the "next" button is pressed. In this phase the file is saved to session which is saved to folder later on.

I wonder about this Ajax program. Do you need some additional program installed to server in order to run Ajax supported forms? Just wondering cause in our strict environment it is always hard to get these kinds of administrative tasks through.
Feb 13 '07 #11
It is a setup program that you install on the server and only works with asp.net 2.0

However you can install it on your dev machine and add a reference to the dll file instead. A copy of it will appear in your bin folder, be sure to upload this to your testing/production machine. You will have to update your web.config file, but all the required settings can be found by creating a new asp.net ajax site and copying the settings.
Feb 14 '07 #12

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

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
5
by: Thomas Brooks | last post by:
Hi there.... I have an ASP routine that I'm writing which updates an Access database with a user name, the file name, etc. all done through parameter processing and SQL functions. I do not...
3
acoder
by: acoder | last post by:
How to Upload a File in Coldfusion Use the cffile tag for uploading files to the server. Note that allowing people to upload files is fraught with danger and only trusted users should be...
9
by: Steve Poe | last post by:
I work for an animal hospital trying to use PHP to store an animal's dental x-rays to a file server. I can browse for the xray on the local desktop computer then click "Upload Image". This...
2
chunk1978
by: chunk1978 | last post by:
hi there... i've written a small PHP script to upload files onto my server... but whenever i upload a file, the file size becomes automatically smaller on the server... for example: i uploaded a...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
2
by: hotflash | last post by:
Hi All, I found the best pure ASP code to upload a file to either server and/or MS Access Database. It works fine for me however, there is one thing that I don't like and have tried to fix but...
2
by: hotflash | last post by:
Hi Master CroCrew, I found a good PURE ASP that will allow you to upload 10MB file to the server and the file contents such as Network, Author, Title, etc... will insert to MS Access at the same...
0
by: ll | last post by:
I'm working with 'pure ASP upload' script which is designed to redirect to an alert/error message, should a file larger than the set limit be attempted to be uploaded. The problem is that, while...
1
by: ririe | last post by:
Hi. I have a problem here. I want to upload a file together with its semester. So I create two field. One for the semester and one for the file to be uploaded. But the script doesn't work. I don't...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.