I am developing on a c# web project with aspx pages and need to create a dll with several dialogboxes made of Panels and DIV's. It is possible for me to create a library and call it from the codebehind in my mainproject. But I can't put a DIV, Panel or Textbox in the dll and reference these controls inside the dll.
What I have tried:
I have tried to make a single webproject with a single page and put a webform inside this project with my dialogboxes and call the main routine from my aspx page in codebehind. but the Panel and DIV are null when these controls are referenced.
my aspx file contains the following code:
<body>
<form id="form1" runat="server">
<div id="modalBackground" runat="server" class="modalBackground" visible="false"></div>
<asp:Panel ID="panAddAccountNumber" runat="server" CssClass="modalPopup" Style="display:none" Width="362px">
<div class="header">
test
</div>
<div class="body">
</div>
<div class="footer" align="right">
<asp:Button ID="btnAddAccountNumberYes" runat="server" Text="Ok" CssClass="yes" />
<asp:Button ID="btnAddAccountNumberCancel" runat="server" Text="Annuller" CssClass="no" />
</div>
</asp:Panel>
<div>
</div>
</form>
</body>
and my C# file contains the following code:
public partial class InvoiceDialogbox : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public HtmlGenericControl cModalBackground
{
get
{
return modalBackground;
}
}
public Panel cAddAccountNumber
{
get
{
return panAddAccountNumber;
}
}
public static void ShowInvoice(Int64 vID)
{
InvoiceDialogbox vvv = new InvoiceDialogbox();
vvv.cModalBackground.Visible = true;
vvv.cAddAccountNumber.Style.Remove("display");
vvv.cAddAccountNumber.Style.Add("display", "inline-block");
}
}
But
cModalBackground
and
cAddAccountNumber
are both null when the dll is used from my codebehind in my main project.
So my question is: what can I do for accessing these controls which are null? And if I can't do it in this way - does there exists a another way for creating a dll for a dialogbox structure?
Thanks in advance.