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

  • Home
  • SEARCH
  • 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 8770165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:30:36+00:00 2026-06-13T17:30:36+00:00

I am trying to put on my homepage some link that render partial views

  • 0

I am trying to put on my homepage some link that render partial views – I want to display some info from the database when users click a link: the link should be replaced by text on the same page. I followed a tutorial but I cannot get it to work in my project. Here is what I have:

My Home/Index view:

<div id="NeZaman">
@Ajax.ActionLink("Ne Zaman Gelcekmiş?", "NeZaman", new AjaxOptions {
                                        UpdateTargetId="NeZaman",
                                        InsertionMode = InsertionMode.Replace,
                                        HttpMethod="GET" })
</div>

My HomeController:

    private CaglaContext db = new CaglaContext();

    public PartialViewResult NeZaman()
    {
        var neZaman = db.Caglas.Where(c => c.Id == 1).Select(c => c.NeZamanGelcek).FirstOrDefault();
        return PartialView("_NeZaman", neZaman);
    }

My partial view (_NeZaman.cshtml):

    @model caglageldimi.Models.Cagla

<p>
   @Model.NeZamanGelcek
</p>

My Model(Cagla.cs):

public class Cagla
{
    public int Id { get; set; }
    public bool GeldiMi { get; set; }
    public string NeZamanGelcek { get; set; }
    public string Nerdeymis { get; set; }
}

So I’m passing in a neZaman value that the partial view is supposed to use, but how?

  • 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-06-13T17:30:37+00:00Added an answer on June 13, 2026 at 5:30 pm

    You’ve set your patial view’s model to your class:

    caglageldimi.Models.Cagla

    But you’re passing a string:

    db.Caglas.Where(c => c.Id == 1).Select(c => c.NeZamanGelcek).FirstOrDefault();

    Your select statement is only grabbing the “NeZamanGelcek” string property value to send to your partial view.

    Changing your partial view’s model to System.String should fix it:

    @model System.String

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

Sidebar

Related Questions

trying to put a strongly typed partial view on a homepage in asp.net but
Trying to put a regex expression together that returns the string between _ and
I trying to put together an Android app that will take a picture and
I'm trying to put some custom list adapters into their own classes to make
I'm trying to put together a GUI for setting some pricing. There are three
I'm trying to put together a layout using Bootstrap that resembles your typical OS
Trying to put a function call that returns an int into a call for
I am trying put ads inside my blogger post & i want my data
I'm working on a site that I didn't build. I'm trying to put an
I am trying to put some distributed caching into play, I'm using this indeXus.Net

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.