Hi Amit,
Here is the sample i have checked and is working as per your explanation.
HTML Wa website
<asp:Button Text="Sending from Wa" runat="server" OnClick="Send" />
C# Wa website
protected void Send(object sender, EventArgs e)
{
Response.Redirect("http://localhost:5621/205933_1/Wb.aspx");
}
C# Wb website
protected void Page_Load(object sender, EventArgs e)
{
// To check UrlReferrer mostly if coming from any other page or from other website which is last visited
if (Request.UrlReferrer != null)
{
Uri fullPath = new Uri(Request.UrlReferrer.AbsoluteUri);
string hostName = fullPath.Host;
string[] domains = hostName.Split(new char[] { '.' });
string domain = domains[0]; //You will get the hostname i.e. wa
if (domain.ToLower() == "localhost")
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "message", "alert('Redirected from wa')", true);
}
else
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "message", "alert('Redirected from other')", true);
}
}
}
Here i am checking with localhost. You need to check as per the webside url.