Home All Groups Group Topic Archive Search About
Author
9 Jun 2005 11:12 PM
Daniel Groh
I have two controls in my webform, BUT....one comes from a user control and
the other comes from another user control, both with post back!
How can i work just with one PostBack ?

if(PostPack from button2){ //How can i accomplish that correctly ?
    do nothing  //Just do with post back of button1
}

Thanks in advance

Author
9 Jun 2005 11:19 PM
Brock Allen
If you just want to be notified when your button was clicked (not the UC's
button) then simply handle your Button's Click event. It won't get called
if another button (the UC's button) is what causes the postback.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> I have two controls in my webform, BUT....one comes from a user
> control and
> the other comes from another user control, both with post back!
> How can i work just with one PostBack ?
> if(PostPack from button2){ //How can i accomplish that correctly ?
> do nothing  //Just do with post back of button1
> }
> Thanks in advance
>
Are all your drivers up to date? click for free checkup

Author
9 Jun 2005 11:30 PM
Daniel Groh
Hi,
That's not the problem, the problem is 'cause i have a button that exec an
insert in my database and the other (a checkbox) is for another kind of
execution...but the problem is: When i click in my checkbox, it try to
execute the insert...understood ?

So u ask: "Why you don't accomplish yours executions in the events and not
in the pageload?"

I can't...i need all in my pageload...i have somethings in my pageload that
i can not change, so i need to todo both the events in my pageload!

Show quoteHide quote
"Brock Allen" <ballen@NOSPAMdevelop.com> escreveu na mensagem
news:864820632539415935627120@msnews.microsoft.com...
> If you just want to be notified when your button was clicked (not the UC's
> button) then simply handle your Button's Click event. It won't get called
> if another button (the UC's button) is what causes the postback.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>> I have two controls in my webform, BUT....one comes from a user
>> control and
>> the other comes from another user control, both with post back!
>> How can i work just with one PostBack ?
>> if(PostPack from button2){ //How can i accomplish that correctly ?
>> do nothing  //Just do with post back of button1
>> }
>> Thanks in advance
>>
>
>
>
Author
10 Jun 2005 3:46 AM
societopia.net
If you were to move all of the code that you have in the Page_Load into
another method (e.g. MyFunction) , then you would have been able to call
MyFunction from both the Page_Load (if Not Page.IsPostBack) and from the
event (If Page.IsPostBack).  This would give you the advantage of passing a
parameter to MyFunction that identifies that the control that caused the
postback.

---
http://www.societopia.net
http://www.webswapp.com



Show quoteHide quote
"Daniel Groh" <newsgrou***@gmail.com> wrote in message
news:%23RUgxsUbFHA.3912@TK2MSFTNGP15.phx.gbl...
> Hi,
> That's not the problem, the problem is 'cause i have a button that exec an
> insert in my database and the other (a checkbox) is for another kind of
> execution...but the problem is: When i click in my checkbox, it try to
> execute the insert...understood ?
>
> So u ask: "Why you don't accomplish yours executions in the events and not
> in the pageload?"
>
> I can't...i need all in my pageload...i have somethings in my pageload
that
> i can not change, so i need to todo both the events in my pageload!
>
> "Brock Allen" <ballen@NOSPAMdevelop.com> escreveu na mensagem
> news:864820632539415935627120@msnews.microsoft.com...
> > If you just want to be notified when your button was clicked (not the
UC's
> > button) then simply handle your Button's Click event. It won't get
called
> > if another button (the UC's button) is what causes the postback.
> > -Brock
> > DevelopMentor
> > http://staff.develop.com/ballen
> >
> >
> >
> >> I have two controls in my webform, BUT....one comes from a user
> >> control and
> >> the other comes from another user control, both with post back!
> >> How can i work just with one PostBack ?
> >> if(PostPack from button2){ //How can i accomplish that correctly ?
> >> do nothing  //Just do with post back of button1
> >> }
> >> Thanks in advance
> >>
> >
> >
> >
>
>
Author
10 Jun 2005 1:22 AM
willow
I think Brock is right,may be you should describe your problem from the
first,may be you another idea is wrong.
Show quoteHide quote
"Daniel Groh" <newsgrou***@gmail.com> wrote in message
news:#GlGoiUbFHA.1040@TK2MSFTNGP10.phx.gbl...
> I have two controls in my webform, BUT....one comes from a user control
and
> the other comes from another user control, both with post back!
> How can i work just with one PostBack ?
>
> if(PostPack from button2){ //How can i accomplish that correctly ?
>     do nothing  //Just do with post back of button1
> }
>
> Thanks in advance
>
>

Bookmark and Share