| | |
aspx page not loading!!!! Method called too soon
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2006
Posts: 2
Reputation:
Solved Threads: 0
Why isn't my aspx page rendering before the process() method call? What is
happening is when I run my page in debug mode, my aspx page never renders, and it's jumping straight into my process() method when I run in debug mode in VS 2005, using the VS
built-in web engine.
What should happen is I start debug, my aspx page loads, I click on the hyperlink, and that initiates process() to run. It's not happening that way though, why?
See related article here (http://www.codeproject.com/aspnet/urlrewriter.asp) and then my code below :
My aspx page:
happening is when I run my page in debug mode, my aspx page never renders, and it's jumping straight into my process() method when I run in debug mode in VS 2005, using the VS
built-in web engine.
What should happen is I start debug, my aspx page loads, I click on the hyperlink, and that initiates process() to run. It's not happening that way though, why?
See related article here (http://www.codeproject.com/aspnet/urlrewriter.asp) and then my code below :
My aspx page:
C# Syntax (Toggle Plain Text)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestURLRewriter.aspx.cs" Inherits="TestURLRewriter" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>URL Rewriter Test Page</title> </head> <body> <asp:HyperLink ID="link1" NavigateUrl="/recipes/4/detail.aspx" runat="server">/recipes/4/detail.aspx</asp:HyperLink> </body> </html> My global.asax: void Application_BeginRequest(object sender, EventArgs e) { MyNamespace.Web.URLRewriter.Process(); } ...rest of global.asax... My .cs page: namespace MyNamespace.Web { public class URLRewriter : IConfigurationSectionHandler { protected XmlNode _oRules; protected URLRewriter(){} private string recipeID; public static void Process() { URLRewriter oRewriter = (URLRewriter)ConfigurationSettings.GetConfig("system.web/urlrewrites"); string rewrittenURL = oRewriter.GetRewrittenURL(HttpContext.Current.Request.Path); if (rewrittenURL.Length > 0) { //Rewrite the path using the rewritten URL HttpContext.Current.RewritePath(rewrittenURL); } } ... rest of .cs page
Last edited by dba123; Aug 7th, 2006 at 1:26 am.
![]() |
Similar Threads
- How to disable Back button of IE when executing welcome.aspx page? (ASP.NET)
- how to make the aspx page at runtime (ASP.NET)
- Create .aspx page at runtime (ASP.NET)
- Email an aspx page (or any webpage you want) (ASP.NET)
- .aspx page won't open at home (ASP.NET)
Other Threads in the C# Forum
- Previous Thread: Problem with the keyboard hooks
- Next Thread: DataGridView - how to get invalid data in comboboxcell
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client color column combobox control conversion csharp custom database datagrid datagridview datagridviewcheckbox dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest image index input install java label leak lisp list listbox listener location mandelbrot math mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer update usercontrol usercontrols validation view visualstudio wait webbrowser windows winforms wpf xml





