GetTheText\TemplateField

G

gh

Below is the code for my GriView Columns. When the user clicks the
update button I am going to need to get the value of the FileUpload text
box, for the edited row. I was thinking of using the RowUpdating event
for this. How do I get at the FileUpload Text.

TIA

<Columns>
<asp:BoundField readonly="True" datafield="ExternalId"
sortexpression="ExternalId" headertext="ExternalId"></asp:BoundField>
<asp:BoundField datafield="PhotoID"
sortexpression="PhotoID" headertext="PhotoID"></asp:BoundField>
<asp:BoundField datafield="PhotoDate"
sortexpression="PhotoDate" headertext="PhotoDate"></asp:BoundField>
<asp:BoundField datafield="Description"
sortexpression="Description" headertext="Description"></asp:BoundField>
<asp:BoundField datafield="Notes" sortexpression="Notes"
headertext="Notes"></asp:BoundField>
<asp:BoundField datafield="Photographer"
sortexpression="Photographer" headertext="Photographer"></asp:BoundField>
<asp:BoundField datafield="PhotographerWebsite"
sortexpression="PhotographerWebsite"
headertext="PhotographerWebsite"></asp:BoundField>
<asp:BoundField datafield="PhotoPath"
sortexpression="PhotoPath" headertext="PhotoPath"></asp:BoundField>
<asp:TemplateField headertext="Select File">
<ItemTemplate>
<asp:FileUpload id="FileUpload1"
runat="server"></asp:FileUpload>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField showeditbutton="True"></asp:CommandField>
</Columns>
 
I

IfThenElse

http://www.dotnetspider.com/kb/Article2098.aspx

From link above.

If there is only a single file control then we can use the PostedFile
property of the file control to upload files.
This property is of type HttpPostedFile class and contains the following
methods and properties which aids file uploading.
FileName -- Returns the full path and name of the uploaded file.
ContentType -- Returns the full path and name of the uploaded file
ContentLength -- The size in bytes of the uploaded file.
Methods used are SaveAs(Path) Saves the uploaded file to the specified path.
First paste this inside form tag for file field
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top