Working with repeaters without Viewstate

Discussion in 'ASP .Net' started by Vijay, Jul 4, 2007.

  1. Vijay

    Vijay Guest

    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
     
    Vijay, Jul 4, 2007
    #1
    1. Advertising

  2. 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().

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin


    "Vijay" <> wrote in message
    news:...
    > 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
    >
     
    Eliyahu Goldin, Jul 4, 2007
    #2
    1. Advertising

  3. 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
     
    Michael Nemtsev, Jul 5, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fresh Air Rider

    Checkboxes with Repeaters and DataGrids

    Fresh Air Rider, Mar 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    500
    Fresh Air Rider
    Mar 5, 2004
  2. Fraggle

    Catching buttons in repeaters

    Fraggle, Aug 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    354
    Fraggle
    Aug 1, 2003
  3. Mikael Engdahl

    Cascading repeaters

    Mikael Engdahl, Aug 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    587
    Ray Dixon [MVP]
    Aug 8, 2003
  4. Replies:
    1
    Views:
    687
    Karl Seguin
    Sep 1, 2005
  5. mark

    Viewstate errors... how do I get viewstate working?

    mark, Feb 20, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    299
Loading...

Share This Page