Go Premium for a chance to win a PS4. Enter to Win

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
?
685 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 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

885 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