• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 471
  • Last Modified:

detecting postback in a server control

i've build a custom server control which inherits from webcontrol. inside it i have serveral check boxes which does a autopostback. I have some common functionality that should be triggered on a postback regardless of which control that fired it. so my question is this. how can I detect a postback in the server control in the same way as i would use page.ispostback if i was outside the server control.
0
oslonet
Asked:
oslonet
  • 2
  • 2
1 Solution
 
McExpCommented:
you can still use IsPostback in the Page_Load event of custom control
0
 
oslonetAuthor Commented:
how do i access this inside the custom server control. i tried adding:

protected void Page_Load(object sender, EventArgs e)
        {

        }

however this function was never accessed on runtime
0
 
McExpCommented:
The event you are searching for is:-
        protected override void OnLoad(EventArgs e)
        {
           //Code here          
        }
0
 
oslonetAuthor Commented:
thank you that worked just perfect :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now