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
Usha Raj
NA
144
60k
Redirecting the page
Apr 7 2015 8:26 AM
I have a job applying page in my application,if we click on apply button it should be check the user is login or not ,if not it should be redirect to login page.
Generally after sign am redirecting to the home page but when we trying to apply the job ,it should not be redirect to home page,it should be job applying page after sign in,for this am writing the code to get the current page url and creating the session for that url, that session value am using in after sign in process like
protected void btnAp_Click(object sender, EventArgs e)
{
string path = HttpContext.Current.Request.Url.AbsolutePath; // here am getting the page url
path = path.TrimStart('/');
Session["pathUrl"] = path;
int Id = Convert.ToInt32(Session["RegId"]);
if (Id != 0)
{
Response.Redirect("MyProfile.aspx");
}
else
{
Response.Redirect("SignIn.aspx");
}
}
after sign in ,am writing the code like
protected void btnsignIn_Click1(object sender, EventArgs e)
{
string Email = txtemail.Text.Trim();
string password = txtpassword.Text;
int a = objsignin.SignIn(Email, password);
if (a !=0)
{
if (!string.IsNullOrEmpty(Session["pathUrl"] as string))
{
string urlToRedirect = Session["pathUrl"].ToString(); // if the user is login while applying the job then it should be redirect to job applying page or else home page
Response.Redirect(urlToRedirect);
}
else
{
Response.Redirect("HomePage.aspx");
}
}
else
{
lblmsg.Text = "Invalid Email/Password";
}
}
Up to now ok,no issuess ,but am using two master pages for my application i.e after signinmaster page and before sign in master page,these two master pages contains with different menus,When I will try to apply the job it should check the user is logn in or not ,if not it should be redirect to sign page after sign it should be redirect to the job applying page with after sign in master page menu,so can any one tell me how to do this??
Reply
Answers (
5
)
How To Convert a Future Date Time to X minutes from now MVC
Validation in Gridview