I'm using EWL and I have an EwfPage
and when I type partial
in the Info
class I see:
partial void initDefaultOptionalParameterPackage( OptionalParameterPackage package )
and
partial void initUserDefaultOptionalParameterPackage( OptionalParameterPackage package )
I don't really see what they're used for. They also sound similar and I'm wondernig what the difference between them is.
They are both used if you want an optional parameter to default to something other than the default value of its C# data type. There are two significant differences:
initUserDefaultOptionalParameterPackage
is called only when you are creating anInfo
object for the page; it is not called when the page is requested. If a request is made without a parameter value in the URL, the framework will fall back to the value specified ininitDefaultOptionalParameterPackage
or the data type default.AppTools.User
frominitUserDefaultOptionalParameterPackage
if you meet the conditions specified in the doc comment forAppTools.User
.An example of when you might use
initUserDefaultOptionalParameterPackage
is a page that should default to showing information for the currently logged-in user but has a select list or something that lets you look at information for a different user.