Postback stops working

J

johnfinkle

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

Daniel Walzenbach

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

--
 
R

rviray

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
 
G

Guest

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

johnfinkle

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

Guest

Could you make sure onItemCommand event on the datagrid is still hooked
correctly.

_GJK
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top