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

viewstate for a File Input Control

On an ASP.Net page that has viewstate enabled.
How do you enable viewstate for a server side file input control?
Currently I have in the HTML view.
<INPUT id="myID" type="file" name="myID" runat="server">
Nov 19 '05 #1
4 2002
no need. the <input type=file> does not use viewstate as there it has no
data to store in viewstate.

-- bruce (sqlwork.com)
"Robin" <ro*******@hotmail.com> wrote in message
news:eI**************@TK2MSFTNGP09.phx.gbl...
| On an ASP.Net page that has viewstate enabled.
| How do you enable viewstate for a server side file input control?
| Currently I have in the HTML view.
| <INPUT id="myID" type="file" name="myID" runat="server">
|
|
Nov 19 '05 #2
What is the exact problem ?

By design you'll never be able to persist values in this control for safety
reasons (i.e. the only way to fill this control is to have the user select a
file).

Patrice

--

"Robin" <ro*******@hotmail.com> a écrit dans le message de
news:eI**************@TK2MSFTNGP09.phx.gbl...
On an ASP.Net page that has viewstate enabled.
How do you enable viewstate for a server side file input control?
Currently I have in the HTML view.
<INPUT id="myID" type="file" name="myID" runat="server">

Nov 19 '05 #3
Is there another asp.net control that can be used to select a file that has
the viewstate option?

"Patrice" <no****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
What is the exact problem ?

By design you'll never be able to persist values in this control for safety reasons (i.e. the only way to fill this control is to have the user select a file).

Patrice

--

"Robin" <ro*******@hotmail.com> a écrit dans le message de
news:eI**************@TK2MSFTNGP09.phx.gbl...
On an ASP.Net page that has viewstate enabled.
How do you enable viewstate for a server side file input control?
Currently I have in the HTML view.
<INPUT id="myID" type="file" name="myID" runat="server">


Nov 19 '05 #4
Hi Robin,

I have seen a solution that uses an input type=file HTML element that is
hidden with a style. Over that is placed a text box and a button. When you
click the button, it clicks the hidden button in the hidden element (using
JavaScript), which pops up the file open dialog box. Once you select the
file, the value attribute of the file upload element is copied to the
textbox, again, using JavaScript. By using this technique you have
ViewState, and a more malleable user interface.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Robin" <ro*******@hotmail.com> wrote in message
news:eM**************@TK2MSFTNGP09.phx.gbl...
Is there another asp.net control that can be used to select a file that
has
the viewstate option?

"Patrice" <no****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
What is the exact problem ?

By design you'll never be able to persist values in this control for

safety
reasons (i.e. the only way to fill this control is to have the user
select

a
file).

Patrice

--

"Robin" <ro*******@hotmail.com> a écrit dans le message de
news:eI**************@TK2MSFTNGP09.phx.gbl...
> On an ASP.Net page that has viewstate enabled.
> How do you enable viewstate for a server side file input control?
> Currently I have in the HTML view.
> <INPUT id="myID" type="file" name="myID" runat="server">
>
>



Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: theo | last post by:
Hi... I wish to extract the text content of an Xml file and assign it to DropDownList controls at runtime.I can get the Xml file text content into the DropDownList controls (Ex...if 5 Xml text...
6
by: Robin Bonin | last post by:
In my user contol I am creating a set of dropdownlists. Each list is created based on input from the other lists. The problem I am having is setting the selected index on the lists. If someone...
0
by: Moheb Missaghi | last post by:
Hi: I am trying to use the Transfer statement in an .aspx file to redirect and send Form and QueryString collections to a different page. A good example where this is needed is a checkout page...
1
by: Simon | last post by:
Hi everyone, I have a quick question that I hope someone can help me with: I've made a user control that contains a text box and some validation functionality. This control has a few extra...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
10
by: Lloyd Dupont | last post by:
When you define UserControl in source code the sample I see are often like that: ============ public string Text { get { String s = (String)ViewState; return ((s == null) ? String.Empty : s);...
5
by: Just Me | last post by:
I have a simple page and was trying to test viewstate for a textbox. in my page_load event If not ispostback then textbox1.text="hello" end if
5
by: Mark Olbert | last post by:
Tonight's episode of me beating my head bloody against the monitor was the result of ViewState/ControlState information not being available when CreateChildControls() gets called for a...
1
by: dawidg | last post by:
I have an asp.net page with viewstate disabled. I have a control on the page that dynamically creates controls inside itself, no viewstate. The controls aren't created in Init, but in Load. With...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.