I want my emails to be read into a Grid view, but i keep getting an error and i have no idea why?
This is the code that i have used to insert my grid view, but when i hit run it fails.
<asp:GridView ID="gvEmails" runat="server" AutoGenerateColumns="false" OnSelectedIndexChanged="gvEmails_SelectedIndexChanged">
<Columns>
<asp:BoundField HeaderText="From" DataField="From" />
<asp:HyperLinkField HeaderText="Subject" DataNavigateUrlFields="MessageNumber" DataNavigateUrlFormatString="~/webFormShow.aspx?MessageNumber={0}"
DataTextField="ubject" />
<asp:BoundField HeaderText="Date" DataField="DateSent" />
</Columns>
</asp:GridView>
This is really strange considering i copied this code from one of my working programs??
The error below is all the info they give me
Compiler Error Message: CS1061: ‘ASP.displaymaillist_aspx’ does not contain a definition for ‘gvEmails_SelectedIndexChanged’ and no extension method ‘gvEmails_SelectedIndexChanged’ accepting a first argument of type ‘ASP.displaymaillist_aspx’ could be found (are you missing a using directive or an assembly reference?)
What am i doing wrong??
They did not give me much info, so i can only provide this little bit 🙁 but i sure hope someone can help.
OnSelectedIndexChanged=”gvEmails_SelectedIndexChanged” remove it from your aspx or add the event in the cs class. This exception occurs when code is missing from code behind.