Note that there are some explanatory texts on larger screens.

plurals
  1. POThe name 'GridView1' does not exist in the current context Glossary.aspx.cs
    primarykey
    data
    text
    <p>Glossary.aspx</p> <p>Here is the html code for the site. I plan to add a login so people can edit the table based upon active directory. </p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title spellcheck="true"&gt;Lexis Nexis Glossary&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div style="margin-left: 720px"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt; &lt;asp:SqlDataSource ID="TedGlossary" runat="server" ConnectionString="&lt;%$ ConnectionStrings:Glsry_Taylor %&gt;" SelectCommand="SELECT [TermText], [DefNbr], [DefVerNbr], [DefText], [AmplifyingExplanationText], [SeeAlsoText], [AuthoritativeSrcText], [ScopeName], [DomnName], [GovernanceStateName], [LastUpdtTimestamp] FROM [Glossary] ORDER BY [TermText]"&gt;&lt;/asp:SqlDataSource&gt; &lt;asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" " DataKeyNames="TermText,DefNbr,DefVerNbr" DataSourceID="TedGlossary" EnableSortingAndPagingCallbacks="True"&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="TermText" HeaderText="Term" ReadOnly="True" SortExpression="TermText" /&gt; &lt;asp:BoundField DataField="DefNbr" HeaderText="Definition #" ReadOnly="True" SortExpression="DefNbr" /&gt; &lt;asp:BoundField DataField="DefVerNbr" HeaderText="Definition Vers #" ReadOnly="True" SortExpression="DefVerNbr" /&gt; &lt;asp:BoundField DataField="DefText" HeaderText="Definition" SortExpression="DefText" /&gt; &lt;asp:BoundField DataField="AmplifyingExplanationText" HeaderText="Amplifying Explanation" SortExpression="AmplifyingExplanationText" /&gt; &lt;asp:BoundField DataField="SeeAlsoText" HeaderText="See Also" SortExpression="SeeAlsoText" /&gt; &lt;asp:BoundField DataField="AuthoritativeSrcText" HeaderText="Authoritative Source" SortExpression="AuthoritativeSrcText" /&gt; &lt;asp:BoundField DataField="ScopeName" HeaderText="Scope Name" SortExpression="ScopeName" /&gt; &lt;asp:BoundField DataField="DomnName" HeaderText="Domn Name" SortExpression="DomnName" /&gt; &lt;asp:BoundField DataField="GovernanceStateName" HeaderText="Governance State" SortExpression="GovernanceStateName" /&gt; &lt;asp:BoundField DataField="LastUpdtTimestamp" HeaderText="Last Update" SortExpression="LastUpdtTimestamp" /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;/form&gt; &lt;script&gt; $(function () { $('#&lt;%=GridView1.ClientID%&gt;').dataTable(); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Glossary.aspx.cs</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Home { public partial class Glossary : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { GridView1.PreRender += new EventHandler(GridView1_PreRender); } protected void GridView1_PreRender(object sender, EventArgs e) { if (GridView1.Rows.Count &gt; 0) { //forces grid to render thead/th elements GridView1.UseAccessibleHeader = true; GridView1.HeaderRow.TableSection = TableRowSection.TableHeader; } } } } </code></pre> <p>I am getting an error of GridView 1 does not exist in its current context. I am not sure why that is happening. Any insight would be greatly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload