Web Forms :: Using C# Classes Vb Classes Together In VS2008 / 3.5 Project
Mar 24, 2010Can I use VB and C# classes together in the same asp.net 3.5 project?
View 3 RepliesCan I use VB and C# classes together in the same asp.net 3.5 project?
View 3 RepliesI am new to LINQ. when we drag tables we get a dbml file and designer file.
For example DataClasses1.dbml and DataClasses1.designer.cs.
Once we have them then we can start using our LINQ Queries.
In my company project I do not see this designer files and instead there are .tt files which were used as templates to greate ABC.generated.cs files. Is this same as designer class?
I am following the Nerd Dinner tutorial as I'm learning ASP.NET MVC, and I am currently on Step 3: Building the Model. One part of this section discusses how to integrate validation and business rule logic with the model classes. All this makes perfect sense. However, in the case of this source code, the author only validates one class: Dinner.
What I am wondering is, say I have multiple classes that need validation (Dinner, Guest, etc). It doesn't seem smart to me to repeatedly write these two methods in the partial class:
[code]....
This doesn't "feel" right, but I wanted to check with SO to get opinions of individuals smarter than me on this. I also tested it out, and it seems that the partial keyword on the OnValidate method is causing problems (understandably so). This doesn't seem possible to fix (but I could very well be wrong).
I don't know if this has to do with how FindControl works or how scope works. But my base class is having a hard time seeing the fields of child classes. Currently I'm planning have the derived class set a property in the base class, but there are a lot of derived classes, so that isn't a very attractive solution.
[code]....
I'm curious as to what people consider better practice, between duplicating model structure in the view model and using a mapping tool to move data between the two, or aggregate the model inside the view model, i.e. have a property on the view model class that is a reference to the actual model. Which is considered a better approach in general?
View 1 Replieshere is simple:
I have a windows project and a web project within the same solution. I want to share the classes from the Windows project with the Web project. I do that by adding them as a linked component.
The problem is that the classes calls forms, controls and other things that when in Web project makes error.
Is there a way to ignore that kind of error? I mean, I won't even use those functions on the project, they just work on the Windows one.
Using vb.net/asp.net 2005. I have a project that is done with all vb.net, however I want to get some more experience with C#.Net. I am considering creating a new database class to put in the app_code folder.
View 3 RepliesI've got a old working project. But i like to work in 2008 with it.
So i've made a new clean project.
And imported the code, also the .cs files with the classes, the thing, i could not add a ASP.Net Folder for the App_Code (strange?).
So i made it by hand, maybe thats the problem... ?
But if i try to run the project coud'nt find the classes, while they are there, in the App_Code folder.
Does anyone know how to do this? I built a backend c# class in asp.net but want to access these same classes without recreating them in silverlight. Is this a possibility?
View 4 RepliesI'm using VS 2010. I got the references to the classes from my project, now I need the .dll files but I can't seem to find them. How do you add the .dll's?
View 1 RepliesI have existing ASP.NET 3.5 project I migrated to Visual Studio 2010. I didn't migrate it to .NET 4.0. Every time I try to edit .aspx page, it alters the .designer.cs class to point to System.Web.UI.WebControls.WebParts.UpdatePanel class instead of
System.Web.UI.UpdatePanel
class and then the build of course produces an error. The project properties says ".NET3.5".Also the "design" tab produces just one box saying "unknown server tag asp:UpdatePanel". It seems like it is looking at .NET4.0 to generate the desgn view, not 3.5
Is there a setting somewhere I need to change?
VWD 2010 Express.
We have shared CSharp classes put into a shared folders for re-use. Now I want to add those classes into my project by creating a new folder:
1) Right click the solution,
Add -> New Folder
Give it a new, eg. SharedClasses
2) Right click the new folder "SharedClasses"
Add- > Existing Item...
Browse to the "Shared Folder", include those shared classes. But those files are added physically into the folder "SharedClasses" rather than a reference. How do I just add a link to those shared files? Since these files might be modified from time to time, I don't want to delete and add those file frequently.
I've build a Class Library, in the same project i put a web project. But its impossible to access the classes from the dll generated by the class library. Whats wrong? JumpTide XML uses the namespace like:
namespace JumpTideClassLib
{
public class jumptidexml
{
public class MetaTags
{
Image:
I just want to start coding a simple master detail form but through with loosely typed datasets/objects and also layer or tier architecture. Is there any starter project for this kind of code? Most of the help I find on google discusses strongly typed data objects or very advanced designs.
View 5 Repliesim facing problem to access classes out side my project folders. for example if i want to use some methods from store.vb file inside my project i get error : Name Space is not defiend, i have tried all ways such as import sdf.ITracjer.Data
[Code]....
i can't fetch the Store Class Methods or Function because its out of project directory, as its showin in image.
I have been using LINQ to SQL for quite a while (about two years). Every thing was fine until now. As usual, I created LINQ to SQL classes and built the project, then created an aspx page. However, I cannot see the DataClassesDataContext in the code behind file. It is not listed in the intellisense list.
View 5 Replies i am wondering if i got a label that works out a price in default.aspx and then i want to show it on an invoice Invoice.aspx with Button.Attributes.add("onclick","popup(this)"); with java popup to show my invoice on button click how i am gonna get that label that works out the price to invoice.aspx?
here is my code sample,
[code]....
I am learning how to work with BLL and DAL
I have 2 class files in BLL and using DAL i am connecting to the sql database
in BLL i have a class called productsHelper.cs and using GetProducts() method used to fetch records from database
products.cs - have all insert,edit,delete methods
I want to bind all products to gridview
But I couldnt find how to do that.how to get those methods to my aspx.cs page from class files.and write code in there.
I am going develop a web site which will be getting 10000s of user on a daily basic at the beginning and expected to grow very fast. so would like to know In order to communicate with database like fetching and inserting records should i use DataSet or create my own custom classes.
[URL]
If I included a page class into a namespace the Profile page property becomes undefined.Why and how to solve this problem.For example I want to include my pages classes into a namespace MyProject.UI.
View 2 RepliesI have a BasePage class that all of my content pages inherit from. In my BasePage, I have many Import Statements. It seems as though they carry over into the derived class as one would expect. However, if you were to try and access code in the client aspx design page, as you would in the code-behind, you run into problems.
For instance, in my BasePage i have a Public Enum named ThemedSites. It's just an enumerator that lists the 5 different themes my site could be skinned as. I, at times, need to do different things in code, and in design, depending on what theme I'm currently in. I have a Public Property named CurrentSite (might have been more appropriate to say CurrentTheme, but that's besides the point). CurrentSite's return type is ThemedSites. So in code, one would say something like:
[Code]....
This works great in any page that inherits the BasePage class. This falters when that very same logic is used in the design page like:
[Code]....
Now, it works if you fully qualify both sides of the condition, but that's not my question. My question is: why isn't the Imported NameSpace in the BasePage recognized in the client-side server tag, as one would think it would be, according to how it IS recognized in the server-side code-behind?
I've been tinkering for hours and I can't figure this out. Seems like it should be pretty straight-forward. Is it possible to use reflection to get a reference to a partial page class given the page's name and path so that I can iterate through the page and examine its controls? I am not looking to examine the currently loaded page, but another page within the same website.
View 4 RepliesI have problem in accessing form control "Lable" which resides on my Default.aspx and I want to change the lable text from a class "Functions.aspx.vb".
View 4 RepliesI have some code in my new asp.net app that I need to share. So i created a shared class called
"utilities.vb" and put it in the APP_CODE folder. There is a function I have in there that pulls a person's image based off of their MemberId.
[Code]....
And I can call this function from my page using utilities.FcnGetMemberImage(). Ok, so all good so far until it complains about...
"Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class"
when referring to the Server.MapPath()
But the problem is that if I don't make it a Shared Function, I can't access it from my other pages. But if I do make it a Shared Function, it throws this error. The fix is supposed to be that I either don't share the function, or
"add the shared keyword to the member declaration", according to Microsoft at
http://msdn.microsoft.com/en-us/library/xfsswe45.aspx
But I'm not exactly sure how to "add the shared keyword to the member declaration" or what this means exactly and how this might affect other parts of my code?
Or is there a better way to work around this dilemma?
I don't know how can i use my css file in user control page.
View 4 Replies