0

Why My Event as link button event or item command not fired until i post back page with another control in page. for example in this code:

 <div id="pagination">
                    <span class="all" runat="server" id="CurrentPage">Total Pages</span>
                    <asp:Repeater ID="RPTPaging" runat="server" Visible="false" OnItemDataBound="RPTPaging_ItemDataBound" OnItemCommand="RPTPaging_ItemCommand">
                        <ItemTemplate>
                            <asp:LinkButton ID="BtnPage" CssClass="inactive" CommandName="Page" CommandArgument="<%# Container.DataItem %>" runat="server" Text="<%# Container.DataItem %>"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>

related to this question Why Repeater ItemCommand Doesn't fire, even if i don't rebind by post back?

i found when i click on link button in this repeater nothing happened,but after i click on empty input button on page, after post back a page changed corectlly.

Community
  • 1
  • 1
amin
  • 1,194
  • 1
  • 12
  • 20

1 Answers1

0

Dear Expert After 2 day finally i figure out why my page doesn't post back. after i tried to post back my button manually with java script and i failed. i tried to trace the script and i found this Error with firebug:

 TypeError: theForm.submit is not a function
     theForm.submit();

when i google it i found i have a button in my MasterPage with id="Submit" and as "submit is not a function" means that you named your submit button or some other element submit. Rename the button to btnSubmit and your call will magically work.

When you name the button submit, you override the submit() function on the form.

So This Problem Resolved. Thanks to all.

amin
  • 1,194
  • 1
  • 12
  • 20