.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Issues with rendering patial view

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :ASP.Net

I am totally a new bee in asp.net mvc. Let me now explain my issue. I have a strongly typed view which inherits from a view model Document. I want to have a partial view in that view itself. My code for this purpose is :

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<HexsolveMVC.Models.Document>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

View Complete Post

More Related Resource Links

Rendering Partial view postback with data posted back and entire view context

This is the base Index.aspx view:<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> <%@ Import Namespace="LMWebUI.Components" %> <%@ Import Namespace="LMWebUI.Models" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <% Session["HasScripts"] = "false"; %> <% if (Utility.FixNull(Session["LoggedIn"],"false") == "false" ) {%> <% ViewData["Login"] = new PartialRequest ( new { controller = "Account", action = "LogIn" } ); ((PartialRequest)ViewData["Login"]).Invoke(ViewContext); %> <%} else {%> <div>Logged In Content here</div> <%}%> <script type="text/javascript"> LMx.init(); </script> </asp:Content> This is a helper class> that I found elsewhere, doesn't solve the problem, but still works to display the viewpublic class PartialRequest { public RouteValueDictionary RouteValues { get; private set; } public PartialRequest(object routeValues

Issues with All Documents View

I have a Document Library and 'All Documents' is the default view for it. However, when I view the page, in the 'View' dropdown, the text is blank instead of 'All Documents'. Also, if I try 'Modify this view', I am getting message 'To customize this view further, use a Web page editor compatible with Windows SharePoint Services.' Also, if I goto Documents -> Settings, under 'Views' section, I see only 'Explorer View' and NOT 'All Documents'. If I click on 'Create View', 'All Documents' is available under 'Start from a view template'. I am not sure how to reset to default behavior ('All Documents' as default and able to modify the view through browser etc.,). I tried 'Reset to Site Definition' on 'AllItems.aspx' in SPD but did not work. How do I fix this issue ?

Ribbon rendering issues - Bug?

I am trying to implement a Ribbon menu in my application, but I am running into some issues. If I "manually" code everything in XAML, it is fine, but if I use ViewModels and Templates, the Label on the RibbonGroups is placed incorrectly. An example:   <ribbon:Ribbon.Resources> <DataTemplate DataType="{x:Type vm:CommandViewModel}"> <ribbon:RibbonButton Label="{Binding Label}" SmallImageSource="{Binding SmallIconPath}" LargeImageSource="{Binding LargeIconPath}" ToolTip="Placeholder Tooltip" /> </DataTemplate> <HierarchicalDataTemplate DataType="{x:Type vm:CommandGroupViewModel}" ItemsSource="{Binding Commands}"/> <ribbon:RibbonGroup Header="Test"/> </HierarchicalDataTemplate> </ribbon:Ribbon.Resources> <ribbon:RibbonTab Header="Home" KeyTip="H" ItemsSource="{Binding RibbonCommandGroups}"/>   The correct elements are rendered, meaning that my ViewModels and Templates are correctly bound, but the Text "Test" is rendered half way below the RibbonBar buttom. Am I doing something wrong, or is this a bug?

format-number issues with the Data View Web Part in SharePoint 2010

I have a number column named @Year_x0020_1_x0020_Revenue in the data view web part in SharePoint Designer 2010. In the Xpath expression builder - @Year_x0020_1_x0020_Revenue previews "500,000" If I use the format-number in the Xpath expression builder ==> format-number(@Year_x0020_1_x0020_Revenue, '$#,##0.00;-$#,##0.00'), it returns NaN. Is there any reason? 

MVC3 beta Razor View Base class/inheritance issues


There seem to be a few issues in the way Razor views are designed and the code generated

1. Descendants of WebViewPage are forced to override Execute() (since it is abstract) but that method is never called. Why?

2. The virtual method ConfigurePage is never called in descendants that override this method.

3. CreatePageFromVirtualPath is no longer virtual. This was the one method that gave us access to the Layout Page (Master Page) instance. Now we no longer have this access. Why was this done?

How can one get access to the instance of a Layout page?

Rendering Issues when embedding Notepad inside a WPF Window


My end goal is not to embed Notepad inside of a WPF window. I am using Notepad to demonstrate this issue because I am having the same problems with Notepad that I do when I attempt to embed a Labview Virtual Instrument into a WPF window.

The primary problem I am having is that there are rendering problems with the embedded Notepad window whenever I move or maximize the window. I am looking for advice on how I can make it so that the embedded window will not have these rendering issues.

My second problem is that I would like the embedded window to take up the full size of the form whenever the form is resized. If this is not possible, I'll just prevent resizing of the WPF window.

You can download my VS2010 C# 4.0 WPF solution from here: http://rapidshare.com/files/426808705/Win32Fun.zip

What are the steps or any known issues with rendering MP4 files within MOSS 2007 enterprise/WSS 3.0

We are looking to render MP4 files within our MOSS 2007 enterprise/WSS 3.0 environment. What are the steps and are there any known issues?  Thank you in advance for your help.

Rendering Area Partial view from External Dll



I am quite new to MVC and am gradually overcoming all my 'but WebForms can do that' issues but I still have one.

I wish to have components which I can deploy into an Area in order to keep things nice and tidy. This area will have a bunch of re-usable partial views like this.


I can render this MyAreaControl partial view fine in other Views inside that area but it fails when I try to render it from a not inside the area (e.g. view in the root of the site).

I am essentially using this syntax

<% Html.RenderPartial("MyAreaControl", new { area = "MyArea" }); %>
which seems to only look for this partial view inside the root Views folder, not the area one despite me specifying the area.
Is this a restriction of the system, a bug - or am I just doing it wrong.

Conditional Partial View Rendering


This is probably a no-brainer, but my head is not working today.

Just to get it work, I got a controller action that make use of a switch statement to decide which partial view to render, based on one of the members of the model passed in.  (Written by someone else for what it matter...I'm just cleaning up)

The viewmodel is overcomplicated, but that's not my decision right now and just have to live with it.

All partial's get rendered passing the same viewmodel, just a different partial get called.

 switch (model.something.code)
        case 1: 
          return PartialView("partial111", model);
		case 2:
			return PartialView("partial222", model);
		// ... and so it goes on...

Rendering web user control problem in design view

Hi friends.
i used some code from a site as below, which extends ASP.NET Menu Server Control,
mymenu renders as expected in browser but it renders in desinger as Ordinary Menu.
my question is how to override this behaviour to render in desgin view as in browser?
mymenu class:
using System;
using System.ComponentModel;
using System.Security;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CustomConrols
           Level = AspNetHostingPermissionLevel.Minimal),
           Level = AspNetHostingPermissionLevel.Minimal),
       ParseChildren(true, "MenuTitle"),
       ToolboxData("<{0}:MyMenu runat=\"server\"> </{0}:MailLink>")]
    public class mymenu: Menu

        private string menuTitle = "Menu";

Details View - Change control rendering



i am currently using the CSSFriendly adapters and need to change their behavours.  I am currently using a detailsview control to generate a form based upon a table in a DB and that the detailsview generates the column automatically.

If a column in the DB is of type bool the adapter displays a check box but for all other types it displays a text box.  I want to be able to customize this and actually have some rendered as dropdowns.  Is this possible by updating the adapter?

Issues with Alerting off a specific view


I have a Form Library with multiple filtered views.  Anytime there is a change to the documents in those views an Alert will be sent out.  We have the approval process turned on.  My issue is that when I make a change to a document in the view so it does not meet the requirements to appear in the view and is only seen in the All Items view, I delete the document from the All Items view, my customers are still receiving the Alert that a document has been deleted.  Why?  The document is not in the view that the Alert is set up for.

When you choose All Changes, does it ignore that you chose to Alert off a specific view and instead Alerts if the All Items view?

Truly Understanding View State

This article provides a detailed understanding of the ViewState.

GridView Parent Child View with JQuery Effects

I was just checked how to add some more cool effects to the GridView control using JQuery. In this post I will display parent-child data in the GridView control with some help of the wonderful JQuery library.

Let's first populate the GridView control.

Model View Controller (MVC) for ASP.NET

Model View Controller (MVC) architectures, immediately wonder how the MVC pattern can be applied in an ASP.NET world. This article will demonstrate how the MVC pattern can be applied to an ASP.NET web application and still maintain the basic Microsoft supplied architecture.

jQuery grid view plugin

jqGridView is new, client-rich, XML-based, ajax grid plugin for jQuery library. jqGridView provides professional solution for representing and editing tabular data on the web. Carefully designed, with powerful script API, this editable DHTML grid is easy configurable with XML, and shows convincing results working with large amounts of data. jqGridView allows easy implementation of nice looking(managed through css). jqGridView is not platform-depending plug-in, it can be used with different web -programming platforms like: ASP .NET/ASP, PHP, JAVA, CGI scripts etc. jqGridView has hight bowser compatibility.

Rendering ASP.NET Script References into the Html Header

One thing that I've come to appreciate in control development in ASP.NET that use JavaScript is the ability to have more control over script and script include placement than ASP.NET provides natively. Specifically in ASP.NET you can use either the ClientScriptManager or ScriptManager to embed scripts and script references into pages via code.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend