body>
</html>
The page connects to a database and retrieves the data. For a strange reason that i cant work out myself i currently receive the error "Context is not a memeber of inline_dataset" (inline_dataset is the name of the page). Ive checked this code a few
times and cant work out why its doing this - anyone got any clues? also the line showing the error is
verify that your CodeFile is correct (pointing to your codebehind file). Also look at your inherits=, making sure you include any namespaces you have defined in your codebehind.
I changed AutoEventWireup to true and made no diffrence. I've been copying and pasting the form so i decided to create a new project and copy the code into it - same error.
I think the code file is correct. The inherits/Import statement now reads as:
@ Import
Namespace="System.IO" %>
<!DOCTYPE
html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml"
>
<
head runat="server">
<title>Untitled Page</title>
Current error is:
Error 1 Argument not specified for parameter 'expression' of 'Public Shared Function Eval(container As Object, expression As String, format As String) As String'. C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\InlineDataSet\Default.aspx 21
Ill keeping playing along but if you get anymore ideas please advise.
body>
</html>
Exact same error message as before except line 30 which is
<%# DataBinder.Eval (myDataSet.Tables["Manufacturer"].Rows[0],"[ManufacturerWebsite]") %>
I am an amateur developer and I had the same problem. During development on my computer my project worked fine. When I copied it to the web server it failed with and error "Context is not a member of." I could not find the solution to the problem anywhere.
By trial and error I found a solution that worked. I did the following for mypage.aspx with code behind
mypage.aspx.vb.
<div mce_keep="true">I backed up the project.</div>
<div mce_keep="true">The solution explorer contained a file mypage.aspx.designer.vb. I deleted it. Why? I noticed that when I created a new web form on the web server the
designer.vb file was not included.</div>
<div mce_keep="true">I changed the page directive so that it read CodeFile =
"~/MyFolder/MyPage.aspx.vb". The full path within the root directory needs to be in the quotes.</div>
<div mce_keep="true">I made sure the directive Inherits ="MyPage". This should be exactly the same name as the partial class in
MyPage.aspx.vb.</div>
<div mce_keep="true">I built the page.</div>
<div mce_keep="true">After I corrected a few pages and ensured that they worked I used "Edit - Replace in files" menu command to change my code and I deleted all the .aspx.designer.vb files.</div>
I'll tell you what the secret is. There are three names that have to be coordinated, including their folder:
CodeFile= xyzpagename.aspx.vb
Inherits= "foldername_xyzpagename
Now go to the aspx.vb code behind file:
Partial Class foldername_xyzpagename
Note the underline connector between the folder name and the page name.
When you correct them in the order above, when you get to changing the .vb page, it will come up with alternatives. One of them will match Inherits on the first page.
I have corrected this worthless message any number of times this way.
Now do yourself a favor and start a notebook of how you correct worthless messages. Ultimately, you will save yourself a lot of time.
In my case, with a similar error, I had been chopping and changing the code. By the time I had finished, I should have had a very simple code behind page:
Partial Class _Default
Inherits System.Web.UI.Page
End Class
EssCee
Member
548 Points
760 Posts
Context is not a member of 'Page name'
Aug 20, 2007 08:26 AM|LINK
I created the below page:
<%
@ Page Language="VB" AutoEventWireup="false" CodeFile="Inline_DataSET.aspx.vb" Inherits="Inline_DataSET" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><
html xmlns="http://www.w3.org/1999/xhtml"><
head runat="server"> <title>Inline Binding to a DataSet.</title></
head><
body> <form id="form1" runat="server"> <div> <asp:Label ID="lblName" runat="server">Name: DataBinder.Eval (myDataSet.Tables["Manufacturer"].Rows[0], "[ManufacturerName]")
</asp:Label> <br />Country:
<asp:Label ID="lblCountry" runat="server" Text='<%# DataBinder.Eval(myDataSet.Tables["Manufacturer"].Rows[0], "[ManufacturerCountry]") %>'> </asp:Label> <br />Contact:
<asp:HyperLink ID="lnkEmail" runat="server" NavigateUrl='mailto: <%# DataBinder.Eval(myDataSet.Tables["Manufacturer"].Rows[0],"[2]","mailto:{0}") %>' Text='<%# DataBinder.Eval(myDataSet.Tables["Manufacturer"].Rows[0], "[ManufacturerEmail]") %>'> </asp:HyperLink> <br />Homesite:
<asp:HyperLink ID="lnkWebsite" runat="server" NavigateUrl='<%# DataBinder.Eval(myDataSet.Tables["Manufacturer"].Rows[0], "[3]") %>'> <%# DataBinder.Eval (myDataSet.Tables["Manufacturer"].Rows[0],"[ManufacturerWebsite]") %> </asp:HyperLink> <br /> <br /> <asp:Label ID="lblError" runat="server"></asp:Label><br /> </div> </form></
body> </html> The page connects to a database and retrieves the data. For a strange reason that i cant work out myself i currently receive the error "Context is not a memeber of inline_dataset" (inline_dataset is the name of the page). Ive checked this code a few times and cant work out why its doing this - anyone got any clues? also the line showing the error is<asp:HyperLink ID="lnkWebsite" runat="server" NavigateUrl='<%# DataBinder.Eval(myDataSet.Tables["Manufacturer"].Rows[0], "[3]") %>'>
<%
# DataBinder.Eval (myDataSet.Tables["Manufacturer"].Rows[0],"[ManufacturerWebsite]") %>Thanks
EssCee
Member
548 Points
760 Posts
Re: Context is not a member of 'Page name'
Aug 28, 2007 02:50 PM|LINK
Anyone got any clues? As i copied this code from a book but cant figure where the error could be.....
jperry4
Participant
1522 Points
252 Posts
Re: Context is not a member of 'Page name'
Aug 28, 2007 03:06 PM|LINK
I'm only guessing here, but try setting AutoEventWireup to true. This will allow page events to be hooked up automatically.
Was the code-behind class name changes or namespace changed?
Sorry, I'm just taking stabs in the dark.
John M. Perry
Diamsorn
Contributor
2119 Points
384 Posts
Re: Context is not a member of 'Page name'
Aug 28, 2007 03:35 PM|LINK
verify that your CodeFile is correct (pointing to your codebehind file). Also look at your inherits=, making sure you include any namespaces you have defined in your codebehind.
My Blog
EssCee
Member
548 Points
760 Posts
Re: Context is not a member of 'Page name'
Aug 28, 2007 04:00 PM|LINK
Thanks guys.
I changed AutoEventWireup to true and made no diffrence. I've been copying and pasting the form so i decided to create a new project and copy the code into it - same error.
I think the code file is correct. The inherits/Import statement now reads as:
<%
@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %> <%@ Import Namespace="System.Data" %><%
@ Import Namespace="System.Data.SqlClient" %><%
@ Import Namespace="System.IO" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><
html xmlns="http://www.w3.org/1999/xhtml" ><
head runat="server"> <title>Untitled Page</title>Current error is:
Error 1 Argument not specified for parameter 'expression' of 'Public Shared Function Eval(container As Object, expression As String, format As String) As String'. C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\InlineDataSet\Default.aspx 21
Ill keeping playing along but if you get anymore ideas please advise.
Thanks
Diamsorn
Contributor
2119 Points
384 Posts
Re: Context is not a member of 'Page name'
Aug 28, 2007 05:19 PM|LINK
What is line 21?
My Blog
EssCee
Member
548 Points
760 Posts
Re: Context is not a member of 'Page name'
Aug 29, 2007 02:23 PM|LINK
The code has been changed from above. New codes is as:
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %><%
@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %><%
@ Import Namespace="System.IO" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><
html xmlns="http://www.w3.org/1999/xhtml" ><
head runat="server"> <title>Untitled Page</title></
head><
body> <form id="form1" runat="server"> <div>
<asp:Label ID="lblName" runat="server">Name: DataBinder.Eval (myDataSet.Tables["Manufacturer"].Rows[0], "[ManufacturerName]")
</asp:Label> <br />Country:
<asp:Label ID="lblCountry" runat="server" Text='<%# DataBinder.Eval(myDataSet.Tables["Manufacturer"].Rows[0], "[ManufacturerCountry]") %>'> </asp:Label> <br />Contact:
<asp:HyperLink ID="lnkEmail" runat="server" NavigateUrl='mailto: <%# DataBinder.Eval(myDataSet.Tables["Manufacturer"].Rows[0],"[2]","mailto:{0}") %>' Text='<%# DataBinder.Eval(myDataSet.Tables["Manufacturer"].Rows[0], "[ManufacturerEmail]") %>'> </asp:HyperLink> <br />Homesite:
<asp:HyperLink ID="lnkWebsite" runat="server" NavigateUrl='<%# DataBinder.Eval(myDataSet.Tables["Manufacturer"].Rows[0], "[3]") %>'> <%# DataBinder.Eval (myDataSet.Tables["Manufacturer"].Rows[0],"[ManufacturerWebsite]") %> </asp:HyperLink> <br /> <br /> <asp:Label ID="lblError" runat="server"></asp:Label><br /> </div> </form></
body> </html> Exact same error message as before except line 30 which is <%# DataBinder.Eval (myDataSet.Tables["Manufacturer"].Rows[0],"[ManufacturerWebsite]") %>Thanks
dtprice
Member
62 Points
18 Posts
Re: Context is not a member of 'Page name'
Sep 02, 2007 12:51 AM|LINK
PROBLEM SOLVED...maybe
I am an amateur developer and I had the same problem. During development on my computer my project worked fine. When I copied it to the web server it failed with and error "Context is not a member of." I could not find the solution to the problem anywhere. By trial and error I found a solution that worked. I did the following for mypage.aspx with code behind mypage.aspx.vb.
It worked for me but I am not sure why.
David
mhh12
Member
71 Points
26 Posts
Re: Context is not a member of 'Page name'
Oct 21, 2009 09:35 PM|LINK
I'll tell you what the secret is. There are three names that have to be coordinated, including their folder:
CodeFile= xyzpagename.aspx.vb
Inherits= "foldername_xyzpagename
Now go to the aspx.vb code behind file:
Partial Class foldername_xyzpagename
Note the underline connector between the folder name and the page name.
When you correct them in the order above, when you get to changing the .vb page, it will come up with alternatives. One of them will match Inherits on the first page.
I have corrected this worthless message any number of times this way.
Now do yourself a favor and start a notebook of how you correct worthless messages. Ultimately, you will save yourself a lot of time.
netproblems
Member
36 Points
89 Posts
Re: Context is not a member of 'Page name'
Oct 30, 2009 11:58 AM|LINK
In my case, with a similar error, I had been chopping and changing the code. By the time I had finished, I should have had a very simple code behind page:
Partial Class _Default Inherits System.Web.UI.Page End ClassUnfortunately, I had ommited
Inherits System.Web.UI.Page
Dropped that back in. Sorted.