Connecting Tech Pros Worldwide Forums | Help | Site Map

viewstate for a File Input Control

Robin
Guest
 
Posts: n/a
#1: Nov 19 '05
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">



bruce barker
Guest
 
Posts: n/a
#2: Nov 19 '05

re: viewstate for a File Input Control


no need. the <input type=file> does not use viewstate as there it has no
data to store in viewstate.

-- bruce (sqlwork.com)


"Robin" <robin9876@hotmail.com> wrote in message
news:eInTlE1HFHA.1528@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">
|
|


Patrice
Guest
 
Posts: n/a
#3: Nov 19 '05

re: viewstate for a File Input Control


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" <robin9876@hotmail.com> a écrit dans le message de
news:eInTlE1HFHA.1528@TK2MSFTNGP09.phx.gbl...[color=blue]
> 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">
>
>[/color]


Robin
Guest
 
Posts: n/a
#4: Nov 19 '05

re: viewstate for a File Input Control


Is there another asp.net control that can be used to select a file that has
the viewstate option?

"Patrice" <nobody@nowhere.com> wrote in message
news:%23SbfMN2HFHA.1392@TK2MSFTNGP10.phx.gbl...[color=blue]
> What is the exact problem ?
>
> By design you'll never be able to persist values in this control for[/color]
safety[color=blue]
> reasons (i.e. the only way to fill this control is to have the user select[/color]
a[color=blue]
> file).
>
> Patrice
>
> --
>
> "Robin" <robin9876@hotmail.com> a écrit dans le message de
> news:eInTlE1HFHA.1528@TK2MSFTNGP09.phx.gbl...[color=green]
> > 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">
> >
> >[/color]
>
>[/color]


Kevin Spencer
Guest
 
Posts: n/a
#5: Nov 19 '05

re: viewstate for a File Input Control


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" <robin9876@hotmail.com> wrote in message
news:eMAyeP3HFHA.3928@TK2MSFTNGP09.phx.gbl...[color=blue]
> Is there another asp.net control that can be used to select a file that
> has
> the viewstate option?
>
> "Patrice" <nobody@nowhere.com> wrote in message
> news:%23SbfMN2HFHA.1392@TK2MSFTNGP10.phx.gbl...[color=green]
>> What is the exact problem ?
>>
>> By design you'll never be able to persist values in this control for[/color]
> safety[color=green]
>> reasons (i.e. the only way to fill this control is to have the user
>> select[/color]
> a[color=green]
>> file).
>>
>> Patrice
>>
>> --
>>
>> "Robin" <robin9876@hotmail.com> a écrit dans le message de
>> news:eInTlE1HFHA.1528@TK2MSFTNGP09.phx.gbl...[color=darkred]
>> > 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">
>> >
>> >[/color]
>>
>>[/color]
>
>[/color]


Closed Thread