Click here to Skip to main content
15,920,801 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
C#
[WebMethod(EnableSession = true)]
        public static string AddBookmark(string inputText)
        {
            string[] ip = inputText.Split('~');
            if (ip[1] == "XXX")
            {
                return string.Format("Error");
            }
            else
            {
                /* enter data into db */
                Url_BLL obj = new Url_BLL();
                int i = obj.Add_Update_Url_BLL(ip[1].ToString(), ip[1].ToString(), ip[1].ToString(), ip[1].ToString(), ip[1].ToString(), Session["UserEmail"].ToString());
                /* enter data into db end */
                if(i==-1)
                    return string.Format("{0}", "Added!");
                else
                    return string.Format("{0}", "Sorry Error!");
            }
        }

While runing these code getting an error -
C#
Error	36	An object reference is required for the non-static field, method, or property 'System.Web.UI.Page.Session.get'
Could not get it. Please help.
Posted
Updated 26-Nov-13 9:00am
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900