Postback stops working

Discussion in 'ASP .Net' started by johnfinkle@yahoo.com, Aug 11, 2005.

  1. Guest

    I have a web application. I had several web form buttons and a
    datagrid. I cut and pasted some of the buttons to change the layout
    around, and also cut/pasted the datagrid to move it.

    Now when I click any of the buttons they do nothing.
    A hyperlink column in the datagrid which previously opened files now
    does nothing.

    I put a break point in one of the buttons and it worked normally.
    After I removed the breakpoint that button still works normally now,
    but the others do not. I was able to fix all the buttons
    functionality by putting in a breakpoint and then removing it.
    However, I can't break for the hyperlink and so I cannot figure out how
    to fix this.

    What is wrong? Why would it stop working when there has been no code
    changes? Fix?

    Thanks!
     
    , Aug 11, 2005
    #1
    1. Advertising

  2. John,

    check if the EventHandlers are associated with your code in the code behind
    file. For VB.NET you should see sth like:

    private sub Button1_Click(sender as object, e as eventargs) handles
    Button1.Click

    Tell me if this worked for you.

    Regards

    --
    ---------------------------------------
    Daniel Walzenbach
    MCP

    www.walzenbach.net



    <> schrieb im Newsbeitrag
    news:...
    >I have a web application. I had several web form buttons and a
    > datagrid. I cut and pasted some of the buttons to change the layout
    > around, and also cut/pasted the datagrid to move it.
    >
    > Now when I click any of the buttons they do nothing.
    > A hyperlink column in the datagrid which previously opened files now
    > does nothing.
    >
    > I put a break point in one of the buttons and it worked normally.
    > After I removed the breakpoint that button still works normally now,
    > but the others do not. I was able to fix all the buttons
    > functionality by putting in a breakpoint and then removing it.
    > However, I can't break for the hyperlink and so I cannot figure out how
    > to fix this.
    >
    > What is wrong? Why would it stop working when there has been no code
    > changes? Fix?
    >
    > Thanks!
    >
     
    Daniel Walzenbach, Aug 11, 2005
    #2
    1. Advertising

  3. rviray Guest

    I have experienced the same symptoms that you describe. The thing tha
    cures 8/10 is to simply, re-hook the event handlers for your objects.
    For example, a button that once worked, but no longer does... do thi
    <-- in the designer, Double-Click the object (in this case the button
    again, and you should be transported back to the button click event.
    Try the button again on the web. In my experiences, for some reason
    the event handlers in the code behind gets lost, even though you se
    them in the initialize section of the code....try that and see if i
    work. If not, there are other things to check, but like I said....8/1
    times that works.

    Ralp

    --
    rvira
    -----------------------------------------------------------------------
    rviray's Profile: http://www.msusenet.com/member.php?userid=421
    View this thread: http://www.msusenet.com/t-187097518
     
    rviray, Aug 11, 2005
    #3
  4. Perhaps, as you were cutting and pasting, the form tags in the page are not
    around the buttons, etc.

    If they are not within form tags they will not do a postback unless you do
    some javascript majic in the onClick().

    "" wrote:

    > I have a web application. I had several web form buttons and a
    > datagrid. I cut and pasted some of the buttons to change the layout
    > around, and also cut/pasted the datagrid to move it.
    >
    > Now when I click any of the buttons they do nothing.
    > A hyperlink column in the datagrid which previously opened files now
    > does nothing.
    >
    > I put a break point in one of the buttons and it worked normally.
    > After I removed the breakpoint that button still works normally now,
    > but the others do not. I was able to fix all the buttons
    > functionality by putting in a breakpoint and then removing it.
    > However, I can't break for the hyperlink and so I cannot figure out how
    > to fix this.
    >
    > What is wrong? Why would it stop working when there has been no code
    > changes? Fix?
    >
    > Thanks!
    >
    >
     
    =?Utf-8?B?QnJhZCBSb2JlcnRz?=, Aug 11, 2005
    #4
  5. Guest

    Thanks for the responses. The problem is that it is a LinkButton
    inside a DataGrid. I can't see to get it to work even after deleting
    it out completely and putting a new one in. The code is below.

    <asp:TemplateColumn><ItemTemplate>
    <asp:LinkButton id="LinkButton1" runat="server" CommandArgument='<%#
    DataBinder.Eval(Container, "DataItem.FullName") %>' CommandName='<%#
    DataBinder.Eval(Container, "DataItem.FileName") %>'>
    <%# DataBinder.Eval(Container, "DataItem.FileName") %></asp:LinkButton>
    </ItemTemplate></asp:TemplateColumn>
     
    , Aug 15, 2005
    #5
  6. Could you make sure onItemCommand event on the datagrid is still hooked
    correctly.

    _GJK

    "" wrote:

    > Thanks for the responses. The problem is that it is a LinkButton
    > inside a DataGrid. I can't see to get it to work even after deleting
    > it out completely and putting a new one in. The code is below.
    >
    > <asp:TemplateColumn><ItemTemplate>
    > <asp:LinkButton id="LinkButton1" runat="server" CommandArgument='<%#
    > DataBinder.Eval(Container, "DataItem.FullName") %>' CommandName='<%#
    > DataBinder.Eval(Container, "DataItem.FileName") %>'>
    > <%# DataBinder.Eval(Container, "DataItem.FileName") %></asp:LinkButton>
    > </ItemTemplate></asp:TemplateColumn>
    >
    >
     
    =?Utf-8?B?R0pL?=, Aug 17, 2005
    #6
    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. Mike Bridge

    Postback stops working after a while?

    Mike Bridge, Jul 9, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    378
    Mike Bridge
    Jul 9, 2003
  2. feng
    Replies:
    1
    Views:
    292
  3. =?Utf-8?B?TWFyc2hhbGw=?=

    LDAP Active Directory Bind Stops Working

    =?Utf-8?B?TWFyc2hhbGw=?=, Oct 13, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    4,120
    =?Utf-8?B?TWFyc2hhbGw=?=
    Oct 18, 2004
  4. Nikhil Patel

    application stops working sometimes

    Nikhil Patel, Nov 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    323
    Nikhil Patel
    Nov 29, 2004
  5. Nikhil Patel

    application stops working

    Nikhil Patel, Nov 29, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    342
    =?Utf-8?B?dHJpbml0eXBldGU=?=
    Jan 5, 2005
Loading...

Share This Page