GridView in UpdatePanel only Updates once

Discussion in 'ASP .Net' started by Nick, Oct 23, 2008.

  1. Nick

    Nick Guest

    Hi there,

    I have a GridView in an UpdatePanel, each time the UpdatePanels Load
    event fires I set the DataSource and call DataBind of the grid view. This
    works great once, I add an item to the list and the control updates, my
    breakpoints get in in the UpdatePanel Load event. Only problem is on the
    second time, even though the code is executed, the GridView doesn't change.
    I have disabled the view state for the grid view but still the problem
    persists.

    So just to clarify, when the page loads, the grid view always displays
    the correct items, when the update panel is refreshed for the first time it
    displays the new items, the second time it stays the same.

    Any ideas what I'm missing?

    Nick.
    Nick, Oct 23, 2008
    #1
    1. Advertising

  2. Nick

    Nick Guest

    I should also mention that this all occurs inside of a UserControl.

    "Nick" <> wrote in message
    news:...
    > Hi there,
    >
    > I have a GridView in an UpdatePanel, each time the UpdatePanels Load
    > event fires I set the DataSource and call DataBind of the grid view. This
    > works great once, I add an item to the list and the control updates, my
    > breakpoints get in in the UpdatePanel Load event. Only problem is on the
    > second time, even though the code is executed, the GridView doesn't
    > change. I have disabled the view state for the grid view but still the
    > problem persists.
    >
    > So just to clarify, when the page loads, the grid view always displays
    > the correct items, when the update panel is refreshed for the first time
    > it displays the new items, the second time it stays the same.
    >
    > Any ideas what I'm missing?
    >
    > Nick.
    >
    Nick, Oct 23, 2008
    #2
    1. Advertising

  3. What oblect is the data source?

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


    "Nick" <> wrote in message
    news:...
    > Hi there,
    >
    > I have a GridView in an UpdatePanel, each time the UpdatePanels Load
    > event fires I set the DataSource and call DataBind of the grid view. This
    > works great once, I add an item to the list and the control updates, my
    > breakpoints get in in the UpdatePanel Load event. Only problem is on the
    > second time, even though the code is executed, the GridView doesn't
    > change. I have disabled the view state for the grid view but still the
    > problem persists.
    >
    > So just to clarify, when the page loads, the grid view always displays
    > the correct items, when the update panel is refreshed for the first time
    > it displays the new items, the second time it stays the same.
    >
    > Any ideas what I'm missing?
    >
    > Nick.
    >
    Eliyahu Goldin, Oct 23, 2008
    #3
  4. Nick

    Nick Guest

    It's a List<> containing a class that has 2 string properties, nothing else.

    "Eliyahu Goldin" <> wrote in
    message news:...
    > What oblect is the data source?
    >
    > --
    > Eliyahu Goldin,
    > Software Developer
    > Microsoft MVP [ASP.NET]
    > http://msmvps.com/blogs/egoldin
    > http://usableasp.net
    >
    >
    > "Nick" <> wrote in message
    > news:...
    >> Hi there,
    >>
    >> I have a GridView in an UpdatePanel, each time the UpdatePanels Load
    >> event fires I set the DataSource and call DataBind of the grid view.
    >> This works great once, I add an item to the list and the control updates,
    >> my breakpoints get in in the UpdatePanel Load event. Only problem is on
    >> the second time, even though the code is executed, the GridView doesn't
    >> change. I have disabled the view state for the grid view but still the
    >> problem persists.
    >>
    >> So just to clarify, when the page loads, the grid view always displays
    >> the correct items, when the update panel is refreshed for the first time
    >> it displays the new items, the second time it stays the same.
    >>
    >> Any ideas what I'm missing?
    >>
    >> Nick.
    >>

    >
    >
    Nick, Oct 23, 2008
    #4
  5. Nick

    Nick Guest

    btw, I can step through the code, the list is definitely changing, but the
    gridview isn't.

    "Eliyahu Goldin" <> wrote in
    message news:...
    > What oblect is the data source?
    >
    > --
    > Eliyahu Goldin,
    > Software Developer
    > Microsoft MVP [ASP.NET]
    > http://msmvps.com/blogs/egoldin
    > http://usableasp.net
    >
    >
    > "Nick" <> wrote in message
    > news:...
    >> Hi there,
    >>
    >> I have a GridView in an UpdatePanel, each time the UpdatePanels Load
    >> event fires I set the DataSource and call DataBind of the grid view.
    >> This works great once, I add an item to the list and the control updates,
    >> my breakpoints get in in the UpdatePanel Load event. Only problem is on
    >> the second time, even though the code is executed, the GridView doesn't
    >> change. I have disabled the view state for the grid view but still the
    >> problem persists.
    >>
    >> So just to clarify, when the page loads, the grid view always displays
    >> the correct items, when the update panel is refreshed for the first time
    >> it displays the new items, the second time it stays the same.
    >>
    >> Any ideas what I'm missing?
    >>
    >> Nick.
    >>

    >
    >
    Nick, Oct 23, 2008
    #5
  6. Nick

    Nick Guest

    How strange...

    Just to complicate matters, I have just uploaded a build to the server and
    it works fine. But locally it doesn't work... :-\

    Any ideas what could cause that?

    Nick.

    "Eliyahu Goldin" <> wrote in
    message news:...
    > What oblect is the data source?
    >
    > --
    > Eliyahu Goldin,
    > Software Developer
    > Microsoft MVP [ASP.NET]
    > http://msmvps.com/blogs/egoldin
    > http://usableasp.net
    >
    >
    > "Nick" <> wrote in message
    > news:...
    >> Hi there,
    >>
    >> I have a GridView in an UpdatePanel, each time the UpdatePanels Load
    >> event fires I set the DataSource and call DataBind of the grid view.
    >> This works great once, I add an item to the list and the control updates,
    >> my breakpoints get in in the UpdatePanel Load event. Only problem is on
    >> the second time, even though the code is executed, the GridView doesn't
    >> change. I have disabled the view state for the grid view but still the
    >> problem persists.
    >>
    >> So just to clarify, when the page loads, the grid view always displays
    >> the correct items, when the update panel is refreshed for the first time
    >> it displays the new items, the second time it stays the same.
    >>
    >> Any ideas what I'm missing?
    >>
    >> Nick.
    >>

    >
    >
    Nick, Oct 23, 2008
    #6
  7. Hi Nick,

    From your description it's really very strange. I could not think of any
    possible reasons for now .Could you send me a demo project that can
    reproduce this problem? I'll try it to see if I can repro it on my side. My
    email is .

    To investigate this issue, I also need following information:

    1. Are the server and the development machine two machines or the same one?
    2. Do you test the page on the same client machine and in the same explorer?
    3. Please provide the operating system, IE version, IIS version and Visual
    Studio edition.

    Regards,
    Allen Chen
    Microsoft Online Support

    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.



    --------------------
    | From: "Nick" <>
    | References: <>
    <>
    | Subject: Re: GridView in UpdatePanel only Updates once
    | Date: Thu, 23 Oct 2008 14:06:53 +0100
    | Lines: 45
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
    | X-RFC2646: Format=Flowed; Response
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
    | Message-ID: <uU$>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: 5ac439a6.bb.sky.com 90.196.57.166
    | Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
    | Xref: TK2MSFTNGHUB02.phx.gbl
    microsoft.public.dotnet.framework.aspnet:78466
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | How strange...
    |
    | Just to complicate matters, I have just uploaded a build to the server
    and
    | it works fine. But locally it doesn't work... :-\
    |
    | Any ideas what could cause that?
    |
    | Nick.
    |
    | "Eliyahu Goldin" <> wrote in
    | message news:...
    | > What oblect is the data source?
    | >
    | > --
    | > Eliyahu Goldin,
    | > Software Developer
    | > Microsoft MVP [ASP.NET]
    | > http://msmvps.com/blogs/egoldin
    | > http://usableasp.net
    | >
    | >
    | > "Nick" <> wrote in message
    | > news:...
    | >> Hi there,
    | >>
    | >> I have a GridView in an UpdatePanel, each time the UpdatePanels
    Load
    | >> event fires I set the DataSource and call DataBind of the grid view.
    | >> This works great once, I add an item to the list and the control
    updates,
    | >> my breakpoints get in in the UpdatePanel Load event. Only problem is
    on
    | >> the second time, even though the code is executed, the GridView
    doesn't
    | >> change. I have disabled the view state for the grid view but still the
    | >> problem persists.
    | >>
    | >> So just to clarify, when the page loads, the grid view always
    displays
    | >> the correct items, when the update panel is refreshed for the first
    time
    | >> it displays the new items, the second time it stays the same.
    | >>
    | >> Any ideas what I'm missing?
    | >>
    | >> Nick.
    | >>
    | >
    | >
    |
    |
    |
    Allen Chen [MSFT], Oct 24, 2008
    #7
  8. Nick

    Nick Guest

    Hi Allen,

    Unfortunately I cannot send an isolated project as the code is part of a
    much larger solution, and I do not have the time to create a separate
    project. On the other hand, I have identified a possible cause of the
    problem as a 3rd party Ajax control currently on the same page is generating
    a script error that I hadn't noticed. I am trying to get this script error
    resolved before I proceed further.

    At current, the Update Panel seems to be acting irratically, sometimes
    it updates, sometimes it doesn't, and this is on the live server. I thought
    it was working perfect to start with but unfortunately this is not the case.
    If the problem persists after resolving this script issue I shall contact
    yourself via the email provided and show you a live demo of the problem
    occuring.

    Thanks a million for your time and help it's much appreciated.

    Nick.

    "Allen Chen [MSFT]" <> wrote in message
    news:...
    > Hi Nick,
    >
    > From your description it's really very strange. I could not think of any
    > possible reasons for now .Could you send me a demo project that can
    > reproduce this problem? I'll try it to see if I can repro it on my side.
    > My
    > email is .
    >
    > To investigate this issue, I also need following information:
    >
    > 1. Are the server and the development machine two machines or the same
    > one?
    > 2. Do you test the page on the same client machine and in the same
    > explorer?
    > 3. Please provide the operating system, IE version, IIS version and Visual
    > Studio edition.
    >
    > Regards,
    > Allen Chen
    > Microsoft Online Support
    >
    > Delighting our customers is our #1 priority. We welcome your comments and
    > suggestions about how we can improve the support we provide to you. Please
    > feel free to let my manager know what you think of the level of service
    > provided. You can send feedback directly to my manager at:
    > .
    >
    > ==================================================
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
    > ==================================================
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    >
    >
    > --------------------
    > | From: "Nick" <>
    > | References: <>
    > <>
    > | Subject: Re: GridView in UpdatePanel only Updates once
    > | Date: Thu, 23 Oct 2008 14:06:53 +0100
    > | Lines: 45
    > | X-Priority: 3
    > | X-MSMail-Priority: Normal
    > | X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
    > | X-RFC2646: Format=Flowed; Response
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
    > | Message-ID: <uU$>
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    > | NNTP-Posting-Host: 5ac439a6.bb.sky.com 90.196.57.166
    > | Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
    > | Xref: TK2MSFTNGHUB02.phx.gbl
    > microsoft.public.dotnet.framework.aspnet:78466
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > |
    > | How strange...
    > |
    > | Just to complicate matters, I have just uploaded a build to the server
    > and
    > | it works fine. But locally it doesn't work... :-\
    > |
    > | Any ideas what could cause that?
    > |
    > | Nick.
    > |
    > | "Eliyahu Goldin" <> wrote in
    > | message news:...
    > | > What oblect is the data source?
    > | >
    > | > --
    > | > Eliyahu Goldin,
    > | > Software Developer
    > | > Microsoft MVP [ASP.NET]
    > | > http://msmvps.com/blogs/egoldin
    > | > http://usableasp.net
    > | >
    > | >
    > | > "Nick" <> wrote in message
    > | > news:...
    > | >> Hi there,
    > | >>
    > | >> I have a GridView in an UpdatePanel, each time the UpdatePanels
    > Load
    > | >> event fires I set the DataSource and call DataBind of the grid view.
    > | >> This works great once, I add an item to the list and the control
    > updates,
    > | >> my breakpoints get in in the UpdatePanel Load event. Only problem is
    > on
    > | >> the second time, even though the code is executed, the GridView
    > doesn't
    > | >> change. I have disabled the view state for the grid view but still
    > the
    > | >> problem persists.
    > | >>
    > | >> So just to clarify, when the page loads, the grid view always
    > displays
    > | >> the correct items, when the update panel is refreshed for the first
    > time
    > | >> it displays the new items, the second time it stays the same.
    > | >>
    > | >> Any ideas what I'm missing?
    > | >>
    > | >> Nick.
    > | >>
    > | >
    > | >
    > |
    > |
    > |
    >
    Nick, Oct 24, 2008
    #8
  9. Nick

    Nick Guest

    Hi again Allen,

    Thankfully I have recieved a new build of the 3rd party ajax controls
    causing the script error and this has resolved all issues. Hurrah.

    Cheers again for your help.

    Nick.

    "Nick" <> wrote in message
    news:...
    > Hi Allen,
    >
    > Unfortunately I cannot send an isolated project as the code is part of a
    > much larger solution, and I do not have the time to create a separate
    > project. On the other hand, I have identified a possible cause of the
    > problem as a 3rd party Ajax control currently on the same page is
    > generating a script error that I hadn't noticed. I am trying to get this
    > script error resolved before I proceed further.
    >
    > At current, the Update Panel seems to be acting irratically, sometimes
    > it updates, sometimes it doesn't, and this is on the live server. I
    > thought it was working perfect to start with but unfortunately this is not
    > the case. If the problem persists after resolving this script issue I
    > shall contact yourself via the email provided and show you a live demo of
    > the problem occuring.
    >
    > Thanks a million for your time and help it's much appreciated.
    >
    > Nick.
    >
    > "Allen Chen [MSFT]" <> wrote in message
    > news:...
    >> Hi Nick,
    >>
    >> From your description it's really very strange. I could not think of any
    >> possible reasons for now .Could you send me a demo project that can
    >> reproduce this problem? I'll try it to see if I can repro it on my side.
    >> My
    >> email is .
    >>
    >> To investigate this issue, I also need following information:
    >>
    >> 1. Are the server and the development machine two machines or the same
    >> one?
    >> 2. Do you test the page on the same client machine and in the same
    >> explorer?
    >> 3. Please provide the operating system, IE version, IIS version and
    >> Visual
    >> Studio edition.
    >>
    >> Regards,
    >> Allen Chen
    >> Microsoft Online Support
    >>
    >> Delighting our customers is our #1 priority. We welcome your comments and
    >> suggestions about how we can improve the support we provide to you.
    >> Please
    >> feel free to let my manager know what you think of the level of service
    >> provided. You can send feedback directly to my manager at:
    >> .
    >>
    >> ==================================================
    >> Get notification to my posts through email? Please refer to
    >> http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
    >>
    >> Note: The MSDN Managed Newsgroup support offering is for non-urgent
    >> issues
    >> where an initial response from the community or a Microsoft Support
    >> Engineer within 1 business day is acceptable. Please note that each
    >> follow
    >> up response may take approximately 2 business days as the support
    >> professional working with you may need further investigation to reach the
    >> most efficient resolution. The offering is not appropriate for situations
    >> that require urgent, real-time or phone-based interactions or complex
    >> project analysis and dump analysis issues. Issues of this nature are best
    >> handled working with a dedicated Microsoft Support Engineer by contacting
    >> Microsoft Customer Support Services (CSS) at
    >> http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
    >> ==================================================
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >>
    >>
    >>
    >> --------------------
    >> | From: "Nick" <>
    >> | References: <>
    >> <>
    >> | Subject: Re: GridView in UpdatePanel only Updates once
    >> | Date: Thu, 23 Oct 2008 14:06:53 +0100
    >> | Lines: 45
    >> | X-Priority: 3
    >> | X-MSMail-Priority: Normal
    >> | X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
    >> | X-RFC2646: Format=Flowed; Response
    >> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
    >> | Message-ID: <uU$>
    >> | Newsgroups: microsoft.public.dotnet.framework.aspnet
    >> | NNTP-Posting-Host: 5ac439a6.bb.sky.com 90.196.57.166
    >> | Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
    >> | Xref: TK2MSFTNGHUB02.phx.gbl
    >> microsoft.public.dotnet.framework.aspnet:78466
    >> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >> |
    >> | How strange...
    >> |
    >> | Just to complicate matters, I have just uploaded a build to the server
    >> and
    >> | it works fine. But locally it doesn't work... :-\
    >> |
    >> | Any ideas what could cause that?
    >> |
    >> | Nick.
    >> |
    >> | "Eliyahu Goldin" <> wrote in
    >> | message news:...
    >> | > What oblect is the data source?
    >> | >
    >> | > --
    >> | > Eliyahu Goldin,
    >> | > Software Developer
    >> | > Microsoft MVP [ASP.NET]
    >> | > http://msmvps.com/blogs/egoldin
    >> | > http://usableasp.net
    >> | >
    >> | >
    >> | > "Nick" <> wrote in message
    >> | > news:...
    >> | >> Hi there,
    >> | >>
    >> | >> I have a GridView in an UpdatePanel, each time the UpdatePanels
    >> Load
    >> | >> event fires I set the DataSource and call DataBind of the grid view.
    >> | >> This works great once, I add an item to the list and the control
    >> updates,
    >> | >> my breakpoints get in in the UpdatePanel Load event. Only problem
    >> is
    >> on
    >> | >> the second time, even though the code is executed, the GridView
    >> doesn't
    >> | >> change. I have disabled the view state for the grid view but still
    >> the
    >> | >> problem persists.
    >> | >>
    >> | >> So just to clarify, when the page loads, the grid view always
    >> displays
    >> | >> the correct items, when the update panel is refreshed for the first
    >> time
    >> | >> it displays the new items, the second time it stays the same.
    >> | >>
    >> | >> Any ideas what I'm missing?
    >> | >>
    >> | >> Nick.
    >> | >>
    >> | >
    >> | >
    >> |
    >> |
    >> |
    >>

    >
    >
    Nick, Oct 24, 2008
    #9
    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. Replies:
    3
    Views:
    473
    Rob Meade
    Aug 8, 2007
  2. DC
    Replies:
    2
    Views:
    657
  3. Scott M

    UpdatePanel only updates once

    Scott M, Jan 13, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    3,015
    Scott M
    Jan 14, 2009
  4. Scott M

    UpdatePanel only updates once

    Scott M, Jan 13, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    349
    Scott M
    Jan 13, 2009
  5. Nathan Sokalski
    Replies:
    1
    Views:
    577
    miher
    Jun 15, 2009
Loading...

Share This Page