This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm trying to use a LoginView control in my DynamicData site, but the problem is when I use LoginView1.FindControl("GridDataSource"), even-though I can get the object, I end up seeing the following error:
How can I fix this error? |
|
|
This seems to be working correctly for me. You don't say where in the Dynamic Data application the error occurs (home page? list page? edit page?) but I have tested it on both the home page and list page and it was okay there. From your mention of GridDataSource I am guessing it was not the home page so here's what I had in list.aspx:
Note I left DynamicDataManager1 and GridDataSource outside the LoginView -- I don't know if that makes a difference. Now the generated
And everything worked fine. The relevant bit of global.asax is:
but I assume this is already in place in your case since presumably your Dynamic Data site was working before you added the LoginView. Is it possible that you removed or commented out the following line in
This is what sets up the context type on the LightSpeedLinqDataSource, though if I comment it out I get a different error from what you describe. If none of this helps, can you provide us with a small project that exhibits the problem? |
|
|
thanks for your reply. Yes, the problem was on the List page, and I moved DynamicDataManager1 and GridDataSource outside the LoginView. I have the DynamicDataManager1.RegisterControl on my Init but now I'm getting a new error:
I suppose the problem is that DynamicDataManager sets ContentPlaceHolder as the GridView1's owner which results in the error. but I couldn't change the cause. Is there a way around that? |
|
|
I found the cause. I just had to comment out the following line:
Thanks for your help. I'll post here if anything goes wrong. |
|