public ActionResult Create() { //requesting ip IPAddress of machine string ipAddress = Request.ServerVariables["REMOTE_ADDR"]; string ipAddress2 = Request.UserHostAddress; ViewBag.Org_id = new SelectList(db.Organizations, "ID", "Organization_name"); ViewBag.Visitor_id = new SelectList(db.Visitors, "ID", "First_name"); return View(); }
ViewBag.IPAddress = ipAddress;
Your IP is @ViewBag.IPAddress
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)