Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problems with Site.Master

Problems with Site.Master

Scheduled Pinned Locked Moved ASP.NET
csharphtmlasp-netdatabasepostgresql
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rick van Woudenberg
    wrote on last edited by
    #1

    Dear All, I'm pretty good with C# however I can't figure out ASP.NET with C#. It's not the C# bit that gives me headaches but the ASP stuff. I have the following problem. I've created an ASP website ( not entirely true, I used one of VS2010 templates ) and it's has login functionality. I'm using a Postgresql database in the backend and I can login fine. My Site.Master page got buttons in it, but I want a whole new series of buttons when the user has logged on correctly. I've created a new .aspx site that needs to load with a new Master Page. So I've created a new master page, called Site1.Master. It's pretty much the same as Site.Master but it allows me to use different buttons. But for some reason the login information is not display when this new page is loaded. Only after I hit 'F5' on my keyboard ( refresh ) it will show the info and the page works properly. Site.Master :

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="Urenboeken.SiteMaster" %>

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head runat="server">
    <title></title>

    </head>
    <body>
    <form runat="server">

                    KMO Urenboeken
    

    ====================================================

                \[ [Log In](~/Account/Login.aspx) \]
                    
                    Welcome !
                        \[ \]
    
    G R 2 Replies Last reply
    0
    • R Rick van Woudenberg

      Dear All, I'm pretty good with C# however I can't figure out ASP.NET with C#. It's not the C# bit that gives me headaches but the ASP stuff. I have the following problem. I've created an ASP website ( not entirely true, I used one of VS2010 templates ) and it's has login functionality. I'm using a Postgresql database in the backend and I can login fine. My Site.Master page got buttons in it, but I want a whole new series of buttons when the user has logged on correctly. I've created a new .aspx site that needs to load with a new Master Page. So I've created a new master page, called Site1.Master. It's pretty much the same as Site.Master but it allows me to use different buttons. But for some reason the login information is not display when this new page is loaded. Only after I hit 'F5' on my keyboard ( refresh ) it will show the info and the page works properly. Site.Master :

      <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="Urenboeken.SiteMaster" %>

      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
      <head runat="server">
      <title></title>

      </head>
      <body>
      <form runat="server">

                      KMO Urenboeken
      

      ====================================================

                  \[ [Log In](~/Account/Login.aspx) \]
                      
                      Welcome !
                          \[ \]
      
      G Offline
      G Offline
      GenJerDan
      wrote on last edited by
      #2

      Often, when a problem is "fixed" by a browser refresh, it's because of caching (in the browser or in the proxy). If the "new" page has the same name as the old page and the timestamp of the aspx itself hasn't changed (like it has a new master or CSS or something else external to it), the browser will just say to itself "I already have this in my cache. Not gonna bother downloading another copy." Yeah, okay, it's doing a HEAD before a GET, and if the HEAD isn't different from the last HEAD it got, it won't do anything. But that's a boring way to put it.

      Just like that old Carly Simon song... "You're so funny, You probably think this joke is about you" My Mu[sic] My Films My Windows Programs, etc.

      1 Reply Last reply
      0
      • R Rick van Woudenberg

        Dear All, I'm pretty good with C# however I can't figure out ASP.NET with C#. It's not the C# bit that gives me headaches but the ASP stuff. I have the following problem. I've created an ASP website ( not entirely true, I used one of VS2010 templates ) and it's has login functionality. I'm using a Postgresql database in the backend and I can login fine. My Site.Master page got buttons in it, but I want a whole new series of buttons when the user has logged on correctly. I've created a new .aspx site that needs to load with a new Master Page. So I've created a new master page, called Site1.Master. It's pretty much the same as Site.Master but it allows me to use different buttons. But for some reason the login information is not display when this new page is loaded. Only after I hit 'F5' on my keyboard ( refresh ) it will show the info and the page works properly. Site.Master :

        <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="Urenboeken.SiteMaster" %>

        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head runat="server">
        <title></title>

        </head>
        <body>
        <form runat="server">

                        KMO Urenboeken
        

        ====================================================

                    \[ [Log In](~/Account/Login.aspx) \]
                        
                        Welcome !
                            \[ \]
        
        R Offline
        R Offline
        RichardGrimmer
        wrote on last edited by
        #3

        I suspect that the issue is with the Server.Transfer - try swapping it out for a Response.Redirect.. Server.Transfer only (IIRC) changes the "context" on the server, so as far as the server's concerned, you're on that page, but as far as the client is concerned, you're still on the original page. Response.Redirect should keep the browser end in check too.

        C# has already designed away most of the tedium of C++.

        R 1 Reply Last reply
        0
        • R RichardGrimmer

          I suspect that the issue is with the Server.Transfer - try swapping it out for a Response.Redirect.. Server.Transfer only (IIRC) changes the "context" on the server, so as far as the server's concerned, you're on that page, but as far as the client is concerned, you're still on the original page. Response.Redirect should keep the browser end in check too.

          C# has already designed away most of the tedium of C++.

          R Offline
          R Offline
          Rick van Woudenberg
          wrote on last edited by
          #4

          Richard, Thank you for your reply. Response.Redirect fixed the problem. And also many thanks to GenJerDan for explaining to me what caused the issue in the first place. Kind regards,

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups