I have an Entity class names Users and i need this to be called at a View Names Create.
How can i do that?
I need to call the properties of Users class
Pls help me....
Printable View
I have an Entity class names Users and i need this to be called at a View Names Create.
How can i do that?
I need to call the properties of Users class
Pls help me....
Create is almost exactly the same as Edit except that you simply create a new, blank instance of your class instead of getting a populated on from the database. This is something that you'd know already if you had been through a decent tutorial, which I strongly recommend that you do. Here's the one that I used when I started:
http://www.asp.net/mvc/tutorials/old...inner-tutorial
C# code and ASPX syntax but the principles are all the same for VB.NET and Razor as well. Your question is covered in chapter 5.
Here's a more up-to-date tutorial:
http://www.asp.net/mvc/tutorials/mvc...o-aspnet-mvc-4
It mentions the Create action/view very briefly in chapter 5 also, mostly saying that it's just like Edit except for passing an empty model object.
Thank you very much for the tutorial JMCilhinney.
But here in this tutorial Model class's properties is calling from View. But here i need have a seperate project named Entity and inside that project the Users class. I already refered this project to my main project. and in View i have used the following code to use this Users class's properties's access
@using Entity;
and for this Entity's class i need to access in the view. For that i dont know how to create an object for this.
for model class i know by using the following line we can do
@model namespace.models.classname
but here i dnt know
I don't really know what you're asking. You specify the type of the model in the view and you create an instance of the model in the controller. None of that is dependent on where the model is defined. Just use the full name of the model's type.
The problem was the class i have created wasnt under the Model. So that made me confused. now its ok.
i put it as
@model Entity.Users
Its working :)
Thank you so much once again.
Since am new to vb.net, you always there to correct me :)