I want to create a custom .ascx user control in monox.
I know how to do that in a standard asp.net application but I am getting error in monox as I need advise if I need to follow any guidelines ?
Here is that I have done so far.
1- Create a folder on root: "UserControl"
2- Added a new .ascx as "TestSqlUserControl.ascx"
3- Here is the .ascx code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TestSqlUserControl.ascx.cs" Inherits="MonoSoftware.MonoX.Pages.UserControl_TestSqlUserControl" %>
<%@ Import Namespace="MonoSoftware.MonoX.Resources" %>
<%@ Register Namespace="MonoSoftware.Web.Pager" Assembly="MonoSoftware.Web.Pager" TagPrefix="mono" %>
<
h1
>
Test
</
h1
>
4- Here is code behind (TestSqlUserControl.ascx.CS)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MonoSoftware.MonoX.Utilities;
public partial class UserControl_TestSqlUserControl : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
5- On the homepage I added this:
<%@ Register TagPrefix="MonoX" TagName="TestSqlUserControl" Src="/UserControl/TestSqlUserControl.ascx" %>
<
MonoX:TestSqlUserControl
runat
=
"server"
></
MonoX:TestSqlUserControl
>
Where I am wrong ? please advise ?