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. How can I get Page PreRender to work?

How can I get Page PreRender to work?

Scheduled Pinned Locked Moved ASP.NET
questiondebuggingtutorial
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.
  • D Offline
    D Offline
    davebarkshire
    wrote on last edited by
    #1

    Maybe I'm going mad but I just can't get the PreRender method to fire on a web page. I'm using VS2005 and have created a blank website and have right clicked on the default.aspx page and selected 'View Component Designer' and from there selected the thunderbolt and double clicked PreRender. This created the PreRender method in the 'code behind' and also hooked it up in the InitializeComponent method. If I just put a simple statement in the PreRender method to set the value of a label for example it does not fire. Also, if I put a debug mark in the PreRender method it does not fire. What's going on?

    A 1 Reply Last reply
    0
    • D davebarkshire

      Maybe I'm going mad but I just can't get the PreRender method to fire on a web page. I'm using VS2005 and have created a blank website and have right clicked on the default.aspx page and selected 'View Component Designer' and from there selected the thunderbolt and double clicked PreRender. This created the PreRender method in the 'code behind' and also hooked it up in the InitializeComponent method. If I just put a simple statement in the PreRender method to set the value of a label for example it does not fire. Also, if I put a debug mark in the PreRender method it does not fire. What's going on?

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      it's working Fine. :)

       protected void Page_PreRender(object sender, EventArgs e)
          {
            
              Button1.Text = "Hi Abhijit";
          }
      

      cheers, Abhijit

      D 1 Reply Last reply
      0
      • A Abhijit Jana

        it's working Fine. :)

         protected void Page_PreRender(object sender, EventArgs e)
            {
              
                Button1.Text = "Hi Abhijit";
            }
        

        cheers, Abhijit

        D Offline
        D Offline
        davebarkshire
        wrote on last edited by
        #3

        I have the same signature but it still isn't firing. This is the code in my page.

        private void InitializeComponent()
        {
            this.PreRender += new System.EventHandler(this.\_Default\_PreRender);
        
        }
        
        private void \_Default\_PreRender(object sender, EventArgs e)
        {
            Label1.Text = "hi";
        }
        
        N 1 Reply Last reply
        0
        • D davebarkshire

          I have the same signature but it still isn't firing. This is the code in my page.

          private void InitializeComponent()
          {
              this.PreRender += new System.EventHandler(this.\_Default\_PreRender);
          
          }
          
          private void \_Default\_PreRender(object sender, EventArgs e)
          {
              Label1.Text = "hi";
          }
          
          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          Are you on ASP.NET 1.1 ? From where this InitializeComponent() is getting called ?

          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

          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