Urgent (please help): Post-back problem

Discussion in 'ASP .Net Web Controls' started by Amir, Nov 30, 2004.

  1. Amir

    Amir Guest

    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
    Amir
     
    Amir, Nov 30, 2004
    #1
    1. Advertising

  2. Amir

    Amir Guest

    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

    "Leon Friesema" wrote:

    > On Tue, 30 Nov 2004 00:41:03 -0800, "Amir"
    > <> wrote:
    >
    > >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
    > >Amir

    >
    > Is AutoPostBack True?
    > Other then that, post some code.
    >
    > Leon.
    >
     
    Amir, Dec 2, 2004
    #2
    1. Advertising

  3. Amir

    Amir Guest

    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

    "Leon Friesema" wrote:

    > On Wed, 1 Dec 2004 18:55:04 -0800, "Amir"
    > <> wrote:
    >
    >
    > >
    > >"Leon Friesema" wrote:
    > >
    > >> On Tue, 30 Nov 2004 00:41:03 -0800, "Amir"
    > >> <> wrote:
    > >>
    > >> >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
    > >> >Amir
    > >>
    > >> Is AutoPostBack True?
    > >> Other then that, post some code.
    > >>
    > >> Leon.
    > >>

    > >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

    >
    > 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!
    >
    > Leon.
    >
     
    Amir, Dec 3, 2004
    #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. Chris
    Replies:
    1
    Views:
    338
    Ashish
    Apr 15, 2004
  2. Joby
    Replies:
    0
    Views:
    1,639
  3. Aliandro
    Replies:
    1
    Views:
    746
    Martin Honnen
    Feb 2, 2005
  4. KK
    Replies:
    2
    Views:
    596
    Big Brian
    Oct 14, 2003
  5. =?Utf-8?B?Z29yaWxsYQ==?=
    Replies:
    1
    Views:
    775
    Masudur
    May 25, 2007
Loading...

Share This Page