I am developing a publishing portal in SharePoint. The page layouts, master pages are designed using Visual Studio and I deploy the page layouts into the content database using wspbuilder.
I have a requirement wherein I have to access the controls of the page layout in code behind and assign or get values to/from the controls. But, the VS intellisense never shows the controls used in my page layout. What should I do in order to access the controls using code behind?
Is there any workaround for this?
Regards,
Raghuraman.V
I guess that you have the page layouts and the code-behind in two different projects or at least in two different locations. You can also use ‘real’ code-behind pages in SharePoint that are side-by-side with the ASPX file so that you do not have to re-declare the controls at all.
To do so you can create the Visual Studio project for the WSP package as an
“ASP.NET Web Application”, create ASPX pages with code-behind files side-by-side and use WSP
Builder to remove the C# files from the package (the code is still compiled into the assembly and deploy with it). The trick works because WSP Builder can be
configured with a local configuration file within the Visual Studio project to remove certain file
types.
Here the local WSPBuilder.exe.config file: