i wasnt clear so i am asking again:i have aspx page with user control inside it's form.the control has button that do postbacki want to activate a function in the control only when the submit in the aspxpage is fired.if i will activate the function in the control page.isPostBack it will fire alsowhen the control button is clicked.in other words - in the control code behind :if page.isPostBack then'want to know if the post back came from the aspx or from the button in thecontrol
Why don't you just call control's public method from aspx page inSubmitButton_Click even handler? Make a public method in the control's class andcall it.
yes.i can do that , but i prefer that the function will activateautomatically when the submit is clicked.
try making a delegate and an event on the page and make a handler in thecontrol. I don't know it that would work, but it could. Normaly it'svice-a-versa but maybe the other way arround could also work.BTW. Method would be called automaticly if you do the way I said before. In anyway you'd have to call an event handler... Nothing happens automaticly. there'salways the code to tell it what to do. But if you do it the ways I just said(event on a page) you don't have to take care of the controls on the page. Youjust take care that you make a handler in the control. And page "automaticly"calls delegates...
when i do :
If Page.IsPostBack ThenResponse.Write("ggg")End If
ok.i put it inSubmitButton_Click even handlerand it's working ok.