A
Alexander Widera
Hi,
My "page1.aspx" looks like that:
<%@ Page ContentType="text/html" Language="C#" %>
<%@ Register tagprefix="INC" tagname="MyTag1" Src="mytag1.ascx" %>
<html
<head>...</head>
<body>
<form runat="server">
<INC:MyTag1 id="mytag1" runat="server" />
</form>
</body>
</html>
And my "mytag1.ascx" looks like that:
<%@ Control Language="C#" ClassName="MyTag" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Net" %>
<%@ Register tagprefix="INC" tagname="Container" Src="container.ascx" %>
<%@ Register tagprefix="INC" tagname="MyDropDownControl"
Src="mydropdowncontrol.ascx" %>
<script language="c#" runat="server">
public void Page_Load(Object sender, EventArgs e)
{
StringBuilder stringBuilder = new StringBuilder();
StringWriter stringWriter;
HtmlTextWriter htmlTextWriter;
stringWriter = new StringWriter(stringBuilder);
htmlTextWriter = new HtmlTextWriter(stringWriter);
MyDropDownControl myddc = (MyDropDownControl)
LoadControl("mydropdowncontrol.ascx");
myddc.Page_Load(sender, e);
myddc.RenderControl(htmlTextWriter);
mycontainer.Content = stringBuilder.ToString();
DataBind();
}
</script>
<INC:Container id="mycontainer" runat="server" Title="some title"
Content=""
/>
And the file "mydropdowncontrol.ascx" contains only an normal
<aspropDownList ..> ... but I get the error, that it has to be between
the
<form runat=server> ... </form> tag.... But it is !!!
Where is the error?
Could somebody tell me an easier way to get the "results" of an
usercontrol
as an parameter for the next usercontrol ... Or is the method I used the
best?
Thanks for help,
Alex
My "page1.aspx" looks like that:
<%@ Page ContentType="text/html" Language="C#" %>
<%@ Register tagprefix="INC" tagname="MyTag1" Src="mytag1.ascx" %>
<html
<head>...</head>
<body>
<form runat="server">
<INC:MyTag1 id="mytag1" runat="server" />
</form>
</body>
</html>
And my "mytag1.ascx" looks like that:
<%@ Control Language="C#" ClassName="MyTag" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Net" %>
<%@ Register tagprefix="INC" tagname="Container" Src="container.ascx" %>
<%@ Register tagprefix="INC" tagname="MyDropDownControl"
Src="mydropdowncontrol.ascx" %>
<script language="c#" runat="server">
public void Page_Load(Object sender, EventArgs e)
{
StringBuilder stringBuilder = new StringBuilder();
StringWriter stringWriter;
HtmlTextWriter htmlTextWriter;
stringWriter = new StringWriter(stringBuilder);
htmlTextWriter = new HtmlTextWriter(stringWriter);
MyDropDownControl myddc = (MyDropDownControl)
LoadControl("mydropdowncontrol.ascx");
myddc.Page_Load(sender, e);
myddc.RenderControl(htmlTextWriter);
mycontainer.Content = stringBuilder.ToString();
DataBind();
}
</script>
<INC:Container id="mycontainer" runat="server" Title="some title"
Content=""
/>
And the file "mydropdowncontrol.ascx" contains only an normal
<aspropDownList ..> ... but I get the error, that it has to be between
the
<form runat=server> ... </form> tag.... But it is !!!
Where is the error?
Could somebody tell me an easier way to get the "results" of an
usercontrol
as an parameter for the next usercontrol ... Or is the method I used the
best?
Thanks for help,
Alex