Click here to Skip to main content
15,898,373 members
Home / Discussions / C#
   

C#

 
GeneralRe: translation vb to c# ? Pin
el69os26-Mar-04 2:01
el69os26-Mar-04 2:01 
AnswerRe: translation vb to c# ? Pin
el69os26-Mar-04 1:57
el69os26-Mar-04 1:57 
Generalnewer version Pin
el69os26-Mar-04 2:05
el69os26-Mar-04 2:05 
GeneralAbout DirectX9 and C# Pin
cemlouis25-Mar-04 8:59
cemlouis25-Mar-04 8:59 
GeneralRe: About DirectX9 and C# Pin
Heath Stewart25-Mar-04 9:19
protectorHeath Stewart25-Mar-04 9:19 
GeneralRe: About DirectX9 and C# Pin
Jeremy Kimball25-Mar-04 9:40
Jeremy Kimball25-Mar-04 9:40 
GeneralDataset not update Pin
terry_cyf25-Mar-04 8:23
terry_cyf25-Mar-04 8:23 
GeneralHTTPModule to filter .asp pages Pin
AWebDude25-Mar-04 8:23
AWebDude25-Mar-04 8:23 
I'm trying to write this class to filter urls from asp to aspx pages but it looks like .Net doesn't deal with .asp pages any more. Could you please suggest any alternative to this or how to make it work?

Thanks a lot.

Here is the code I'm using in the class:

using System;
using System.Web;
using System.Xml;

namespace URLChanger
{
///
/// Summary description for Class1.
///

public class ChangeURL : IHttpModule
{
///
/// Init is required from the IHttpModule interface
///

/// <param name="Appl" />
public void Init(System.Web.HttpApplication Appl)
{
//make sure to wire up to BeginRequest
Appl.BeginRequest+=new System.EventHandler(Rewrite_BeginRequest);
}

///
/// Dispose is required from the IHttpModule interface
///

public void Dispose()
{
//make sure you clean up after yourself
}
///
/// To handle the starting of the incoming request
///

/// <param name="sender" />
/// <param name="args" />
public void Rewrite_BeginRequest(object sender, System.EventArgs args)
{
//process rules here
//cast the sender to an HttpApplication object
System.Web.HttpApplication Appl=(System.Web.HttpApplication)sender;
string fullUrl = Appl.Request.Url.AbsoluteUri.ToLower();
string urlPath = Appl.Request.Path.ToLower();
string[] folders = urlPath.Split('/');
string filename = urlPath.Substring(urlPath.LastIndexOf('/')+1);
string file = filename.Substring(0, filename.IndexOf('.'));
string ext = filename.Substring(filename.LastIndexOf('.')+1);
string parms = Appl.Request.QueryString.ToString();
string dest;

if((Appl.Request["tag"]) == null)
{
if(folders.Length > 3)
{
string fld = folders[2].ToString();

//System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
//doc.Load("http://localhost/URLCHangerDemo/xmlfile1.xml");
//string srch = "/Dealers/PowerPage[@url='" + folders[2].ToString() + "']";
//System.Xml.XmlNode foundNode = doc.SelectSingleNode(srch);

dest = "http://devweb.trader.ca/" + folders[2] + "/" + folders[3] + "?" + parms;
Appl.Response.Redirect(dest);


}
}

}
}
}
GeneralRe: HTTPModule to filter .asp pages Pin
Heath Stewart25-Mar-04 9:16
protectorHeath Stewart25-Mar-04 9:16 
GeneralRe: HTTPModule to filter .asp pages Pin
AWebDude25-Mar-04 9:42
AWebDude25-Mar-04 9:42 
GeneralRe: HTTPModule to filter .asp pages Pin
Heath Stewart25-Mar-04 9:46
protectorHeath Stewart25-Mar-04 9:46 
GeneralRe: HTTPModule to filter .asp pages Pin
AWebDude25-Mar-04 9:50
AWebDude25-Mar-04 9:50 
GeneralRe: HTTPModule to filter .asp pages Pin
Heath Stewart25-Mar-04 9:52
protectorHeath Stewart25-Mar-04 9:52 
GeneralRe: HTTPModule to filter .asp pages Pin
AWebDude25-Mar-04 10:13
AWebDude25-Mar-04 10:13 
GeneralRe: HTTPModule to filter .asp pages Pin
AWebDude25-Mar-04 10:35
AWebDude25-Mar-04 10:35 
GeneralRe: HTTPModule to filter .asp pages Pin
Heath Stewart25-Mar-04 10:41
protectorHeath Stewart25-Mar-04 10:41 
GeneralIt Worked !! HTTPModule to filter .asp pages Pin
AWebDude25-Mar-04 13:38
AWebDude25-Mar-04 13:38 
GeneralRe: Resize Control at Design Time Pin
Heath Stewart25-Mar-04 8:18
protectorHeath Stewart25-Mar-04 8:18 
GeneralRe: Resize Control at Design Time Pin
Heath Stewart25-Mar-04 8:36
protectorHeath Stewart25-Mar-04 8:36 
GeneralRe: Resize Control at Design Time Pin
Heath Stewart25-Mar-04 11:17
protectorHeath Stewart25-Mar-04 11:17 
GeneralRe: Resize Control at Design Time Pin
Heath Stewart25-Mar-04 11:40
protectorHeath Stewart25-Mar-04 11:40 
GeneralRe: Resize Control at Design Time Pin
Heath Stewart25-Mar-04 11:44
protectorHeath Stewart25-Mar-04 11:44 
GeneralRe: Resize Control at Design Time Pin
Jeremy Kimball25-Mar-04 13:05
Jeremy Kimball25-Mar-04 13:05 
GeneralRe: Resize Control at Design Time Pin
Heath Stewart25-Mar-04 13:44
protectorHeath Stewart25-Mar-04 13:44 
GeneralRe: Resize Control at Design Time Pin
Jeremy Kimball25-Mar-04 13:48
Jeremy Kimball25-Mar-04 13:48 

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.