Home > DeveloperSection > Forums > User control in ASP.NET MVC.
James Smith

Total Post:48

Points:336
Posted on    September-07-2011 12:52 AM

 ASP.NET MVC ASP.NET MVC 
Ratings:


 1 Reply(s)
 1700  View(s)
Rate this:
Hi....
Am very new in asp.net mvc. I want to create a user control in asp.net mvc. I had created it but I did not able to refrence it in my views.
Please help me!

Thanks.


Awadhendra Tiwari

Total Post:126

Points:882
Posted on    September-08-2011 12:41 AM

Hi James Smith,
You can write down following code in view where you want to access user control.

<div>
      <% Html.RenderPartial("UserControl1"); %>
</div>

Where UserControl1 is name of usercontrol which is created under View/Shared directory.

Thanks.

Don't want to miss updates? Please click the below button!

Follow MindStick