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.

Problem: Usercontrol + Objectdatasource not updating parameters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
timdelong1@yahoo.com - 23 Sep 2007 00:45 GMT
I was writing a usercontrol in ASP.NET that contained an
objectdatasource, a gridview, and some other form controls (textboxes
and dropdown lists).  For the insertcommand parameters I associated
them with the form controls by assigning the ID of each control.  The
button event simply called the DataBind method on the Gridview.

If I then typed values into the form fields and clicked the button,
the insertparameter collection never updated itself based on the
values I just entered.

If I take this same code and paste it onto an aspx it works
perfectly.  Each button click correctly checks the controls and takes
whatever value is present.

Thinking I may have done something elsewhere that was causing the
problem I created an entirely new project, recreated everything, used
only one form control (a single textbox named TextBox1) and the exact
same behavior was repeated.

Any thoughts?  I know I must be doing something incorrectly here, but
I'm not sure what.  When I was assigning a form control to the
associated FormParameter I was just entering the control name (ex.
TextBox1).  The behavior displayed was almost like the datasource
couldn't find the form field.

Has anyone else encountered this problem, and if so, how did you fix
it?
timdelong1@yahoo.com - 24 Sep 2007 16:53 GMT
After a good nights sleep I realized my mistake.  I should have been
using ControlParameter instead of FormParameter.  Changing that fixed
the problem quite nicely.

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.