Click here to Skip to main content
15,891,810 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: maintain scrollbar position Pin
jkirkerx16-Aug-12 9:13
professionaljkirkerx16-Aug-12 9:13 
Questionregular expression validator Pin
sc steinhayse15-Aug-12 10:02
sc steinhayse15-Aug-12 10:02 
AnswerMessage Closed Pin
15-Aug-12 10:24
Susan Rich15-Aug-12 10:24 
GeneralRe: regular expression validator Pin
sc steinhayse15-Aug-12 11:57
sc steinhayse15-Aug-12 11:57 
Questionbring footer to bottom Pin
Jassim Rahma15-Aug-12 9:00
Jassim Rahma15-Aug-12 9:00 
QuestionASP.Net Routing by routes.MapPageRoute with routeURL and physicalFile is not available in route registration Pin
milad137715-Aug-12 7:14
milad137715-Aug-12 7:14 
AnswerRe: ASP.Net Routing by routes.MapPageRoute with routeURL and physicalFile is not available in route registration Pin
jkirkerx15-Aug-12 8:15
professionaljkirkerx15-Aug-12 8:15 
QuestionASP.Net 4 Routing with runtime routeURL and physicalFile Pin
milad137715-Aug-12 6:51
milad137715-Aug-12 6:51 
Please help me on my issue below;

I am working on an application to replace URLRewrite with ASP.Net 4 Routing. The requirement is to get the context.Request.RawURL runtime and check the URL in the database to find the physical file (ASPX form) and render that page.

This is what I have done but not sure how to render the page without redirection.


public class WebFormRouteHandler : IRouteHandler
{
public System.Web.IHttpHandler GetHttpHandler(RequestContext requestContext)
{
return new WebFormHandler();
}
}


public class WebFormHandler : IHttpHandler
{

public bool IsReusable
{
get { return true; }
}

public void ProcessRequest(HttpContext context)
{
string url = context.Request.RawUrl;

var destinationURL = GetFromDatabase(url);

context.Response.StatusCode = 301;
context.Response.AppendHeader("Location", destinationUrl);
return;
}
}


And In global.asax.cs :

public static void RegisterRoutes(RouteCollection routes)
{
var route = new Route("{language}/{*page}", new WebFormRouteHandler());

routes.Add(name, route);

return route;
}

So I want to get the requested URL and look at the database to get the physical file. The physical file may come with query strings. The way I have done above is not good because I am redirecting and mainly it doesn't work.

Please help.
QuestionSending SMS through ASP.NET Pin
komalridda14-Aug-12 20:00
komalridda14-Aug-12 20:00 
AnswerRe: Sending SMS through ASP.NET Pin
StianSandberg14-Aug-12 21:05
StianSandberg14-Aug-12 21:05 
AnswerRe: Sending SMS through ASP.NET Pin
Richard MacCutchan14-Aug-12 21:10
mveRichard MacCutchan14-Aug-12 21:10 
GeneralRe: Sending SMS through ASP.NET Pin
RichardGrimmer5-Sep-12 4:36
RichardGrimmer5-Sep-12 4:36 
GeneralRe: Sending SMS through ASP.NET Pin
Richard MacCutchan5-Sep-12 5:18
mveRichard MacCutchan5-Sep-12 5:18 
AnswerRe: Sending SMS through ASP.NET Pin
Rahul Rajat Singh16-Aug-12 18:17
professionalRahul Rajat Singh16-Aug-12 18:17 
AnswerRe: Sending SMS through ASP.NET Pin
ashjassi17-Aug-12 2:41
ashjassi17-Aug-12 2:41 
Question2010 web service Pin
dcof14-Aug-12 14:39
dcof14-Aug-12 14:39 
QuestionUnable to run the website using IIS Pin
sravsailu13-Aug-12 23:28
sravsailu13-Aug-12 23:28 
AnswerRe: Unable to run the website using IIS Pin
jkirkerx14-Aug-12 7:45
professionaljkirkerx14-Aug-12 7:45 
QuestionJQGRID IN ASP.NET Pin
Roshith G13-Aug-12 19:29
Roshith G13-Aug-12 19:29 
QuestionCustom Validator of Combobox and Validation summary Pin
Neha Ojha13-Aug-12 7:28
Neha Ojha13-Aug-12 7:28 
AnswerRe: Custom Validator of Combobox and Validation summary Pin
jkirkerx14-Aug-12 7:59
professionaljkirkerx14-Aug-12 7:59 
GeneralRe: Custom Validator of Combobox and Validation summary Pin
Neha Ojha15-Aug-12 5:09
Neha Ojha15-Aug-12 5:09 
GeneralRe: Custom Validator of Combobox and Validation summary Pin
jkirkerx15-Aug-12 7:41
professionaljkirkerx15-Aug-12 7:41 
GeneralRe: Custom Validator of Combobox and Validation summary Pin
Neha Ojha15-Aug-12 8:11
Neha Ojha15-Aug-12 8:11 
GeneralRe: Custom Validator of Combobox and Validation summary Pin
jkirkerx15-Aug-12 10:54
professionaljkirkerx15-Aug-12 10:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.