<> wrote in message
news:e95d663c-eca9-42d4-b69f-...
> I noticed that when I click the button, CODE1 executes and after
> that CODE2 executes.
That's correct - that's exactly how it's supposed to work...
> Here is the problem, I dont want to execute CODE1 but only CODE2 [and
> I dont want to use isPostBack].
??? Why on earth don't you want to use IsPostback...??? It's designed
precisely for this...
> I thik that the best way is getting name or id of the clicked button.
That is *entirely* the wrong approach... ASP.NET, like all of .NET, is
object-orientated, not linear...
There are ways to find out the name of the object which initiated the
postback, but there is no real need to know this...
Basically, the Page_xxx methods fire every time a page loads regardless of
how it loads. You use the IsPostback check to determine when the code runs
in these methods.
I suggest you get a copy of this:
http://www.amazon.com/ASP-NET-3-5-Du...2638096&sr=8-4
and work through it from beginning to end...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net