Posting data from one asp.net page to another
Ok I've done enough research but can't seem to find a solution. Its from one application page to another application page. Since I will be sending the username and password, I cannot send it as "getT", so I need to make a "message". I'll be using ssl though - not sure if that helps. so I cannot use sessions in my applications and use those shared sessions like databsae is a performance killer Also, once the user clicks on a link on the original page, I need to do some post processing and then send a message to another page to use the form and stuff not work.
any help
fyi: What I am trying to achieve is that a person, when registering in application A, clicks on some link, I do not process and do not want to pass them to application B, where they should not be overwritten in application B, but instead, automatically login.
We use Global.asax to do exactly what you describe. Assuming both web applications are using the same business domain. You can use the following to set up a registered user on our business domain. Then you can use the presence of this property to know not to prompt for login again in the second web application.
/// <summary>
/// Event fires when an HTTP request is made to the application.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
// If we don't have a logged in user.
if (<BusinessDomain>.Constants.LoggedInUserID == null)
{
// Ensure that Context.Handler for this particular HTTP request implements an interface that uses a Session State.
if (Context.Handler is IRequiresSessionState || Context.Handler is IReadOnlySessionState)
{
if (Session != null)
{
// Set the currently logged in user in our Business Domain.
if ((Guid)Session["UserID"] != Guid.Empty)
{
<BusinessDomain>.Constants.LoggedInUserID = Session["UserID"];
}
}
}
}
}
a source to share