Used To Get The IP Address Of A Connected User?
Mar 16, 2011which property should be used to get the ip address of a connected useruse property
View 3 Replieswhich property should be used to get the ip address of a connected useruse property
View 3 RepliesI have one web part (the provider) which displays insurance claims in a gridview. When user clicks on one this value(case number) is passed via IWebPartField interface to another web part(consumer) which displays detailed info about the claim. So far so good. I can select different claims in the provider and the details show up in the consumer just fine. The moment I add a TextBox to the consumer, the consumer no longer recognizes the case number passed. I need the user to be able to enter a value in the textbox and click a button to update that claim info. I can debug and attach to process and it looks like it is getting the case in the callback function, etc, but when it is setting parameters for the stored proc in CreateChildControls, it is null. Comment out the TextBox and it works fine.
View 1 Repliesusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
[Code] ....
Possible Duplicate:
How to get visitor location ( country, state and city ) using ASP.NET
How get user location using user IP address using asp.net?
I want to capture user ip address but some reason i am getting different values:
method 1:
Dim strHostName As String = System.Net.Dns.GetHostName()
Dim clientIPAddress As String = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString()
method 2:
Dim k As String = Request.ServerVariables("remote_addr")
I am trying to fetch the IP address using this:-
protected void Page_Load(object sender, EventArgs e)
{
string ClientIP;
ClientIP = HttpContext.Current.Request.UserHostAddress;
Label1.Text = ClientIP;
}
This code outputs 127.0.0.1.
And the code below displays nothing!
string ClientIP;
ClientIP = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
Label1.Text = ClientIP;
How do I fetch the IP address? The REAL IP address of a user?
[EDIT]
I don't want EXACT location BTW. I need to know the country and then redirect the user to a webpage accordingly.
I used following methods
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]
Request.ServerVariables["REMOTE_HOST"]
Request.UserHostAddress
Request.UserHostName
All the above are returning "127.0.0.1", not the actual IP.
The below one returns null.
HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]
Below one always returns where the application is hosted/running, not the client's IP address.
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
I have site ( ASP.NET, C# ) and I need to automatic show start page based on user location. Can I get name of user city if I have IP address of user ?
View 5 RepliesI have a data list on my page which shows a clients company, address and contact info. This information is stored in a sql database table. one of the columns is email address
Also on the page is a button and textbox set to multimode where the logged on client can send a message.
In the the button click event I want to send the message but capture the email address from the "Email" column and add this to the from part of the mail message as below
[Code]....
I just want to get the email address this way or get it from the membership system which ever is better.
In a controller action of a CastleMVC application, how can I get the user's IP Address?
I think in asp.net mvc it would be Request.ServerVariables["REMOTE_ADDR"], but I can't find an equivalent in Castle.
(I am aware of potential proxy issue's etc, the address that is reported in the request is fine)
This is the current architechture and this is the question I have: Current architechture: We have an intranet application. No one accesses from outside the firewall. It's pretty simple architechture. We have a webservice and WebUI. The Web UI calls the webmethods of the webservice. So far so good. It works fine. Both webservice and WebUI runs under the context of the same service account (non human user account) that we created. The security is a role based security. If a user is a specific AD group, he can access with web UI. On the webui and webservice we have "Integrated windows authentication".
Code:
<authorization>
<allow roles="MycompanyApr-DataWriters"/>
</authorization>
So all the users and the service account that runs this webservice are in this AD group Apr-DataWriters. When a user launches this webUI, I want to find out either his box number of IP address of this box and datetime stamp. How can i get that information.
I have tried fetching the ip from below mentioned methods
HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] &
Request.UserHostAddress & Request.ServerVariables["REMOTE_ADDR"]
We are using Profile.FirstName and Profile.LastName to get current user's firstname/last name. How do we get current user's email address?
View 2 RepliesThere is a post request coming to my portal and I am fetching IP address from the post request on my portal landing page(INDEX view in MVC) and saving in DB table. below is the code to fetch IP address.
string Device_IP = "";
if (!string.IsNullOrEmpty(Request.ServerVariables["HTTP_VIA"]))
{
// ' using proxy
// ' Return real client IP.
[CODE] ...
It is fetching IP address on my side but on client side when request is made code is not working. same code working fine on other sites.
I want save users IP in database
View 1 RepliesHow to retrieve the current authenticated logged in user's email address who is accessing the page.
I have managed to do it with users. How to get the current authenticated user's email address if that makes sense.
Here is my aspx code:
[Code]....
and my VB script:
[Code]....
Somebody suggested that I should run a query. If you know the user name accessing the page, surely you can take that information, insert it into a query to find out the email address of the user accessing the page. Sounds great but don't have a clue how to do it.
Is it possible for a user to recover their password by entering their e-mail address alone?
Right now I am using the PasswordRecovery control, and i have security questions disabled. So all the user has to do is put their User Name, and hit submit, then their password is e-mailed to them.
But, a lot of my users forget their User Name, so right below I have a User Name recover section. The user inputs their e-mail address, and their corresponding user name shows up.
I would like to simplify this and just require the user's e-mail address to provide them their user name AND password.
I have been searching since some days for the best approach one can have in order to allow an authenticated user to change his/her email address.
This is the code I have but apparently it doesn't work and it doesnt even gives a error. The application seems to ignore it:
Change email address:
<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
<asp:TextBox ID="txtPassword" runat="server"></asp:TextBox><br />
<asp:Button ID="changemailbtn" runat="server" Text="Button" />
<asp:Label ID="lblErrors" runat="server" EnableViewState="False"
[Code]....
I need to validate IP Address which is entering into textbox by the user....
I validated some other controls using ajax only, so only expecting the same for IP Address also...
I've been trying to work out this error for a while now and i still dont understand it because i have been following a tutorial online step-by-step but i recieve this error when i log in ?
What i am trying to acheive is when the user logs in then they are able to view their 'profile' such as their name, address etc. The login is validated against a table in a database, ...this is the error i am recieving:
Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
[Code]....
I'm building an ASP.NET MVC 2 site, where I want to have users verify their email address after they register.
I want to send an email to the address with a link that the user can click to verify their email, and then handle the clicking of that link (the link will contain a specific id, of course).
Of course, this is easy to manually implement, but is there anything already built in to ASP.NET that has such a function?
I have profile variable called IP Address ,
i need this Profile to add Unique IP address that has been used by the UserName ,,,
meaning :
If i logged in for the first time , it will save my IP address , next time if my IP has changed and i logged in , i need to keep the old IP address and add to it with comma seperated the new IP ..
Record Current Geographic Location and Display in Web using asp.net c# ....
like as :
Refer this link [URL]..
I am creating a "Request for Quote" web form for my company so that when user enters his:
name,address,email,phone etc fields and clicks the submit button,all the data of the webform should be sent to my email address.
I am using an email address as my "username" for Login. When a user logs in the User object that is created has the Email address as the name which is incorrect. The actual name is another field in the DB. How do I login and authenticate against the email address and then load the correct name in the User object?
I am using forms authentication with a custom MembershipProvider and RoleProvider.
Edits Below to Clarify
I have a custom MembershipProvider that validates users by email address and password. It is called by the basic Login Control and registered in web.config.
[code]....