Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

GetTheText\TemplateField

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gh - 27 Sep 2007 17:46 GMT
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>
IfThenElse - 27 Sep 2007 19:24 GMT
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

> 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
[quoted text clipped - 28 lines]
>   <asp:CommandField showeditbutton="True"></asp:CommandField>
>                                                 </Columns>

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.