I am interested to know what happens with unused properties of a class when an object is instantiated?
Are there performance hits for having additional unused properties? What about complex properties that are accessing the database, but I'm not using them, are they still being loaded?
I currently have a ProfileCommon enabled on my site and would like to know where I would start to transfer this ProfileCommon's context to a user's profile after he/she has logged in. Here is a snippet of how I have defined this ProfileCommon:
I try to get the user profile settings with this code. But all items in it are empty, in the database they are not empty. So there is going something wrong. First of oll how can i add a provider to the ProfileCommon ? Maybe i'm there then... the usrInfo is filled well...
first of all: this probelm was already an issue in [URL] but it does not resolve my problem: I have VS2008 and SQL Server 2008 Express with Adv. Option istalled. When compiling a page with the reportviewer control I get the error Type 'Microsoft.Reporting.RdlBuildProvider' cannot be instantiated under a partially trusted security policy (AllowPartiallyTrustedCallersAttribute is not present on the target assembly). C:websitesadAgencyweb.config
From the obove mentioned post I learned to use <trust level="Full" /> in the web.config file (which I never used on other Implementations that work). Now the compilation works, but when I start the web application and call that page I get a lot of JScrip Errors like: Runtime error in Microsoft JScript: 'RSClientController' is undefined, which comes from a line in the dynamic page.aspx file: document.getElementById('ctl00_maincontent_ReportViewer1').ClientController = new RSClientController "ctl00_maincontent_ReportViewer1_ctl03", "ReportFramectl00_maincontent_ReportViewer1", ...
I should mention, that I had SQL Server 2005 Express uninstalled before the 2008 version.
I've added some custom properties via the <profile> node in the web.config. In a view, I can access the custom properties using <%= Html.Encode(Profile.CustomProperty) %> so I know the class is being automatically generated. However, in the Controller, the ProfileCommon just doesn't exist. Do I need to include a specific namespace for this to work or is it simply not supported?
I'd like to add some properties to logged in user. The last time I did this was a website made in VS2005 and ProfileCommon worked just fine. It seems however that this class is not included in web applications in general and .NET 4.0 in particular. I there for assume there is now a better way of doing this. Could anyone tell me what it is? In short I'd like to add PersonID to user's login to make it easy to hide information not related to that particular user by setting controllers like
if (!User.IsInRole("Administrator") { var item = PickLists.GetPerson(User.Profile.PersonID); // or something like it return View(); } var item = PickList.GetPeople(); return View(); }
What is wrong with this code? The error is Object reference not set to an instance of an object.
I have the below code in my class, then on the login page i need the GUID so i can perform a lookup in one of our custom tables. But then the error above pops up before the page even loads at the line Guid guid = (Guid)userInfo.ProviderUserKey;
I am working with telerik and currently designing a Login Control. But however I am getting this error :
[Code]....
The code files are : Aspx : [Code]....
And the C# : [Code]....
I am getting this particular error from few days in various cases, some problems are solved in turn around ways, but I don't know how to solve this one. I am facing trouble in understanding FindControl() method.
I have a MVC 2 project I'm trying to deploy to a QA server, and I'm having fits. I get a YSOD with the error starting as:
[InvalidOperationException: An error occurred when trying to create a controller of type 'DSC.Web.Controllers.HomeController'. Make sure that the controller has a parameterless public constructor.]
I've installed Visual Studio on the server, and the application runs without issue from Visual Studio. I've also checked the HomeController and it does have a parameterless public constructor. What could be causing this issue?
I've been trying to figure out a way to solve this but still i wasn't able to solve it. Here's the scenario i'm creating a login page and i'm trying to restrict users from accessing certain page. They need to login first before they can access the page. examin the codes below:
I am using a grid, with udpate panel, ajax controls etc.So in my code behind everytime the hit my grid page I am clearing the previous session value stored.I do this:
[Code]....
But sometimes when i navigate to other pages and come back to this page it errors out saying:
" Collection was modified after the enumerator was instantiated."
This JQuery datatable is present in one of my webuser control named "LeftVerticalLayOut.ascx". I am dynamically instantiating Webusercontrol on click of a link button. This link button is bound with the trigger event of Update Panel control.
So clarifying once again : I have one UpdatePanel which I am triggering with Link button("lnkLoadControl") . On click on "lnkLoadControl" I am able to load Usercontrol("LeftVerticalLayOut.ascx") onto the updatepanel. Now the jquery datatable I am creating in load event of Usercontrol is getting generated.
After the datatable(having id as "example") is created, I am calling the below code in my
function loadHandler() { Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); }
[code]...
Now as I am creating the UserControl on the fly, the Jquery in not getting applied.
When I am using SqlDataReader class on that time without creating instance of the SqlDataReader Class I m using Command.ExecuteReader() Method. Why We not create the object of the SqlDataReader Class by using " new " Operator.We use like below:
SqlDataReader dr=cmd.ExecuteReader(); Why not we use this class like below:
i created a user control that has a template container.
[code]....
This is control is placed in a repeater which lists some customers. The customer is than bound to the user control. When the name template is instantiated in the container, the customer object is not yet available, but I need to access its name because it needs to get parsed before.
[code]....
Question: How can I access properties set for the user control BEFORE the template container is instantiated?
I have created a class library in which i m having Web Forms.now when i use this dll in ASP.NET websiteand call methods
ModuleTest obj = new ModuleTest(); List<CustumFields> objlist= new List<CustumFields>(); obj.CheckModule("admin", "password", "Testing102", objlist);
then it gives error,ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment
this.components = new System.ComponentModel.Container(); this.panel1 = new System.Windows.Forms.Panel(); [Code]....
this error occurs at .this.webBrowser1 = new System.Windows.Forms.WebBrowser();
when i mouse over webBrowser1 then it shows null....