Sorry but it currently does not support password protected web sites. I'll add that to my list of things to do. I currently have very little time to develope the app and that effort is put into fixing issues with wsdl:import element.
Although this should not be hard to implement (you are referring to simple HTTP username/password, right?)
I don't think you should use my approach of virtual views to create dynamic menus for users.
You are talking about menus, so I assume you have a repeating list of elements, maybe on multiple levels (sub-menus). I would recommend doing only one view to display your menu structure.
What I would then do in the model or controller, is filter the list based on the role of the user. Maybe even load only those elements (from the datastore) which the current user has rights to.
By including this kind of logic in your Views, you are going against the Model-View-Controller pattern. Your view should be dumb - just display the things it gets. Simple if statements are acceptable or things that affect how things look ("is this a green button or a blue button").
But doing conditional logic that affects WHAT is displayed is something I would leave to the Model itself. The Menu view should already get a filtered list of the items to be displayed.
Andrew, this is an old article. I think I looked at some sort of Globalization support back when I originally wrote it, but did not find it good enough / mature enough. Two years is a long time, I am glad to see better support is now available! Thanks for the contribution. I like how you wrapped the original validators.
I still think this should be wrapped into a plugin or something, so you could just drop it in, and you wouldn't have to manually start registering new validators with globalization support.
Very interesting and thank you for the article.
I wanted to use this for creating dynamic menus and needed your advice
Option 1:
If (role==admin)
load partial_view_admin
if(role==user)
load partial_view_user
if(role==agent)
load partial_view_agent
This requires me to create x views for x roles. So this is out
Method 2:
The other approach was to render the menu options dynamically in the partial view
MenuObj = getmenudetailsformdb() /// cache once read from the db
if(role==admin)
menu.show
menu.action = db.action;
menu.controller = db.controller
Method 3:
and the third is the way you have shown in the example above
if(role==admin)
load partial view dynamically for admin from the db and cache the result.
I was wondering if you could help me decide between method 2 and 3 with regards to performance and ease of maintenance. With method 2, I still need to create the menu object from the cache well as in case of method 3, I load the partial view itself from the cache. Hence the confusion.
Please advise.
Michael Moser1, the download section now has the tool available in binary form. It was also updated just now with some fixes and small feature. Sorry it took so long
Brian, if your web serivce has a WSDL schema, it should work with the tool. I have not done work with net.tcp binding, but I assume you can somehow extract the schema in those services as well?
It is true, that maybe my solution is not ideal. Maybe you should detect the culture setting of the user and use validation that matches that culture setting. Often however, clients want their web application to use a particular culture ALWAYS. When in Finland we have to use the comma in decimal values, regardless of the browser settings of the user. Is this a good idea? I'll let everyone answer that for themselves
As a side note, the truth is that software by default is often poorly localized or support for localization is often lacking. That's just my two cents.
Kevin, I did not try this with Razor yet, so I cannot say how you would do that.
wirol, I don't understand your question. Validation would work the same way in the views that are served from the database as they would work with regular views?
Andrej, good idea to try with partial views.
Maybe I will revisit the subject given how much time passed since the article was published and add support for Razor and partial views