Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > PostBack problem

Reply
Thread Tools

PostBack problem

 
 
Daniel Groh
Guest
Posts: n/a
 
      06-09-2005
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


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      06-09-2005
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
>




 
Reply With Quote
 
 
 
 
Daniel Groh
Guest
Posts: n/a
 
      06-09-2005
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" <(E-Mail Removed)> escreveu na mensagem
news:(E-Mail Removed) ...
> 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
>>

>
>
>



 
Reply With Quote
 
willow
Guest
Posts: n/a
 
      06-10-2005
I think Brock is right,may be you should describe your problem from the
first,may be you another idea is wrong.
"Daniel Groh" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
societopia.net
Guest
Posts: n/a
 
      06-10-2005
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



"Daniel Groh" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> escreveu na mensagem
> news:(E-Mail Removed) ...
> > 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
> >>

> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using callback, I fill dorpdownlist without postback but it gets empty when a postback is executed Fabio Mastria ASP .Net 5 01-30-2008 09:07 PM
ShowDialogModal postback on close (this is not related to multiple dialogs opening upon postback) Jacky Chau ASP .Net 2 06-08-2005 05:49 PM
Can I raise a postback ? Session variable only visible after postback. Please help gce ASP .Net 2 05-08-2005 05:55 AM
Postback not being set to True on first postback =?Utf-8?B?Q2hhZA==?= ASP .Net 2 04-04-2005 06:17 PM
effecting postback without auto postback controls Psych971 ASP .Net 5 12-17-2004 08:53 PM



Advertisments