473,387 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

PostBack problem

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
Nov 19 '05 #1
4 1089
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


Nov 19 '05 #2
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" <ba****@NOSPAMdevelop.com> escreveu na mensagem
news:86**********************@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


Nov 19 '05 #3
I think Brock is right,may be you should describe your problem from the
first,may be you another idea is wrong.
"Daniel Groh" <ne*********@gmail.com> wrote in message
news:#G**************@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

Nov 19 '05 #4
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" <ne*********@gmail.com> wrote in message
news:%2****************@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" <ba****@NOSPAMdevelop.com> escreveu na mensagem
news:86**********************@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



Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Igor Belagorudsky | last post by:
Hi, i am trying to analyze data submitted in a form but the problem is that when i try to create the controls in code (which is what i want to do), it throws an obect not found exception on...
0
by: Xavier Osa | last post by:
Hi, I have an ASP.Net web page that you can download a file. As Fergunson's problem, it prompts twice dialog boxes only if I select Open button. If I select Save button, it prompts once. I'm...
1
by: Mad Scientist Jr | last post by:
I don't know how this is happening, but a dropdown control I have is resetting to the 2nd value on the list anytime a postback occurs. I have no initiation code outside of If Not (IsPostBack) ...
10
by: Krista Lemieux | last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with this technology. I've been told that when I have a control, I should only bind the data to it once, and not on each post back...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
6
by: | last post by:
Hi all, I have a bunch of dropdownlists that are populated in client-side javascript. When i do a postback I get the following error:- Invalid postback or callback argument. Event...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
1
by: Jason | last post by:
I have a webpage that I've wrapped in an Atlas UpdatePanel. This page contains four textboxes, each with AutoPostBack set to true. The problem comes when someone edits the first box and tabs to...
11
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
15
by: mc | last post by:
I'm writing an app for managing Task Lists, I'm trying to add some controls to a form that I can use to link tasks, my original intention was to: - Add two list boxes, one listing "all Tasks"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.