I'm using .net framework 4.0. I have an asp.net site that uses a menu to call a JS function which fires an update panel to load the content area with text -- it works fine. But now the Context.RewritePath method doesn't fire in the Global.asax file.
If I put the page name after the domain name the page_load even doesn't fire and it goes to "The resource cannot be found." error page.
1) Is there any way that I can get the Rewrite method to run when I click on a menu item?
2) Also is there a way to load the default.aspx page and run the ajax method when I enter the URL and press enter? Example:
It worked fine before I implemented the AJAX functionality, but after that it won't post back. I'd like it load the Default.aspx page the first time but after that I would just run the ajax functionality and change the url in the address bar.
I guess I'm wanting my cake and eat it too.
I was really getting tired of my WP blog (written in PHP) taking 15 to 25 seconds to load a page and doing everything I could to get it to run faster. So I decided to write my own blog using AJAX and asp.net.
The post loads instantly with AJAX but I have a lot of bookmarks out there (2 years worth) saved to people's bookmarks bar and if they run click it to go back to my site they'll get a "The resource cannot be found" error.
Is there anyway to get my asp.net site to run the way I want it to?
Here's the code on my default.aspx page:
And here's the javascript function the fires it:
Thanks!
Doug
If I put the page name after the domain name the page_load even doesn't fire and it goes to "The resource cannot be found." error page.
1) Is there any way that I can get the Rewrite method to run when I click on a menu item?
2) Also is there a way to load the default.aspx page and run the ajax method when I enter the URL and press enter? Example:
It worked fine before I implemented the AJAX functionality, but after that it won't post back. I'd like it load the Default.aspx page the first time but after that I would just run the ajax functionality and change the url in the address bar.
I guess I'm wanting my cake and eat it too.
I was really getting tired of my WP blog (written in PHP) taking 15 to 25 seconds to load a page and doing everything I could to get it to run faster. So I decided to write my own blog using AJAX and asp.net.
The post loads instantly with AJAX but I have a lot of bookmarks out there (2 years worth) saved to people's bookmarks bar and if they run click it to go back to my site they'll get a "The resource cannot be found" error.
Is there anyway to get my asp.net site to run the way I want it to?
Here's the code on my default.aspx page:
Code:
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div style="display:none">
<asp:Button ID="Button1" Text="Submit" OnClick="Button1_Click" runat="server" />
<asp:HiddenField ID="HiddenField1" runat="server" />
</div>
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" />
</Triggers>
<ContentTemplate>
<asp:Label ID="PostTitle" runat="server" Font-Size="Large"></asp:Label>
<asp:LinkButton CssClass="showcomments" ID="lnkShowComments" runat="server">Show Comments</asp:LinkButton>
<br />
<asp:Label ID="Content" runat="server" Width="95%"
Font-Names="verdana" Font-Size="8pt" Font-Bold="false" ></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
And here's the javascript function the fires it:
Code:
function GetContent(t) {
document.getElementById("HiddenField1").value = t;
var button = document.getElementById("Button1");
button.click();
}
Thanks!
Doug