Working with repeaters without Viewstate

V

Vijay

Hi,

I am working on an Asp.net 2.0 web application that uses master pages,
according to our application architecture we should not use Viewstate. Is
there a work around to raise the events fired from the child controls of
repeater when viewstate is disabled?

The scenario is as follows
I have a web page with a repeater that has controls on it, The viewstate is
disabled. The repeater is data bound to an arraylist in the page_load
event(in block if !ISPostback), so when the user requests the page for the
first time the repeater is populated. There is a button in the repeater
which is used to add another row. When this button is clicked the event will
not be fired on the server on postback. this is because the repeater itself
is databound in the page load when its not Postback.

This works fine if we enable viestate, does any one know whether there is a
work around for this? any help is highly appreciated

Thank you
Vj
 
E

Eliyahu Goldin

You can do it with a bit of client-side programming. Handle client-side
onclick event for the buttons to make a javascript call myForm.submit().
 
M

Michael Nemtsev

Hello Vijay,

V> I am working on an Asp.net 2.0 web application that uses master
V> pages, according to our application architecture we should not use
V> Viewstate. Is there a work around to raise the events fired from the
V> child controls of repeater when viewstate is disabled?

What if to use the ControlState to keep the info there, or it's the behaviour
by design not keep any client info?

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top