In my C# Web Application, I have two different projects ("Project1" and "Project2") in one solution. In "Project1" I have a webpage with a button and on the OnClick event I am trying to capture a session variable and redirect to a webpage in "Project2" called "Numbers.aspx". I set "Project1" to include "Project2" as a dependency and "Project1" is the startup project. When I run "Project1" it goes to the following url:
http://localhost:5243/WebpageA.aspx
When I set "Project2" as the startup project and run it, it goes to the following url:
http://localhost:5571/Numbers.aspx
In "Project1" when I write:
Response.Redirect("~/Numbers.aspx");
it says the path is not valid. I also tried the following path and it says it does not exist:
Response.Redirect("~/Project2/Numbers.aspx");
Does anyone have any suggestions how I can redirect to this webpage in the different project and capture a session variable from Project1? Thanks!
//OnClick event
protected void click(object sender, EventArgs e)
{
Session["Variable"] = textBoxName.Text;
}