Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 21st, 2007, 11:21 PM
Friend of Wrox
 
Join Date: Jul 2006
Location: olathe, ks, USA.
Posts: 238
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to rsearing
Default Programatically Change Paramet Of ObjectDataSource

I have a GridView that points to an ObjectDataSource.
This ObjectDataSource's update method is:

Public Shared Function Upsert(ByVal myPaintingType As PaintingType) As Integer
    Return PaintingTypeDB.Save(myPaintingType)
End Function

Where myPaintingType is, obviously, my own object that has one field called "url".


My problem is that I have chnaged the "URL" column of the Gridview to a template so that I can change the "editItemTemplate" of URL to have a FileUpload control. I cannot figure out how to programatically change the "url" property of my object to the filename of the fileupload.

(Typically, you would have a textbox that "Binds" to the URL value--but I am deleting the textbox and putting the fileupload)

I have created a "Sub" in the codebehind of the page to try to capture the Gridview1 updating or the ObjectDataSOurce updating functions..but I don't know how to take the filename from the fileupload and put into the object that is being passed to the update method of my business layer.

Please help.

Kind Regards,
Rob


Reply With Quote
  #2 (permalink)  
Old July 22nd, 2007, 08:08 AM
Friend of Wrox
 
Join Date: Jul 2006
Location: olathe, ks, USA.
Posts: 238
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to rsearing
Default

I figured it out.


I was tying into the wrong event. I was trying to tie into the ObjectDataSource updating. Well, If you put the following in the GridView's rowupdating--works perfectly...I was able to programatically change the value of my object.

Dim url As String = myFileUpload.FileName
e.NewValues("url") = url

:)
Rob

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ObjectDataSource in UserControl Colonel Angus .NET Framework 2.0 0 April 3rd, 2008 10:14 AM
Problem with ObjectDataSource miguel.ossa ASP.NET 2.0 Professional 1 February 9th, 2008 08:37 AM
CH5 ObjectDataSource nabeelalkaff BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 March 8th, 2007 01:19 PM
Formview with ObjectDataSource rturner003 ASP.NET 2.0 Professional 3 November 1st, 2006 06:17 AM
ObjectDataSource and Wildcards pipelineconsulting ASP.NET 2.0 Professional 1 October 19th, 2006 09:08 PM



All times are GMT -4. The time now is 02:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.