ImageGear for .NET
Data Provider Selection

Because of the distributed nature of the web, data content can be stored in different data repositories such as files and data bases. The ImageGear ASP.NET services support the data provider model where any provider can be used to acquire or store data from a specific data store entity. The Image Data Provider Configuration can have more than one image data provider model defined with a default attribute selecting the implicit data provider to use when no provider is explicitly named. Each provider denoted in ImageGear.Web.DataProviders.ImageProvider section of the web.config file is named and it is that name which can be used by the web client application to pick a different image data provider rather than using the default provider.

To select a data provider, the provider name is combined with the document identifier name separated by a special character or string sequence and used wherever a document identifier is requested. For controls like PageView, there is a DocumentIdentifier property and for JavaScript code, there is the PageViewState class which has a documentIdentifier field. The default value separator is an “!” but can be changed to another string value but both the C# and JavaScript code pieces must be consistent in using the same token separator.

Developers writing their own custom provider should note that a new method, OpenImageData, has been added which should be used instead of the GetImage method. The GetImage method is not supported for multiple provider selection and is being deprecated.
The parseToken attribute value in the ImageProvider configuration section of the web.config file sets the separator value which will be used by the web application. The ImageGear ASP.NET services will use that token to separate out the data provider name from the document identifier and call the requested data provider passing along the document identifier parameter being requested. For an example, see the Tutorial sample which sets attribute parseToken=”:” in the web.config file and has two input buttons defined on the Default.aspx page which switches between two file providers.
See Also

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback