It does not look like you posted the actual code behind for the page here,
or is that an empty file? I see nothing wrong with the class file or the
ASP.NET tagged portion.

Signature
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
*************************************************
| Think outside the box!
*************************************************
> Hello,
>
[quoted text clipped - 42 lines]
> Thanks,
> Leszek
TarTar - 21 Aug 2007 15:34 GMT
Thanks Steve and Cowboy for the answers.
I agree - the ASP.NET code and C# code looks fine. There is also no code in
Page_Load. Yet, the GetCustomers() method is called twice when the page is
called first time. It looks like a built-in feature of ObjectDataSource (or
the DataList control?).
Whay is that? The code is very rudimentary - no parameters, no code in
Page_Load or any other event handler.
Thanks,
Leszek
> It does not look like you posted the actual code behind for the page here,
> or is that an empty file? I see nothing wrong with the class file or the
[quoted text clipped - 48 lines]
>> Thanks,
>> Leszek
TarTar - 24 Aug 2007 19:58 GMT
Problem solved - but it is the weirdest quirk of ASP.NET (or Visual Studio
and its built-in web server) I have met so far.
It turned out the cause was not the ObjectDataSource or any event handler
but the filename. When I renamed the file from Default.aspx to
Homepage.aspx, calls are not duplicated any more.
Leszek
> Thanks Steve and Cowboy for the answers.
>
[quoted text clipped - 61 lines]
>>> Thanks,
>>> Leszek
It sounds like the databinding is being called twice. Check your
Page_Load event to see if you're doing something like calling
Page.DataBind(), then DataList1.DataBind().
You also could have something in the Page_Load that causes it to re-load
the current page??
Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA
> Hello,
>
[quoted text clipped - 41 lines]
> Thanks,
> Leszek