Questions tagged [partial-views]

User control in Asp.Net Web forms that is used for code re-usability. Partial views helps us to reduce code duplication . Reusable views like as Header and Footer views .

Partial view is like a regular view with a file extension .cshtml. We can use partial views in a situation where we need a header, footer reused for an MVC web application. We can say that it’s like a user control concept in ASP.NET.

2664 questions
0
votes
1 answer

Is it possible to display multiple partial view one below row-wise in single _Layout.cshtml?

I have a situation where i wish to render 2 partial views in single layout.cshtml one below another. Each partial view belongs to separate controller. I processed it using 2 different approach, the first one which i wanted it to work didn't worked…
0
votes
0 answers

How to return a partial view in .net core 3

Returning partial view in core seems different to mvc5 so anyone can help, index view is working perfectly but, i returned the partial view without my layout or anything of index view nothing at all only the products [HttpPost] …
0
votes
0 answers

Is it possible to populate a viewmodel and form error messages via ViewData[]?

(Update: I found out that the Model in a view is read-only, so my initial idea of populating the model properties via ViewData is not possible. Any other workaround?) I have some CRUD-functionality as partial views. If the submitted form is invalid,…
Stian
  • 1,168
  • 12
  • 34
0
votes
1 answer

The Controller ActionResult not called from partial_view just in new tab

I have a partial view as a side menu. From that I want to call a Controller method when I click to the link. Now it's doing nothing, not hitting the breakpoit in the controller. BUT if I click on the link with right click and select "open in new…
0
votes
0 answers

How can i pass data from my Ajax function to a HTML model in a partial view?

I want to use an Ajax function to change the HTML model in a partial view. The function in the MVC controller returns the correct value (List). But how can i pass this data (result) from the Ajax function to a partial view (_locationListPartial) ?…
0
votes
1 answer

'object' does not contain a definition for in asp.net core 3.1

there are two parts to this question number 1: im having receiving the same issue as in this post the only diff is that im running in asp.net core v3.1 Dynamic Anonymous type in Razor causes RuntimeBinderException ive tried the expando solution but…
toy
  • 358
  • 1
  • 3
  • 16
0
votes
1 answer

creating a partial view which changes the content of page using commands provided in URL

I am showing a modal popup when someone click login button and then they can enter their credentials, if successful they can move forward but if not an on the modal shows ... this is working fine ... but my concern is below submit button I have a…
Safran Ali
  • 4,359
  • 9
  • 37
  • 57
0
votes
1 answer

Unable to figure out why a photo attribute of the paperclip plugin is not being passed in as a params on submit

I am trying to implement a feature in my app where a user posts a message along with an image. This is something similar to what is there in www.diasp.org . I dealing with a pretty much outdated configuration of Rails 2.0.2 and Ruby 1.8.7 , both…
0
votes
0 answers

Can I add a partial view to an existing MVC5 project?

I need to implement a Telerik control into an existing page of a MVC5 project. The problem is that I don't own the source code of the project (it's an off the shelf framework) so when I open it in VS there is not the model and controller files…
0
votes
0 answers

Rendering Partial Views: Model Mismatch and DataViewDictionary Issue (Razor Page/ASP.NET CORE)

Amateur programmer here coming back with some more dumb questions for you wonderful people. Please excuse the ignorance on my part when you review my code, it is likely not as clean as some of you pro's out here would like it to be. I am doing my…
0
votes
1 answer

Load partial view with ajax actionlink

I've been trying to load a partial view but when clicking the link it inserts the whole site instead of just the partial view. What am I doing wrong? In my template I have: @Ajax.ActionLink("View list", "List", "SwitchView", new…
David
  • 61
  • 5
0
votes
1 answer

Calling Partial View JavaScript function

I have a partial view that contains a function named test(). The view is rendered correctly in the parent view. I need to call test() from a parent view JavaScript function. When I try so, an error occurs: test() is not defined. I am using ASP.net…
Hasan Shouman
  • 1,436
  • 16
  • 25
0
votes
1 answer

how to render a partial view from controller in asp.net core

I have an action in the controller to load data for Partial view as below: public async Task ParentTutorCountByLocation() { var result = await this.dashboardService.GetParentTutorCountPerLocation(); return…
Ram Singh
  • 5,979
  • 29
  • 93
  • 156
0
votes
1 answer

Link in partial Razor Page fires wrong OnGet

I am using a razor page to display an ItemT model and at the bottom I inserted a partial view to show all properties (which are not assigned to this model in a n:m relation). The PageModel 'FreePropertiesToItemT' has two public properties: public…
g.r.b
  • 15
  • 4
0
votes
0 answers

How can I include partial views in a ejs file?

I am trying to include a simple partial template in my ejs file. I watched several tutorials explaining how to do that and I see no difference between their code and mine. I also checked the path a few times, but I'm always getting the same…
1 2 3
99
100