TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rahul shinde
NA
20
0
how to use Http handler and module
Nov 12 2013 9:36 AM
I want to Redirect from application one hosted on one server to another application hosted on another server.When I redirect to 2nd server at that time how I get information of Get Request From which sever it comes.
I tried following module code.
public class NewModule:IHttpModule
{
private const string OriginalUrlKey = "CharlieFriendlyUrlModuleRecordOriginalUrl";
//// Record the original, friendly URL. This value is used later in the Pipeline.
private void BeginRequest(object sender, EventArgs e)
{
HttpContext context = ((HttpApplication)sender).Context;
string originalUrl = string.Empty; // code to get original URL from HttpContext.Current.Request
originalUrl = context.Items[OriginalUrlKey].ToString();
}
private HttpApplication _application = null;
string path, schme, applicationpath;
public void Dispose()
{
}
public void Init(System.Web.HttpApplication context)
{
// save the context
_application = context;
// handle the end request
context.EndRequest += new EventHandler(context_EndRequest);
}
// tag a message at the end of the page
void context_EndRequest(object sender, EventArgs e)
{
string message = string.Format("Generated at {0}",
System.DateTime.Now.ToString());
// stream it at the end of the response
_application.Context.Response.Write(message);
}
}
Reply
Answers (
0
)
how to implement url masking
how to get HTTP request details