简体   繁体   中英

how to add C# code in default.aspx in SharePoint

I am using SharePiont Server 2007 Enterprise with Windows Server 2008 Enterprise. I am developing using VSTS 2008 + C# + .Net 3.5. I want to add some C# code to default.aspx (more details, adding some logics to Page_Load method of default.aspx) and its code behind file. But I did not find default.aspx and its code behind file on disk? Where are they and how to modify?

BTW: another solution is to create a default.aspx file and its related code behind file by myself? But in this situation how to borrow the existing content/UI from current default.aspx (I am satisfied with current content/UI of default.aspx)?

I am not sure which solution is better and easier in my requirement to add C# code to Page_Load. Any advice or guides?

What kind of functionality are you trying to add and is this a publishing page or part of a standard WSS site?

EDIT

Check out Andrew Connell's article on MSDN :-)

http://msdn.microsoft.com/en-us/library/bb986729.aspx

Just a thought. How about creating a UI-less web part and adding it to the page ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM