Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

I have an MVC 4 view, with a partial view. How do I create two columns. One for each view?

Posted on 2013-02-05
1
Medium Priority
?
682 Views
Last Modified: 2013-02-07
I am working with MVC 4. I have a view, and in that view I have a partial view. What I want to do is to to have two columns on my view form. The left column for the main view. And the second column for the partial view. As you can see from the attached file Main_cshtml, on that form I include the partial view surrounding it in a div's.

  <div class="right"> @Html.Partial("LoginPartial")</div>

    </div>

I have attached the partial view just for reference. I tried using CSS to create two columns. It is not working though. Below is my css. Perhaps someone can point me in the right direction.

.container{
             width: 100%;
             height: 100%;
             position: absolute;
             left: 0
             top: 0
          }

          .left{
               width: 20%;
               height: 100%;
               float: left;
          }

          .right{
               width: 80%;
               height: 100%;
               float: right;
          }
Main-cshtml.txt
PartialView.txt
0
Comment
Question by:brgdotnet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 23

Accepted Solution

by:
Roopesh Reddy earned 1280 total points
ID: 38858219
Hi,

Check this code -
.container{
             width: 100%;
             height: 100%;
             position: absolute;
             left: 0;
             top: 0;
           
              
          }

          .left{
               width: 20%;
               height: 100%;
               float: left;
    
          }

          .right{
               width: 79%;
               height: 100%;
               float: right;
    
          }

Open in new window


For more information - http://matthewjamestaylor.com/blog/perfect-2-column-double-page.htm

Hope it helps u...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question