Postback stops working

  • Thread starter Thread starter johnfinkle
  • Start date Start date
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!
 
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

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

Back
Top