Can REST-like URLs be passed/recognized in sharepoint 2010?

41 views Asked by At

I know that REST can be used to query list data in SharePoint (even in SP 2010).

What I need, though, is a REST-like (not necessarily literally "canonical" REST) way to generate a Web Page.

Here is my scenario in more detail: I dynamically create controls via C# when the page (WebPart/User Control) loads. Also, based on user interaction, certain control/element properties can change - e.g, checking a particular checkbox could alter some properties on a related textbox (input control of the "text" type).

In a general sense, we need several "versions" of a page - some users will need these parts, other users will need only those parts; and it seems kludgy/recipe-for-disasterish to create N versions of the page (one showing sections 1,3,5; another displaying sections 2,4, and 6 etc. &c ad infinitum ad nauseum).

What I need to do in some scenarios is to conditionally set up these controls at page-load time, rather than making the user select this or that checkbox. More specifically, I want to break up the page/part/user control into logical "sections" and then generate those sections conditionally. e.g., if the part is named "duckbilledPlatypus", I'd like to be able to make the link something like "\duckbilledPlatypus\1\3\5" whereby I could respond to those args and know to programmatically/dynamically generate sections 1, 3, and 5, or make the link "\duckbilledPlatypus\2\4\6"whereby I would know to programmatically/dynamically generate sections 2, 4, and 6, etc.

Is this possible?

1

There are 1 answers

0
B. Clay Shannon-B. Crow Raven On BEST ANSWER

Perhaps kludgy, but maybe the way to do this would be to set a global variable on leaving the page that can be read from the next page. Something like (pseudocode):

enum FormFactors {
    Vanilla,
    Chocolate,
    Asparagus,
    Mantequilla de Cacahuate,
    Pineapple
}

FormFactors ff = null;

. . .

if (whatever) {
    ff = FormFactors.Vanilla;
} 
else // etc.

. . . on the page to be conditionally presented:

Page_Load() {
    if (ff == FormFactors.Vanilla) {
        // make it vanilla
    }
    else // ... etc.
}