Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 272119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:16:04+00:00 2026-05-12T00:16:04+00:00

I am trying to learn some ASP.NET MVC. Please bear with me but asp.net

  • 0

I am trying to learn some ASP.NET MVC.
Please bear with me but asp.net mvc is the first mvc framework i ever tried to learn. I do plan to learn more about mvc framework in different languages, but for now i got asp.net mvc.

I am fairly good with asp.net forms and love them, but would like to have another asp.net tool that allows me more freedom with HTML and JavaScript and Ajax.

The question i have is how partialViews are used ?
Another question is as far as i understand from watching all the videos is that model for database, controler for action and business logic and view is for the display.

However i have a code that doesn’t work, the View is pointing to the Model and not to what returning from controler (Trying to return partial view) I would really appreciate if somebody can point me in right direction and explain whats goes on.

Bellow is my simple code that doesn’t work:

PartialView

<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl(Of IEnumerable (Of MvcPortfolio.Defaultdb))" %>
    <p>
        <%=Html.ActionLink("Create New", "Create")%>
    </p>

    <table>
        <tr>
            <th></th>
        </tr>

    <% For Each item In Model%>

        <tr>
            <td>
                 <%= item. %>
            </td>
        </tr>

    <% Next%>

    </table>

Model

Public Function getProjects() As List(Of portfolio_project)
        Using myPortfolio As New PortfolioDataContext
            Try
                Dim projects = (From p In myPortfolio.portfolio_projects _
                                Select p).Take(5)

                Return projects
            Catch ex As Exception
                Return Nothing
            End Try
        End Using
    End Function

Controler:
Function Index() As ActionResult

    Dim myPortfolio As New Defaultdb ' my controler
    Dim projectsList As List(Of portfolio_project) = myPortfolio.getProjects() 'getting list of all the projects in news

    Return PartialView(projectsList) 'returning partial view.hopefully will work
End Function

and Main page:

<%@ Page Language="VB" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="MvcPortfolio" %>
<asp:Content ID="projectsContent" runat="server" ContentPlaceHolderID="newsContent">
    <%Html.RenderPartial("Indexprojects")%>
</asp:Content>

Can somebody please explain me how to make this code to work, so i will have a normal working example.
I want to use partial View because i want repeating stuff to be put in user control like pieces.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T00:16:05+00:00Added an answer on May 12, 2026 at 12:16 am

    Dmitris,

    Have a look at this question: How to use two instances of the same .ascx in the same page in ASP.NET MVC?. I think you will find some insight there.

    Also, you should spend some time and go through the NerdDinner tutorial.
    http://weblogs.asp.net/scottgu/archive/2009/04/28/free-asp-net-mvc-nerddinner-tutorial-now-in-html.aspx

    Partial views are called from the view, like this:

    <%= Html.RenderPartial("PartialViewName") %>
    

    They are not generally called from the controller.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to learn ASP.NET MVC, so I did as test project this where
im trying to learn some jsp as well as the spring framework. My application
I am trying to learn some of the basic and advanced features of visual
I have some javascript that I'm trying to retool using jQuery to learn the
I am trying to learn CodeIgniter to use for a shopping site, but I
Has anyone used structuremap with the new DI features of asp.net mvc 3.0? If
I'm doing some exercises on Data Access Layer in ASP.NET webforms. It looks to
I'm trying to learn some Erlang and having trouble figuring out the best approach
Trying to learn a bit of CSS and I want a horizontal navbar and
In trying to learn how to create objects in ActionScript, I have had no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.