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
656 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
1 Comment
 
LVL 23

Accepted Solution

by:
Roopesh Reddy earned 320 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
asp enable view state 1 28
asp.net mvc5 6 23
insert value of checklistbox checked 4 32
Generate Unique ID in VB.NET 21 68
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

820 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