c# - MVCSiteMapProvider with Webforms -
i have inherited hybrid mvc / webforms project, mvc portion uses mvcsitemapprovider create menus , webform portion uses custom built menu creation tool.
i have created custom mvcsitemapprovider nodes , port whole mvcsitemapprovider used in webform portion of project. possible @ all? can suggest strategies wedging/hacking in webform code?
thanks andy
although in theory should have working interoperability webforms, knowledge hasn't been tried or tested. then, if there no issues setting up, wouldn't have heard it.
to set up:
- add single xml file shared between asp.net , mvcsitemapprovider , configure of nodes there. make sure use namespace declaration mvc.sitemap file installed nuget package. note can safely add mvcsitemapprovider attributes , treated custom attributes xmlsitemapprovider (and ignored). make possible navigate between webforms , mvc, should use
url
attribute instead of configuringcontroller
,action
, etc. - webforms use xmlsitemapprovider , of controls utilize display menu , sitemappath. basically, set normal asp.net website using msdn documentation guide.
- mvc use mvcsitemapprovider , html helpers display similar functionality. note can customize html helpers or build own if need meet requirements.
- for security trimming, can use xmlrolesattribute webforms, , authorizeattribute in mvc.
- for localization, can pretty follow msdn documentation.
that of functionality default asp.net sitemap providers have, wouldn't have access visibility providers, dynamic node providers, or of other more advanced features of mvcsitemapprovider when working within webforms unless build own system.web.sitemapprovider
can handle details.
since none of html helpers post back, might able away just writing output of menu , sitemappath html helpers in webform, although skeptical work because html helpers templated, means work in mvc views. building own html helpers output html or output asp.net controls potentially possible because extension methods can called webforms.
please provide feedback opening new issue @ github.
Comments
Post a Comment