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.

2715 questions
0
votes
1 answer

bind data to dropdownlist of partialview in MVC3 using viewbag

I want to create a partial view control in MVC 3 to use this control in my whole application. In my partial view there is 2 drop down lists one for country and another for states. But when i used this i am getting error.please advise how can i make…
Sinoy Devassy
  • 564
  • 4
  • 11
  • 27
0
votes
1 answer

Submitting a form in a partial

in my _Layout.cshtml file I have @Html.Partial("_SearchPartial") In this partial file I have @using (Html.BeginForm()) { @Html.TextBox("Search") } Question is, how do I make this…
Sachin Kainth
  • 45,256
  • 81
  • 201
  • 304
0
votes
1 answer

How to write generic code the Rails way for superclass object in Rails partial view?

Problem My app manages ProjElements, which are subclassed into: Milestone Task Decision ... etc For a given ProjElement's show.html.erb, you can comment on that project element instance (e.g. you can add a comment on Milestone XYZ or Decision…
Daniel May
  • 2,192
  • 5
  • 25
  • 43
0
votes
1 answer

How to use NodeTypeAlias within Umbraco 5

Getting error 'Umbraco.Cms.Web.BendyContentList' does not contain a definition for 'Children' While trying to use @inherits RenderViewPage @using System.Web.Mvc.Html @using Umbraco.Cms.Web; @using Umbraco.Framework; @using…
Christopher Marshall
  • 10,678
  • 10
  • 55
  • 94
0
votes
1 answer

A good multi-level partial view (user control) stucture

If have a filter form with multiple filter control inside like first name, last name, birth date, database name etc. Some of them need to be wrap into a control and reuse in the future, so I have something like: @model FilterViewModel
Frank
  • 7,235
  • 9
  • 46
  • 56
0
votes
3 answers

mvc3 .net Display View Template using Html.DisplayFor

I'm trying to use templates. I'm having trouble using using the Html.DisplayFor extension I want the template to display all the data as read-only. I believe that HTML.DisplayFor can do this? If this is so, I have a IEnumerable model being passed…
user1079925
  • 541
  • 2
  • 8
  • 20
0
votes
1 answer

Divide a user interface into asp.net mvc views

I have a CSS #MainDiv containing a #TreeDiv on the left side and a #DataGridDiv on the right side. The TreeDiv contains a Javascript Treeview with Department objects and the DataGridDiv contains a Datagrid with Employee objects. Changing the…
Pascal
  • 12,265
  • 25
  • 103
  • 195
0
votes
2 answers

How to make view partials in Objective C?

Old question title: How to capture events in parent UIViews, such as HUD layers? I am attempting to write a game using the UI framework rather than cocos2d. I would like to make View partials with all their events handled properly. It does not…
zardon
  • 2,910
  • 6
  • 37
  • 58
0
votes
1 answer

MVC3 Partial view method not firing

I have a Partial view (Login, with username, password and Submit button), and the partial view is being used on my _layout (materpage). So, on my _layout page, I have:
@Html.Partial("_LoginPartial")
My…
Craig
  • 18,074
  • 38
  • 147
  • 248
0
votes
3 answers

MVC3 Partial view inside Master Page

On my site, I want to display a Login box on all pages. So I wanted to make a partial view page, which I use on my _Layout.cshtml file in Shared. But where would the controller for this partial view go? And how would my Login button have access to…
Craig
  • 18,074
  • 38
  • 147
  • 248
0
votes
1 answer

Refactor using partials and collections

could the following code be refactored and simplified by using the collection parameter of partials? I can't see how it could be done because of the "path" local variable being passed in. <% @admins.each do |admin| %> <%= render :partial =>…
pingu
  • 8,719
  • 12
  • 50
  • 84
0
votes
1 answer

Calling ASP.NET MVC3 Razor Url.Action in partial automatically appends id when reloading in ajax

I have an ASP.NET MVC page with multiple partial sections. Each of these sections has a script initialization and each be refreshed as a partial from itself.