Groups | Blog | Home
all groups > asp.net webcontrols > november 2004 >

asp.net webcontrols : Urgent (please help): Post-back problem


Amir
11/30/2004 12:41:03 AM
Hello every one
My problem is very clear but crazy.
I have a DataRepeater in my page that I have made the paging mechanisem for
it with a user control. This user control contains a Repeater too. Let's call
this control Paging Control.

The Paging control provide some links for paging.
When I click the links, It post-back and fill the main repeater in the page.

It looks the paging repeater dosen't postback. When I click on the links
that have generated in paging control, page dosen't poskback and the related
event handler dose not get executes. so the main repeater remain empty.
Because I fill the main repeater again in these links' event handler.

I think there is some problems in client-side script that .NET Framework
generates.
Please help me.
It's urgent for me to solve this problem.

Thanks in advance
Leon Friesema
11/30/2004 2:12:49 PM
On Tue, 30 Nov 2004 00:41:03 -0800, "Amir"
[quoted text, click to view]

Is AutoPostBack True?
Other then that, post some code.

Amir
12/1/2004 6:55:04 PM
Thnks a lot for your response Leon
But there is not such property (AutoPostBack) in DataRepeater..
I think It's a problem in generated Javascript.
This is another sample for the problem.

A usercontrol that contains a Repeater and a linkbutton.
The repeater itself contains 2 link button.

When click the button, it postback and execute page_load and then it's click
event handler.
When click the the repeater's linkbutton, it postback and only execute
page_load. It can not find and don't execute the repeater's ItemCommand Event
handler.

Regards,
Amir

[quoted text, click to view]
Leon Friesema
12/2/2004 2:24:52 PM
On Wed, 1 Dec 2004 18:55:04 -0800, "Amir"
[quoted text, click to view]


[quoted text, click to view]

Uhm.. you're not refreshing your data (in other words: rebinding your
dataset) on Postback are you? In that case the click event will never
fire. Furthermore you should handle the click-event for the button not
in a specific event for the buttons itself but in the ItemCommand for
the repeater (use a CommandArgument to distinguish the different rows
if needed), because; let's say you got two rows, with each two
buttons, so a row1.button1, row1.button2, row2.button1, row2.button2
and you click button1 --> which in that case should go to
button1_click. From which row was it clicked? Use ItemCommand!

Amir
12/2/2004 6:09:04 PM
I'm using ItemCommand and CommandArgument ...
When I trace the code execution,I see that when I click the generated
LinkButton, It make postback and execute the Page_Load event handler, but
dose not find the ItemCommand event Handler.
The generated javascript code for the generated LinkButton in the repeater
is like this:


href="javascript:{if (typeof(Page_ClientValidate) != 'function' ||
Page_ClientValidate())
__doPostBack('Issues_Pager$Repeater1$_ctl1$LinkButton1','')} "


Amir

[quoted text, click to view]
AddThis Social Bookmark Button