.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Post New Web Links

Can't find my datacontext in custom fieldtemplate

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net
 

I am trying to implement sjnaughton's ChildrenGrid (a Dynamic Data FieldTemplate that displays foreign key child rows...) ... I am having problems at runtime, though. The following call in my code:


table = GridDataSource.GetTable();

Is failing with the error: System.Web.HttpException: Could not load type 'ModelDataContext'.

ModelDataContext is indeed the name of my .dbml file... I can declare a local instance of this class and that works fine,something like

var t = new ModelDataContext();

No exception. And the rest of my Dynamic Data classes work fine. I am trying to get the table from a griddatasource, and I know I am setting the context properly on this line

GridDataSource.ContextTypeName = metaChildColumn.ChildTable.DataContextType.Name;


I have debugged and the string is set to "ModelDataContext" just fine. I tried appending the full namespace for my context, like "MyApp.App_Code.ModelDataContext", but then I get an ambiguous assembly name... but I only have one ModelDAtaContext... I cleaned out my project, deleted ASP.NET temp folder files, etc. Still, no dice. Here is the code in full context:

using System;
using System.Data;
using System.Configuration;
using System.


View Complete Post


More Related Resource Links

Problem in Custom Control Unable to find Control To Validate Property

  

I make a custome control by taking a TextBox and A Regular Expression Validator.When i Use this on a .aspx page it works fine.But when i use this on .ascx page and dynamically load user control on a place holder in .aspx page it through an Error

Unable to find control id '_ctl0:txtEmail' referenced by the 'ControlToValidate' property of '_ctl0:txtEmailRequired'

 

My Custome control Code is this"--

public class EmailValidator:System.Web.UI.Control, INamingContainer{

private System.Web.UI.WebControls.TextBox textBox;

private System.Web.UI.WebControls.RegularExpressionValidator regularExpressionValidator;

public EmailValidator(){

textBox = new TextBox();

regularExpressionValidator = new RegularExpressionValidator();

IsErrorTextBelow = true;

IsRequired = false;

Find and replacement SSIS Custom component issues

  
Hi All, I developed one custom component in SSIS  Find and Replacement I register the dll and copy and paste in to Pipleline component. but it's not visible in the Toolbox while choose Items Please suggest why it's not comming.. using   System; using   System.Collections.Generic; using   System.Linq; using   System.Text; using   Microsoft.SqlServer.Dts.Pipeline; using   Microsoft.SqlServer.Dts.Design; using   Microsoft.SqlServer.Dts.Runtime.Wrapper; using   Microsoft.SqlServer.Dts.Pipeline.Wrapper; using   System.Data.OleDb; using   System.Data.SqlClient; using   System.Windows.Forms; using   System.Runtime.InteropServices; using   System.Data; using   System.Collections; using   Microsoft.SqlServer.Dts.Runtime; using   Microsoft.SqlServer.Server; namespace   FindAndReplace { [ ComVisible(true)] [ DtsPipelineComponent ( DisplayName = "Find and Replace", Description = "Finding Find and replace", IconResource = "Microsoft.Samples.SqlServer.Dts.Find and Replace.ico", ComponentType = ComponentType.Transform )]   class FindAndReplace :PipelineComponent {   #region   ProvideComponentProperties   /// <summary>   /// </summary>   public ove

trying to use custom assembly with script task in SSIS 2008 - can't find correct version of GACUtil

  

I am trying to use a custom assembly (compiled with VS 2005 framework 2.0) with SSIS 2008.  I understand that I need to put this Assembly in the GAC.  I initially attempted to do this using the GACUtil, but I apparently only have version 1.1 of GACUtil intalled on my development PC.  Shouldn't version 2.0 have been installed as part of VS 2005? 

So I then tried simply copying the dll into the GAC folder using windows explorer.  Well, the dll is now visibly in the GAC folder, but I cannot see it from either VS 2005 or BIDS 2008.  Does that mean I do need to use GACUtil 2.0 or higher to install the DLL into the GAC?  If so, is there any place on the Web that I can download it?


Cannot find custom tool 'SharePointWebPartCodeGenerator' on this system.

  
When trying to make a change to a web page in a Web Part when I complete the change and attempt to save the ascx file this error shows up as a warning in the Visual Studio 2010 Error List.  When I deploy the Web Part nothing has changed.  I am assuming it is due to this error.  The question here is how does this, the SharePointWebPartCodeGenerator, get installed?  I already uninstalled and reinstalled SharePoint 2010 Server and the SharePoint SDK.

How to find the resources from Custom Control

  

Hi

    I Created one custom control, i am using that control in some places. but i want to acess that controls(For example button, which is in custom control) in where i am using. how i can fetch that controls. please any one help me.

 

 


Custom search to document library to find specific document

  

Hi

I have a document library with having multiple folders approx 100 (001 to 100) , each folder is having multiple document ,Every folder in that document library contains 50000 documents , Document library has some fileds like Fname, Lname,Document Type [Look up field] having value(Genral,Average,Advance) . now the problem is to search these documents with using custom search as per requirement

the user wants a webpart where it has 2 textbox [FName and LName] and a dropdown [Document type] and a button , using this the user can enter the first name , last name and selecting document type from the dropdown and finally clicking the search button filters the document library. 

my problem is with that how the value of this search criteria can be passed to the Document library.How these webpart can be connected with custom search or do we have any other way to search.

 

Thanks

 


report definition cannot find custom assembly in VS 2010

  

Hello,

I;m trying to use custom code (C#) in a report definition and I have followed the steps outlined in MSDN to get this done. However, whenever I compile the code, I keep getting the following error

"Error while loading code module: ‘GSLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’. Details: Could not load file or assembly 'GSLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."

I've scoured through this forum and the net looking for answers but nothing seems to work. The closest answer was to mark the assembly as a trusted code module in the current app domain, but VS2010 complains that this method is deprecated.

The assembly works just fine elsewhere in code. How do I get custom C# code to work with the reports I am creating.

Thanks for your help.


"403 forbidden" Error in my Custom login page, cant find problem

  
I Created a custom login page using Sharepoint Application page which is cofigured with FBA.  but every time redirect to http://testsp.max-perf.com/_layouts/DataQ.Extranet/test.aspx?ReturnUrl=%2f_layouts%2fAuthenticate.aspx%3fSource%3d%252F&Source=%2F .  I have  Win2008 (not r2) and sp2010. Thank you.

Custom Controls in C# .NET

  
Embedding user controls in a Windows form is just like adding a simple button or text box that are already provided with .NET. These basic controls were written essentially like you code your own controls. Typically the controls you design are to be used in multiple forms or to modularize your code. These reasons help reduce the amount of code you have to type as well as make it easier for you to change your implementation. There should almost never be any reason to duplicate code because it leaves a lot of room for bugs. So, implementing functionality specific to your control in the control's source code is a good idea. This reduces code duplication as well as modularize your code, which is a good programming guideline.

Writing custom MembershipProvider

  
ASP.NET Membership mechanism allows to use the build-in server tables to store and retrieve user data. By default, this mechanism can only be used with SQL Server database to which Microsoft provides suitable MembershipProvider class.
Inheriting from this abstract class, developer can use his own table(-es) from any database and use any database engine other than SQL Server, like Oracle, DB2 etc.

Custom Editing Behavior for DataGridView TextBox Columns

  
For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key

Write Custom WebParts for SharePoint 2007

  
The popularity of SharePoint Portal Server 2003 led Microsoft to tightly integrate the next SharePoint version, Microsoft Office SharePoint Server (MOSS) 2007, with its ASP.NET 2.0 WebPart framework. This tight integration enables the ASP.NET and SharePoint developer to do a number of things that previously weren't possible

Writing Custom Web Parts for SharePoint 2007

  
As I mentioned in an earlier blog post, SharePoint 2007 is built on top of ASP.NET 2.0, which means you can now use ASP.NET 2.0 features (Forms Authentication, Master Pages, Membership, Site Navigation, New Data Controls, etc) when building SharePoint sites. This is true for both the new Windows SharePoint Services 3.0 version (which will be a free download) as well as Microsoft Office SharePoint Server 2007 (which costs money).

Custom views on .aspx webpage

  

Hi again, i have a client that needs me to create a custom view on thier webpage similar to Microsoft Word.

It goes about that, when I click on an image it redirects me to another page and must create a custom view for a certain paragraph on that page. I am not sure how to do this and wonder if anyone knows how.

I am using C# programming language if that helps at all. I Heard that using javascript would work but i dont know javascript yet so is there any alternative?


Set Custom Paper size in C#.net 3.5

  

Dear All,


I have to set custom paper size 6X8 inches

plz tell sugest me code how to do it.

in C#.net 3.5

i m using Asp.net 3.5 Crystal report

i have to do it programiticlly


Regards,

Rakesh


find a Control inside a GridView using jQuery

  

I have databound GridView in my page and I have a hidden DIV in all rows. Each row contains a Button that I want it to make the DIV visible for me! how can I use that with jQuery?!


here is the code page: 


<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                EnableModelValidation="True" GridLines="None" ShowHeader="False" Width="100%">
                                <Columns>
                                    <asp:T

Is there any way to find out the reason for session expiry?

  

Dear All,

is there any way to find out the reason for session expiry?

Regards

Denny


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend