开发者

How to validate incoming Urls?

I need to validate incoming urls from my application following is the scenario

on url http://abc.com/login.aspx - need to validate incoming urls from anyone of following

http://xyz.com/start.aspx

http://xyz.net/start.aspx

ht开发者_C百科tp:/yyy.com

http://mydomain.com/gotologin.aspx

Now from http://abc.com/login.aspx - I have to check whether the user came from above any three link or not?

If use came from any of these link display the a custom message with the url.

Any help on this will be most appreciated.

I finished it with config file like

http://xyz.com/start.aspx" value="6"/> Here is a need of assign a particular value to a user came from specific url so, I took the key of url. All is working fine on local system. But when I published the sites on production it is not working. The code and rest logics are fine.


You probably want to look at the "Referer" header on the request.


switch (Request.UrlReferrer.ToString())
{
    case "http://xyz.com/start.aspx":
        // Do something
        break;
    case "http://xyz.net/start.aspx":
        // Do something else
        break;

    default: break;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜