getting error :
The name 'IPaddress' does not exist in current context.
However, after lot of hit & trials, I have got my goal using this script
<script runat="server">
string IPaddress;
protected void FormView1_OnDataBound(object sender, System.EventArgs e)
{
if (FormView1.CurrentMode == FormViewMode.Insert)
{
TextBox IPAdd = (TextBox)FormView1.FindControl("IPaddress");
if (IPAdd != null)
{
IPAdd.Text = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (string.IsNullOrEmpty(IPAdd.Text))
IPAdd.Text = Request.ServerVariables["REMOTE_ADDR"];
}
}
}
</script>