title: How to display database information on webpage using Razor-pages
body: <p><a href="https://i.stack.imgur.com/qNnWi.png" rel="nofollow noreferrer">This is the image of database I'm working with</a></p>
  <p>I want to display the &quot;word&quot; but using only the &quot;id&quot;. If I have the id &quot;11111&quot;, I need to display the word &quot;abascus&quot;</p>
  <p>This is what I have done so far:</p>
  <pre class="lang-cs prettyprint-override"><code>//This is the code behind file (.cshtml.cs)
  public IList&lt;testdiceware&gt; testdiceware { get; set; }
  public async Task OnGetAsync()
  {
      testdiceware = await _db.testdiceware.ToListAsync();
  }
  </code></pre>
  <p>This is how I'm trying to display information</p>
  <pre class="lang-asp.net prettyprint-override"><code>//This is the .cshtml where I'd like to display the result
  @Html.DisplayFor(model =&gt; model.testdiceware[11111].word);
  </code></pre>
  <p>This gives me ArgumentOutOfBounds exception probably cause it's referring to this <a href="https://i.stack.imgur.com/h1FMQ.png" rel="nofollow noreferrer">value (marked in red)</a>, but I want to display the &quot;word&quot; corresponding to the &quot;id&quot; value</p>
  <p><strong>The main hurdle I'm facing is:</strong></p>
  <p>I'm generating the number '11111' and I need a way to display the corresponding word only using the generated number '11111', is there a way to achieve that?</p>