Hello all,
I have to write a web part for a SharePoint 2003 server. We only have one SharePoint server, so developing directly on it isn't really viable. So I've planned to do the majority of the debugging using plain old ASP.NET 1.1 on a local machine.
The problem I'm running into is that web parts have a form behind the scenes and you can just add your controls to the pages (parts) Controls collection. Normal Pages do not. Also, (SharePoint) web parts force you to generate all the HTML through code using the RenderPart method. As I'm trying to keep things similar, I'm only using the Render method. Trying to add the server form through code properly hasn't been working for me.
I figured I'd just be able to do a two line comment swap to switch from the forms control to the pages Controls collection when I wanted to, but I can't seem to get it's runat attribute = to server in code. MSDN helpfully doesn't include a members list for the HtmlForm class for framework 1.1 (at least not that I found) and all examples just involve the <form blah> which I can't use.
Does anyone know how to do this?
I think I might be able to find a way around by keeping the <form > thing and doing a find control to get it... but that is even uglier and I don't see why I can't just set the runat attribute in code.
Thanks in advance,
-mwalts
I have to write a web part for a SharePoint 2003 server. We only have one SharePoint server, so developing directly on it isn't really viable. So I've planned to do the majority of the debugging using plain old ASP.NET 1.1 on a local machine.
The problem I'm running into is that web parts have a form behind the scenes and you can just add your controls to the pages (parts) Controls collection. Normal Pages do not. Also, (SharePoint) web parts force you to generate all the HTML through code using the RenderPart method. As I'm trying to keep things similar, I'm only using the Render method. Trying to add the server form through code properly hasn't been working for me.
I figured I'd just be able to do a two line comment swap to switch from the forms control to the pages Controls collection when I wanted to, but I can't seem to get it's runat attribute = to server in code. MSDN helpfully doesn't include a members list for the HtmlForm class for framework 1.1 (at least not that I found) and all examples just involve the <form blah> which I can't use.
Does anyone know how to do this?
I think I might be able to find a way around by keeping the <form > thing and doing a find control to get it... but that is even uglier and I don't see why I can't just set the runat attribute in code.
Thanks in advance,
-mwalts
Comment