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

Using a collection in a partial render

I am trying to a render a partial with a collection, and have been able to do it, but, it is looping through of the partial than I would like. Here is my partial code: <% if tabs[:label]…
0
votes
2 answers

JQuery Grid or Loop through partial views?

Has anyone been able to customize jQGrid? While I'd like something easy I can pluing and use that provides paging, I find that the layout is "tight" ( not in the cool way ) the gird is too excel-like. I'd much prefer one with spaced out grid rows…
5x1llz
  • 213
  • 2
  • 8
0
votes
1 answer

How can I wrap text around a partial

I'm trying to wrap the text from a post around a partial, which renders a but is seems the best i can do is get it to do is align right. Any ideas? <%= render "shared/slider" %> <%= render "shared/calender" %>
<%=…
Antarr Byrd
  • 24,863
  • 33
  • 100
  • 188
0
votes
1 answer

Best way to include scripts and css in an MVC3 renderaction/partialview

working in an Asp.Net MVC3 project, using razor engine, I found a situation that I don't know how to handle at best. In a view, I have the following situation: @foreach (var item in Model.Items) { Html.RenderAction("ActionName", new {param =…
themarcuz
  • 2,573
  • 6
  • 36
  • 53
0
votes
1 answer

Ajax load partialview accepting a parameter

I have a view that list Parts in a htmltable format from a database table PartList. The htmltable contains a link which should be used to enter values to the database table Bom. When clicked on the link, it should load a partialview for that…
Suja Shyam
  • 971
  • 2
  • 27
  • 57
0
votes
1 answer

What's the best way to selectively render rails partials based on the page loading it

For example, all pages need my Footer partial, but the home-page has a couple words that need to be different, and Page Y has one minor alteration too.
Evan
  • 7,396
  • 4
  • 32
  • 31
0
votes
1 answer

How redirect action with all params

I have action in controller Statistic public ViewResult Index(string userName, GridSortOptions gridSortOptions, int? page, DateTime? dateTimeFrom, DateTime? dateTimeTo) { .. } I create partial view _FromToDateViewPage.cshtml…
Deniska d
  • 59
  • 11
0
votes
2 answers

How do I make a multi-use partial view that renders controls with different name values in asp.net mvc 2?

I have a web application where all the data is in a single table and is therefore contained within a single class object. The structure of the table is something…
jason
  • 2,219
  • 5
  • 33
  • 66
0
votes
1 answer

rails nested form confusion

I have this model : class Employment < ActiveRecord::Base accepts_nested_attributes_for :month_lines end and there forms : employment.new = form_for @employment do |f| = f.fields_for :month_lines do |builder| = render…
Gady
  • 1,514
  • 2
  • 16
  • 32
0
votes
1 answer

mvc3 httpResponse.write

I have some partial views that are rendered sequentially. I would like to create a log of what has rendered successfully on the top of the page, when the last partial view has completed. The only way I can think of, is to keep an array of log…
River
  • 1,487
  • 3
  • 15
  • 25
0
votes
2 answers

Where to place a query that should be included in all or most views

In my application I have a sidebar which I want to include a list of pages. Cheating on the MVC setup, I can pretty easily display this as follows (in HAML): # layouts/_sidebar.html.haml %h4 Pages %ul.pages - for page in Page.all %li= link_to…
Andrew
  • 42,517
  • 51
  • 181
  • 281
0
votes
2 answers

Share a partial among different resources

I have the following bit of code in my views: - if admin? .meta Administrator options: = link_to 'Edit This Post', edit_post_path(@post) | = link_to 'Delete This Post', @post, :method => 'delete', :confirm => 'Are you sure?' I…
Andrew
  • 42,517
  • 51
  • 181
  • 281
0
votes
1 answer

Using another partial to render a collection

My cart model contain line_items. I am working in a cart view. In a view if i do : <%= render cart.line_items%> The _line_item.html.erb partial is rendered. To use another partial, it need a more verbose syntax of render. Before trying to use…
Syl
  • 3,719
  • 6
  • 35
  • 59
0
votes
3 answers

i try to pass data from controller to partial view in viewdata but it didn't work correctly

I'm trying to pass data from my controller to a partial view using ViewData but it's not working correctly. code in controller public PartialViewResult PartFace() { string message = "You are not connected to Facebook"; string…
0
votes
1 answer

'Can not resolve action' at partialview in ASP.NET MVC Shared Area

I am working on ASP.NET MVC3. I have a partial view RestaurantAdminNavigation.ascx which i moved from Views/Restaurant Folder to Views/Shared Folder. I have a action link in that view <%:Html.ActionLink("Edit", "Edit", "Restaurant", new { …
Foyzul Karim
  • 4,252
  • 5
  • 47
  • 70