Hello everyone. I get problem with the login control and login view during working with my ASP.Net project. I'm using VS 2008, C# language, AJAX Control Toolkit. I built the master page, and I want the login control is always available everywhere in my website, but I cannot find how to make the login view and login control fit inside a table. My website has 3 part, header, main content, and footer. In main content, I'm create a table with 2 columns, the 2nd column I put the ContentPlaceHolder, the 1st I want to put the login view or login control on the top, so I divide again and I have 2 row in the first. But when I add the control, it expand full of the first column. I try to resize but the table will resize also. So anyone who know how to do that. I'm very appreciate that.

Hi,

I have a very similar problem. I have a login control inside a loginview on my masterpage inside a table cell. The cell before it contains a header image, and they are supposed to be very close together. It looks good in Visual Web Developer, but in a browser, there is a large space between my login control and the rest of the header (both are sized to be much smaller, but when I use developer tools to look at each element, the login is further over because the header is so large.) I am a novice at using CSS and tables and have been getting more and more frustrated. Please help me. I am including my markup below. Thank you very much.

-bsg

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    
  
    <asp:ContentPlaceHolder ID= "head" runat ="server">
       
    </asp:ContentPlaceHolder>
        <style type="text/css">
        
        .style2
        {
            width: 810px;
            height: 60px;
        }
        .style3
        {
            height: 128px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    <center><asp:Label ID="notifyRedirect" runat="server" Text=""  Font-Size ="Medium" ForeColor="Red" Font-names="Trebuchet MS" ></asp:Label></center>
   <table >
    <tr   >
    <td colspan = "3" >
    <asp:Menu ID="Menu2" runat="server" DataSourceID="SiteMapDataSource1">
            </asp:Menu>
                        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
    </td>
    
    </tr>
    
    <tr>
    <td id = "topBanner" class="style2">
        <asp:Image ID="Image2" runat="server"  ImageUrl="~/App_Themes/Events/Images/top banner.JPG"/>
    
        
    </td>
    
    <td rowspan="2" class="style3" valign="top" align="left" >
        
        <asp:LoginView ID="LoginView1" runat="server">
            <LoggedInTemplate>
                
            </LoggedInTemplate>
            <AnonymousTemplate>
                <asp:Login ID="Login1" runat="server" BackColor="#00FFCC" 
            CreateUserText="Not a member? Register now!" CreateUserUrl="SignUp.aspx" 
            DestinationPageUrl="~/Default.aspx" FailureText="" Height="90px" 
            TitleText="Event Planners &lt;br /&gt; Check when other events &lt;br /&gt; are planned for - avoid conflicts!" 
            Width="267px" VisibleWhenLoggedIn="False" onloggedin="Login1_LoggedIn"  >
                </asp:Login>
                       
        
        </AnonymousTemplate>
         </asp:LoginView>
         <asp:Label ID="LoginErrorDetails" runat="server" Font-Names="Trebuchet MS" 
        Font-Size="Small" ForeColor="Red"></asp:Label>
        <br />
   
        
    </td>
    </tr>
    <tr >
    <td>
    <asp:ContentPlaceHolder runat="server" ID="ContentPlaceHolder1">
    
    
    </asp:ContentPlaceHolder>
    
    </td>
    
    </tr>

    </table>  
   </form>
</body>
</html>

Hi! At this point, I might not get the perfect solution for that but I can tell you something that I figured out with this. I had to create and delete several time before I can get it. Ok now go to the main discussion. The Login View probably doesn't have ability to move with absolute position so you cannot move it. The Login Control has this, but if you put inside the login view, whenever you move the login view will be not perfect. And like before, I put it in the table, but when I moved it, the table or any header or div tag will be moved. So the solution for that is using div tag, not the table. You can look up why using div not table. One more thing that you need to have a good design of CSS Template, I come with the template on free, it has a div side bar so I can put my login to this side bar. Also, you don't need to but the script manager. Login control is a Ajax-Enabled control, which means you already got Ajax. The master page look like doesn't need to have a Ajax technique but the delivery page might need.
I hope this will help you get out some trouble.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.