Non-invocable member 'System.Web.UI.Page.Session' cannot be used like a method

I have been converting code from to & get the following compile error:
Non-invocable member 'System.Web.UI.Page.Session' cannot be used like a method.
C:\Projects\camsCSDev\camsCSData\Schema_Alt.aspx.cs: Line:95:Column:65
if (System.Convert.ToInt32((int)(new Page().Session("InsertFlag"))) == 1)
I have attached complete code .aspx & .aspx.cs files for clarity.
Thanks in advance for any help.
Who is Participating?
chinawalConnect With a Mentor Commented:
I think,  Session("InsertFlag") should be Session["InsertFlag"]
homeshopperAuthor Commented:
Thanks it works.
I used to do a fair amount in C#, but have resently been doing a lot.
Must be getting a bit rusty on C#.
homeshopperAuthor Commented:
I am getting same error on another page with similar coding, but a master file.
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="DefaultPage.master.cs" Inherits="DefaultPage" %>
Non-invocable member 'System.Web.UI.WebControls.RepeaterItem.DataItem' cannot be used like a method.C:\Projects\camsCSDev\camsCSData\DefaultPage.master
I am attaching complete file for clarity.
Thanks in Advance.

declanmcdConnect With a Mentor Commented:
When converting from VB to C# the DataItem format is

In VB: <%#Container.DataItem("FieldName")%>

In C#: <%#((DataRowView)Container.DataItem)["FieldName"] %>
homeshopperAuthor Commented:
yes or course.
Thanks for all the help.
All Courses

From novice to tech pro — start learning today.