Reputation: 2471
I am brand new to Sitecore and have been asked to extend the company's existing website with some new features.
I've been reading alot on the internet and checking out the website as it is now. However I can't seem to find where to add logic on the serverside. Simular to what you would do with PHP code when a POST occurs.
I need this for multiple reasons: generating a pdf, sending an email, extracting data from Excel sheets...
FYI: We are using Sitecore version 6.x
Thank you for your time!
Upvotes: 0
Views: 194
Reputation: 7994
The basic flow I would usually follow when looking to extend a Sitecore build I've never seen before is as follows:
From here, you can do a few things. You can either choose to edit one of the existing controls, or add your own. If you are editing an existing one, you'll want to look at the sublayout/rendering and figure out its path in your solution and modify the matching ASCX in the .NET solution. If you have created your own, you'll need to make sure a sublayout is defined in the Sitecore database to match to your code, and then add that Sublayout to the list of controls for the page.
Upvotes: 0
Reputation: 2271
Very broad question, so the answer would be very broad.
Basically you'd be either using the Page_Load method (and checking IsPostBack) or calling your own on method, which gets run at "the end" of the life cycle (simplified).
But this is basic Asp.Net stuff and not really something that is Sitecore specific. The only thing to watch with Sitecore is if the layout/sublayout etc is cached, as this is output caching and a postback will just return the same html as before.
And if I was to do something like generate af pdf from the current page, I'd use a GET and just link to the same page, but with something in the query string that hits another Device, that does the PDF rendering. Eg. /news/2012/news1.aspx?pdf=1
Browsers handle GETs better with regards to the Back button and using a POST for something that changes data (see http://www.w3.org/2001/tag/doc/whenToUseGet-20040321#checklist )
But as I said I sound to me more like what you need to look into is standard Asp.Net
I hope this helps.
Upvotes: 1