CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 12/7/2007 10:59:06 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 22 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
crouzilles
Asp.Net User
masterpage not refrshing properly12/7/2007 10:59:06 PM

0/0

Hello,

 

I have the following masterpage:

 

1    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="WebApplication1.Site1" %>
2    
3    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4    
5    <html xmlns="http://www.w3.org/1999/xhtml" >
6    <head runat="server">
7        <title>Untitled Page</title>
8        <link href="Stylesheet1.css" rel="stylesheet" type="text/css" />
9    </head>
10   <body>
11       <div id="navigation">
12           <% if (Session["logged"] == "yes")
13              { %>
14                   <ul>
15                       <li>
16                           logged
17                       </li>
18                   </ul>
19           <% } %>
20       </div>
21   
22           <div id="content">
23   	        <asp:ContentPlaceHolder ID="MainContent" runat="server">
24           
25               </asp:ContentPlaceHolder>
26           </div>
27   </body>
28   </html>

  I also have a login.aspx file which looks like this:

 

1    <%@ Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="WebApplication1.WebForm_login" Title="Untitled Page" %>
2    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
3        <form id="login_form" runat="server" method="post">
4            <% if ((string)Session["logged"] == "no")
5           {
6               login_div.Visible = true;
7               calendar_div.Visible = false;
8           }
9           else
10          {
11              login_div.Visible = false;
12              calendar_div.Visible = true;
13          } %>
14           <div id="login_div" runat="server">
15               <table border="0" cellpadding="0" cellspacing="2">
16                   <tr>
17                       <td colspan="2">
18                           Please log in<br /><br />
19                       </td>
20                   </tr>
21                   <tr>
22                       <td>
23                           <label for="username">Username:</label>
24                       </td>
25                       <td>
26                           <asp:TextBox ID="username" TabIndex="1" runat="server"></asp:TextBox>
27                       </td>
28                   </tr>
29                   <tr>
30                       <td>
31                           <label for="password">Password:</label>
32                       </td>
33                       <td>
34                           <asp:TextBox ID="password" TabIndex="2" runat="server" TextMode="Password"></asp:TextBox>
35                       </td>
36                   </tr>
37                   <tr>
38                       <td>
39                           <asp:Button ID="login_button" Text="Login" runat="server" OnClick="do_login" />
40                       </td>
41                   </tr>
42               </table>
43           </div>
44           <div id="calendar_div" runat="server">
45               <asp:Calendar ID="Calendar1" runat="server" BackColor="White" 
46                   BorderColor="Black" DayNameFormat="Shortest" Font-Names="Times New Roman" 
47                   Font-Size="10pt" ForeColor="Black" Height="220px" NextPrevFormat="FullMonth" 
48                   TitleFormat="Month" Width="400px">
49                   <SelectedDayStyle BackColor="#CC3333" ForeColor="White" />
50                   <SelectorStyle BackColor="#CCCCCC" Font-Bold="True" Font-Names="Verdana" 
51                       Font-Size="8pt" ForeColor="#333333" Width="1%" />
52                   <TodayDayStyle BackColor="#CCCC99" />
53                   <OtherMonthDayStyle ForeColor="#999999" />
54                   <DayStyle Width="14%" />
55                   <NextPrevStyle Font-Size="8pt" ForeColor="White" />
56                   <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" 
57                       ForeColor="#333333" Height="10pt" />
58                   <TitleStyle BackColor="Black" Font-Bold="True" Font-Size="13pt" 
59                       ForeColor="White" Height="14pt" />
60               </asp:Calendar>
61           </div>
62       </form>
63   </asp:Content>
64   

 Once logged in, the calendar div gets displayed and the login div becomes invisible as planned, my problem is that the menu contained in the master page does not get displayed at all although I set the Session["logged"] variable to "yes".

This is the code behind for loging in:

 

1    protected void do_login(object sender, EventArgs e)
2            {
3                String uname = username.Text;
4                String upass = EncryptPassword(password.Text);
5                string sql = "select * from tadminuser where username = :uname and passwrd = :upass";
6    
7                NpgsqlCommand cmd = new NpgsqlCommand(sql, (NpgsqlConnection)Application["conn"]);
8                cmd.Parameters.Add(new NpgsqlParameter("uname", DbType.String));
9                cmd.Parameters.Add(new NpgsqlParameter("upass", DbType.String));
10               cmd.Parameters[0].Value = uname;
11               cmd.Parameters[1].Value = upass;
12               NpgsqlDataAdapter da = new NpgsqlDataAdapter(cmd);
13   
14               // create dataset and give a name to it
15               DataSet ds = new DataSet("admin_user");
16   
17               // fill the dataset using the dataadapter and give the table a name
18               da.Fill(ds, "admin_user");
19   
20               // create a datatable and populate it with the table contained in the dataset
21               DataTable dt = ds.Tables["admin_user"];
22   
23               if (dt.Rows.Count != 1)
24               {
25                   Response.Write("The username and/or password may be incorrect<br />Please try again");
26               }
27               else
28               {
29                   Session["logged"] = "yes";
30               }
31           }
  

Any idea why this is happening?

 

Thank you
 

crouzilles
Asp.Net User
Re: masterpage not refrshing properly12/8/2007 11:56:18 AM

0/0

I must confess that I have solved my own problem, you are going to laugh but here it goes.

The menu had a black background and text color, so I though it did not refesh properly as nothing

appeared.

My apologies to all. 

2 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Menu Control with XmlDataSource not refreshing - ASP.NET Forums I have an issue with my Menu control not refreshing.. it behaves as if ... control and on the master page.. also on the master page i added ...
Master Page, Content place holder and Style Sheet issue - ASP.NET ... The .css works fine on my master page but not in my ContentPlaceHolder ! .... So can you check to see if the css is getting properly applied ...
Syncfusion: Essential Suite Release Notes #8824- Error occurs while refreshing CallbackPanel which contains ... #10106- The Menu control loaded in masterpage is not properly linked to the specified ...
Essential Studio ASP.NET : Version History : Syncfusion Page refreshing issue, when GridGroupingControl placed inside Callback Panel is ..... The Menu control loaded in masterpage is not properly linked to the ...
Customizing the Login Page in SharePoint 2007 So, the key to modifying a master page is to NOT remove any required ..... how to refresh contentplaceholder without refreshing entire masterpage in asp.net ...
Nikhil Kothari's Weblog : UpdateControls: UpdateHistory and ... it's so coooooooool.. but not use masterpage ..i'm trying so many ..but fail. ... and the OnNavigated event would not fire properly either. ...
Extension talk:FlaggedRevs - MediaWiki I create the masterpage and the sub page, and transclude the sub page in the master page, .... [edit] FlaggedRevs class not found in updateAutoPromote.php ...
sanjeev.net For instance, contrary to popular belief not all years divisible by 4 are leap years. .... Every MasterPage should include at least one ContentPlaceHolder, ...
QBS Software Limited Error occuring while printing the Grid, when it is in master page, has been fixed. ... Styles which were not properly applied for GroupIndentCell, ...
FreeTextBox NET 2.0 version now included (not Beta 1 or 2); BUG: fixed problems when FreeTextBox was in a INamingContainer (such as a MasterPage or DataGrid) ...




Search This Site:










creating sitemap automatically?

need help on the master pages.

master pages ?

navigation objects [not impressed]

linked sitemaps

moving gif images stop moving

treeview collapse and expand ...question

changes to css not updating page styles

themes and tables

problem in using treeview

using usercontrols in a masterpage

trouble using javascript with masterpages/content pages

treeview problems (asp.net 2.0)

assignling multiple labels in skins

help with stopping access to previous page via browser back button

adding hyperlinks/content to the master page

problem with aps.net 2.0 master page. id's?

master pages and server control id/formname - asp.net 2.0

change in master page property is not persisting to other pages

problems with stylesheets in master pages...

unable to reach the menuitemclick event handler

loss of menu control on site

content page accessing master page controls?

order page events (with master & child)

master page login status not closing window onloggingout

multiplae layouts and custom web user controls

dynamically create sitemap for each user - help please

showing loggin status in menu control

how to build master webcontrol

accessing contentplaceholderid from master page codebehind

  Privacy | Contact Us
All Times Are GMT