I have this little problem... I have this asp.net website. I have a menu, all done with html and css. So when I click on home, the ajax loads the other content into the specified div element. Working 100%.
In the content that was loaded into the div element, I have a button. An ASP.NET button.
When I click on the button, it gives me a "The resource cannot be found." error.
There must be something I am missing. If you dont understand, heres the ajax:
//Load the Home page on click.
$(document).ready(function () {
$('.home').click(function () {
$("#content").load("html/home/home.aspx");
});
});
Now the aspx page that was loaded into the content div, displays a button, btnAdd:
<asp:Panel ID="pnlAddNewBlog" runat="server">
<asp:TextBox ID="txtAddNewBlog" runat="server" TextMode="MultiLine"></asp:TextBox>
<br />
<asp:Button ID="btnAdd" runat="server" Text="Add" />
</asp:Panel>
When I click on that button, the error appears.
What I want to achieve is to: when the user clicks on the button, the text in txtAddNewBlog gets added into a database. Now this I can achieve using C#... but not if this error is in my way. Any ideas?
html/home/home.aspxexist? Try looking at the network request the browser is sending. Navigate to that URL to ensure it exists.#contentplaced inside some other form ? If yes then you break the html struct when you load the other page.