Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 10, 2012 11:36 AM by pavankumarmcafresher
Member
7 Points
97 Posts
May 10, 2012 08:31 AM|LINK
can i use the variables of one model class into another model class in ASP.net MVC3 If so How?????
All-Star
55262 Points
5917 Posts
Moderator
MVP
May 10, 2012 08:37 AM|LINK
What do you mean? Please explain your requirement clearly (perhaps with examples of what you're trying to achieve).
134947 Points
21626 Posts
May 10, 2012 08:38 AM|LINK
pavankumarmcafresher can i use the variables of one model class into another model class in ASP.net MVC3
Of course. Put the same names and transfer it .
May 10, 2012 08:47 AM|LINK
Hi HeartattacK,
Let us say i have three classes in Model namely Login, User, Company...
I declared the variables for User and Company too with same names as that are in my db.
Now,
I want to use the variables of user class into Login Class without desinging table for Login and without new variables...
so that i will do login validations in the login page with the variables of User Class..
I hope u understand it...
Now guide me...
see once this link http://forums.asp.net/t/1802181.aspx/1?Does+not+contain+a+definition+
May 10, 2012 08:48 AM|LINK
ignatandrei transfer it
What it mean by Transfer it
May 10, 2012 08:51 AM|LINK
pavankumarmcafresher Hi HeartattacK, Let us say i have three classes in Model namely Login, User, Company... I declared the variables for User and Company too with same names as that are in my db. Now, I want to use the variables of user class into Login Class without desinging table for Login and without new variables... so that i will do login validations in the login page with the variables of User Class.. I hope u understand it...
You do confound the Database model with the ViewModel
Please see http://msprogrammer.serviciipeweb.ro/2010/03/29/asp-net-mvc-orm-and-viewmodels/
May 10, 2012 09:01 AM|LINK
May 10, 2012 10:10 AM|LINK
pavankumarmcafresher
Please make any relevant comment
May 10, 2012 10:33 AM|LINK
ya sorry, Moderator,
It is my mistake and
by the way, i got my task completed....
and thanks for replying me and supporting me
May 10, 2012 11:18 AM|LINK
pavankumarmcafresher by the way, i got my task completed....
please say how.
pavankumarmc...
Member
7 Points
97 Posts
use the variables of one model class into another model class
May 10, 2012 08:31 AM|LINK
can i use the variables of one model class into another model class in ASP.net MVC3
If so How?????
HeartattacK
All-Star
55262 Points
5917 Posts
Moderator
MVP
Re: use the variables of one model class into another model class
May 10, 2012 08:37 AM|LINK
What do you mean? Please explain your requirement clearly (perhaps with examples of what you're trying to achieve).
blog: www.heartysoft.com
twitter: @ashic
ignatandrei
All-Star
134947 Points
21626 Posts
Moderator
MVP
Re: use the variables of one model class into another model class
May 10, 2012 08:38 AM|LINK
Of course. Put the same names and transfer it .
pavankumarmc...
Member
7 Points
97 Posts
Re: use the variables of one model class into another model class
May 10, 2012 08:47 AM|LINK
Hi HeartattacK,
Let us say i have three classes in Model namely Login, User, Company...
I declared the variables for User and Company too with same names as that are in my db.
Now,
I want to use the variables of user class into Login Class without desinging table for Login and without new variables...
so that i will do login validations in the login page with the variables of User Class..
I hope u understand it...
Now guide me...
see once this link http://forums.asp.net/t/1802181.aspx/1?Does+not+contain+a+definition+
pavankumarmc...
Member
7 Points
97 Posts
Re: use the variables of one model class into another model class
May 10, 2012 08:48 AM|LINK
What it mean by Transfer it
ignatandrei
All-Star
134947 Points
21626 Posts
Moderator
MVP
Re: use the variables of one model class into another model class
May 10, 2012 08:51 AM|LINK
You do confound the Database model with the ViewModel
Please see http://msprogrammer.serviciipeweb.ro/2010/03/29/asp-net-mvc-orm-and-viewmodels/
pavankumarmc...
Member
7 Points
97 Posts
Re: use the variables of one model class into another model class
May 10, 2012 09:01 AM|LINK
ignatandrei
All-Star
134947 Points
21626 Posts
Moderator
MVP
Re: use the variables of one model class into another model class
May 10, 2012 10:10 AM|LINK
Please make any relevant comment
pavankumarmc...
Member
7 Points
97 Posts
Re: use the variables of one model class into another model class
May 10, 2012 10:33 AM|LINK
ya sorry, Moderator,
It is my mistake and
by the way, i got my task completed....
and thanks for replying me and supporting me
ignatandrei
All-Star
134947 Points
21626 Posts
Moderator
MVP
Re: use the variables of one model class into another model class
May 10, 2012 11:18 AM|LINK
please say how.