I'm trying to create a module using Chris's template C# compiled module for DNN 9. I'm running DNN 9. In my View.ascx, I simply have a repeater with a method. The error is telling me the ascx does not contain the repeater method. Here is my stack trace
protected void rptNews_ (object sender, EventArgs e)
{
try
{
using (var con = MySqlDbHelper.GetOpenConnection())
{
var items = con.Query<CmsNews>("SELECT * FROM CMSNEWS", commandType: CommandType.Text);
var cmsNewses = items as IList<CmsNews> ?? items.ToList();
if (cmsNewses.Any())
{
rptNews.DataSource = cmsNewses.ToList();
rptNews.DataBind();
}
}
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}
Here is my markup:
<asp:Repeater runat="server" ID="rptNews" ="rptNews_ ">
<HeaderTemplate>
<ul class="list-group">
</HeaderTemplate>
<ItemTemplate>
<li class="list-group-item">
<asp:Label runat="server" ID="Label2"
Text='<%# "Title") %>' />
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
my code behind for the repeater:
protected void rptNews_ (object sender, EventArgs e)
{
try
{
using (var con = MySqlDbHelper.GetOpenConnection())
{
var items = con.Query<CmsNews>("SELECT * FROM CMSNEWS", commandType: CommandType.Text);
var cmsNewses = items as IList<CmsNews> ?? items.ToList();
if (cmsNewses.Any())
{
rptNews.DataSource = cmsNewses.ToList();
rptNews.DataBind();
}
}
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}