?
Solved

finding out if the request is made within the internal network or outside

Posted on 2014-10-21
4
Medium Priority
?
167 Views
Last Modified: 2014-10-26
Hi,

I need to show an additional label, input and button in an ascx page depending on the user requests the page from inside the company or outside the company, what would be the way to achieve this in asp.net?

thank you...
0
Comment
Question by:nicedone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 82

Expert Comment

by:David Johnson, CD, MVP
ID: 40396236
protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}
it is up to you to parse the returned ip address
0
 

Author Comment

by:nicedone
ID: 40397307
Hi, i guess i could not tell it right. if the request comes from outside i will hide the label , but if it is within the company then show it. what you give me would reveal the ip but i need to know where the ip belongs? i s it withing the company or outside the company ? if outside hide it if not show it type of a thing
0
 
LVL 82

Accepted Solution

by:
David Johnson, CD, MVP earned 2000 total points
ID: 40398341
as I mentioned you need to add your own logic i.e. if the ip address starts with 10. / 192.168. / 172. then it is a local address otherwise it is a remote address.  You can tailor this to meet your requirements.
0
 

Author Closing Comment

by:nicedone
ID: 40405262
Thank you for the help
0

Featured Post

How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question