Hi,
I'm getting the following error message when trying to run my aspx page....
Control 'drddropDown1' of type 'DropDownList' must be placed inside a form tag with runat=server
Basically, I'm trying to reponse.write a control on to the page.
It happens on the drddropDown1.RenderControl(myHtmlTextWriter)
code.
I dropped a dropdownlist control into a webpage(aspx), and then I call the function below with the control as an argument. Here is the code...
a Code:
Public Function BuildAndDisplay(ByRef drddropDown1 As DropDownList) 'I do stuff here, where I add items to the dropdownlist control Dim myTextWriter As New System.IO.StringWriter Dim myHtmlTextWriter As New System.Web.UI.HtmlTextWriter(myTextWriter) drddropDown1.RenderControl(myHtmlTextWriter) HttpContext.Current.Response.Write(myTextWriter.ToString) End Function
I'm baffled. I'm not sure what I'm doing wrong. :-(
My other concern, is if I get this to work, while I be able to get a postback on an event.
Any help is greatly appreciated. Let me know if you need more info from me.





Reply With Quote