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
652 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now