I have an assembly that i have built with a linq to SQL item, a web reference and a class that brings it all together.I build the project and it all seems fine but when i reference the object from another project the web reference and linq objects are available but the class isnt.
I am trying to use Operator class to ConcatenateObject in my Class file of ClassLibrary. I have imported namespace of Microsoft.Visualbasic but still Operator class is not recognized. [URL] If I am trying to use add reference of Microsoft.VisualBasic.dll system say that it is already automatically adeed.
In my Code Behind I use several times this code below to bind and rebind (for refresh) e GridView after an insertion or other operations completed using EF objects.
Using a simple gridview.DataBind(); does not work because I call EF programmatically so I thought to use a Class to keep in memory this code that can create Objects for my GridView and call it how many time I need in my code avoiding redundancy.
In page behind classes I am using a private and shared object and variables (list or just client or simplay int id) to temporary hold data coming from database or class library. This object is used temporarily to catch data and than to return, pass to some function or binding a control.1st: Can this approach harm any way ? I couldn't analyze it but a thought was using such shared variables may replace data in it when multiple users may be sending request at a time?
I'm building an MVC 2 RTM app, and I want to be able to share my model across applications. I'd *like* to be able to implement it like:ASP.NET MVC2 app (holds Views and Controllers)Class library to hold Model(s)WCF app to handle the data transactions with the models via different data stores across apps I had the MVC app working fine, but I wanted to abstract the data stuff and be able to work with the model across apps through the WCF site, so I created a class library project and moved all of the Models classes into that and set-up a WCF app, then added project references to the MVC and WCF apps that point at the class library. The idea was I can create services that take and return objects from the model via method calls across apps. It appears that everything's wired up correctly in the MVC project, so I'm passing the objects stored in the Models class library between controllers and views and everythig is compiling just fine, but for some reason the data is not being passed back from the views to the controller on POST -- all of the properties in the classes are null or empty.
When I debug the app, I can see that the values are stored in the model data dictionary but not the model object itself. What am I doing wrong? Am I on the wrong path, or missing something obvious (to some)?
have some Objects, lets say Employee and Role defined as below and I have defined relationships in my database that gives me a list of objects say employees and thanks to my framework each employee object also has a Role object linked via the RoleIDID, UserName, Password, Email, RoleIDRoleID, RoleNameSo in code I can do something like this
I know how to bind a simple objects to a dropdown list. However I am having problems binding my objects which contains sub objects to the control.i.e. with simple object i just do ddl.DataValueField = "myproperty" with my objects they contains sub objects which i want to bind. I have tried ddl.DataValueField = "sub-object.myproperty" which doesnt work.
firstly a static class only ever exists once and is not an instance. Any static members (ie static int NoOfPeople;) is stored in one place and is shared between all sessions (like the old global variables). Now static methods is where i'm not 100% sure. If I have a static method that doesn't use any other static members could this cause inconstant results, example (this is a fairly pointless method but just a quick example of the top of my head)
[Code]....
So in this example if two sessions (or threads) were to call this at the same time - would they both get back the expected results, because the method only uses private data (a, b and totalToReturn).Im sure this sounds a little simple but I will be using static methods to build user objects and various other objects that there will have to be a 100% garentee that the objects will not get mixed up between sessions and the wrong things return to the user.
I'm working on a project in which we have a database, data layer (entity framework), business layer and web/UI layer.I want to use ASP.NET Dynamic Data for the web layer, but don't want it to access the data layer or database, as I want it to be purely running off business logic, and not directly accessing the data.However, it appears that Dynamic Data only allows Linq-to-SQL or entity framework data sources to be used.Has anyone used it with business-layer objects instead?
Lets say I am doing a shoping cart. I authenticate the user with a session variable.For example:
If(Request.IsAuthenticated) // Here I want to add to the shoping cart. // Can I do the following Session["Cart"] = "Washing Machine"; Now will this Session["Cart"] value which is washing machine here be unique to diff customers?
I read a xml file (myConfig.config) and provide it as an input to a CLR method. When I make changes to this xml file, it doesn't seem to be recognizing it. When this line throws an error, I always see the first version of the file as a part of the error message.In the config file properties, I have set Copy to Output Directory as Copy always, but it still doesn't seem to work.
I am developing a Web app that is based on ASP.NET 3.5, and i added some page from ASP.NET MVC, everything is ok, until i use the "HTML" helper class, then the page is not being able be render, because this is not recognized.
For Example : Html.BeginForm() => this is not recognize as a method
But if i used "System.Web.Mvc.Html.FormExtensions.BeginForm", which is a extension method itself, it work fine.
I uploaded my MVC2 application to my web hoster, but the web site does not run. When I request www.mysite.com, I just see the directory listing page of the root directory, and the web app does not execute. I don't see any error message, though. A normal Web Forms page works fine. Why is this?
The web server is running ASP.NET 3.5 SP1. It does not have the MVC assembly installed in GAC, so I followed these instructions to upload the MVC assembly with my page: http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx , but to no avail.
and it's not recognising that I added the span to the page. Is there something I need to do to make this happen? I have been working in MVC lately, so I haven't had to worry about the relationship between the page & code-behind in a while, but I can't remember any tricks that I had to perform to reference a HTML element in my code.
I just installed the release version of Visual Studio 2010, and it looks like there's something wrong with the standard ASP.NET server controls. When I create a basic server control, such as a TextBox, the editor underlines it in green and says (I also get no intellisense for ASP.NET controls): Element 'TextBox' is not a known element. This can occur if there is a compilation error in the Web site, or the Web.config file is missing. The web site builds fine, and the Web.config file is not missing:
I created a new page in an existing project. The existing pages are still good, but the new page is having problems at runtime. The problem is that controls are not recognized and throw a "object reference not found" error. I even tried Page.FindControl and that didn't work either. This is only happening with this page. The controls are recognized at design time, and are not recognized only at runtime.
The controls were copied from a regular Web form into a content form with a master page. They worked fine when in the regular web form. Could that be the issue?
I tried creating a new page and moving the controls over, but that didn't fix the problem. I also tried deleting the designer file and recreating it (using convert to web application) but that didn't resolve it either. I'm out of ideas here. Here is the page directive and the first control that is not recognized.
I'm using the UrlRewriting module on my site and I can't seem to get HttpContext.Current.Request.IsAuthenticated to return "true" on any rewritten pages.
If I go to my home page (http://localhost/default.aspx) I get "true", but if I go to something like (http://localhost/contactus) I am always getting "false".
also, for a direct example, I have an edit bar that is supposed to appear to anyone who is authenticated. The if statement fires in the Page_Load method
If HttpContext.Current.Request.IsAuthenticated Then _ Me.FindControl("EditBar").Visible = True
I have also tried putting this in the page load event
The error points to this line: DateTime tmpDate = Convert.ToDateTime(lblCalendarDate.Text).AddDays(-7);
I know it will be something to do with I have the date as a string in one method and the date as date in another method but I don't know how to rectify this seeing as I'm knew to ASP.Net & C#. Here is the code: