You can create a base page, in wich you get the IP information and save it to DB,, and drive all your pages from that pages like this:-
public class BasePage : System.Web.UI.Page {protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)//Check that it is not a postback request to avoid duplication
{
string str1 = Page.Request.ServerVariables["REMOTE_ADDR"];
//Save if to DB
}
}}
and then drive all your pages from that page. like this:-
public
partial class MyPage: BasePage
Thanks,
Zeeshan Umar
~Please Mark As Answer, if one or multiple posts, which helped you in your problem. So that it might be useful for others~
My Blog