 |
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 25th, 2006, 02:43 PM
|
|
Registered User
|
|
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ok. took out datasourceid, put dataview in. getting the original error of "Both DataSource and DataSourceID are defined on 'DataView'"
i'm executing the bind within the Private Sub Page_Load
i'm not doing any postbacks --- I'm getting the id via querystring sent from a different page
|
|

August 25th, 2006, 02:48 PM
|
|
Registered User
|
|
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi imar,
thanks for the advice.
i'm already trying to do what you're suggesting; however, the difference is this is a DetailsView and not a GridView. For some reason, I'm getting a "Both DataSource and DataSourceID are defined on 'DataView'. Remove one definition." error when i try to compile.
|
|

August 25th, 2006, 02:52 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
is there anywhere else that you are doing the bind??
is there anywhere that you are setting a datasourceid????
if you take out the original bind, it compiles????
HTH
Gonzalo
|
|

August 25th, 2006, 03:06 PM
|
|
Registered User
|
|
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
okay. my first error was attempting to compile/test without passing an ID in the querystring. now i'm doing that; and, now -- i'm getting "Control 'DataView' of type 'DetailsView' must be placed inside a form tag with runat=server."
|
|

August 25th, 2006, 03:14 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
now I dont understand you, didn't you just put the control on the page??
it's some kind of weird page????
do you have a form tag???
HTH
Gonzalo
|
|

August 25th, 2006, 04:10 PM
|
|
Registered User
|
|
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
form tag... i wrapped it in a form tag -- that worked.
thanks for your patience.
|
|

August 25th, 2006, 07:41 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Is it working now??
I used a GridView in my code, but the exact same logic and code can be used for other data bound controls like the DetailsView.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

March 21st, 2007, 01:35 AM
|
|
Registered User
|
|
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
DataView.DataSourceID = ""
DataView.DataSource = myDataSet
DataView.DataBind();
check this
Cheers...
Wowarjuna
|
|

March 22nd, 2007, 08:58 AM
|
|
Registered User
|
|
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks a million for that post! I was having a heck of a time reloading the d-view after inserting a new record.
in C# it's
detailsViewParty.DataSourceID = null;
detailsViewParty.DataSource = newParty.GetEnumerator();
detailsViewParty.DataBind();
most appreicated
|
|
 |