Thursday, April 30, 2009

ASP.NET MVC Membership Group @ Google

For those people which are using my ASP.NET MVC Membership they getting invited to a google group to discuss issues or suggest features.

Homepage: http://groups.google.com/group/aspnet-membership

checkout the following links for more information about ASP.NET MVC Membership Administration:
1) http://netrsc.blogspot.com/2009/04/membership-management-for-aspnet-mvc.html
2) http://netrsc.blogspot.com/2009/04/aspnet-mvc-membership-management.html






Google Groups

ASP.NET Membership

Visit this group










Google Groups

Subscribe to ASP.NET Membership

Email:


Visit this group

Wednesday, April 29, 2009

ASP.NET MVC Membership Management

With the release of Microsoft Visual Studio 2005, there is no "out of the box" solution for maintaining the Membership and Role databases in Microsoft IIS. This is a problem when you move your application from development to a production IIS server. The utility that Microsoft provides, ASP.NET Web Configuration, can be run only in a development, non-production environment.

This sources and its associated code solve this by implementing a solution to Member and Role management while using standard Microsoft ASP.NET MVC tools. This means that it will run in any ASP.NET MVC 1.0 environment, including IIS.I found 3 projects for membership management were 2 of them are outdated and one is not working with current asp.net mvc release 1.0 (ASP.Net MVC Membership Starter Kit). Some of my code is based on the started kit but most stuff I had to rewrite or make coding changes to make it work with asp.net mvc release 1.0

In my previous blog I added some print screens how the asp.net mvc membership management looks like: http://netrsc.blogspot.com/2009/04/membership-management-for-aspnet-mvc.html

Since I'm developing already various open source projects I decided only to share this Visual Studio Content Installer for a donation of 30 EURO - (http://www.ronischuetz.com/donate.html). Once you have donated given amount you will receive an email with the download link. Please notice that any further updates are given out for free.

Instructions how to use the Visual Studio Content Installer for Asp.Net MVC Membership Management Template.

1. After downloading the given file you need to extract the zip file and you receive a *.vsi file. Upon double click on this *.vsi file the following screen appears. I decided not to sign it therefore is there no publisher details available.


2) If you use the link "View files in Windows Explorer" an explorer window opens and you should see the following screen.


3) Upon next button you receive the following screen - this happens because I havent added any digital signature.



4) Upon "Finish" the template will be installed.



5) The following screen informs about successfully installed asp.net mvc membership template.



6) Open a new instance of visual studio and select under Project Types: "WEB". In the section of "My Templates" you find the new installed ASP.NET MVC Membership Template. Enter an application name and select your favorite location.



7) As result of the project creation a normal MVC template will be installed with the asp.net mvc membership extensions. All files and folder which are marked with green color are added to the default project structure.

8) from this point you have a runnable asp.net mvc project. the missing part now is to add a asp.net membership database. If you have already one you only need to update your web.config file to your database.
Copyright Statement and Terms of Use

I reserves the right to modify these Terms of Use without notice and any modifications are effective when they are posted here. I may, at any time, in its discretion terminate your access to this Website and Software. If you are accessing this Web Site as a representative of an organization, these Terms of Use bind both you individually and the organization and references to "you" and "your" shall be construed to apply to you individually and the organization.
Disclaimer; Limitation of Liability; Indemnity

This Software and all information is provided "AS IS" and WITHOUT WARRANTY OR CONDITION OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING THOSE REGARDING THE ACCURACY OR COMPLETENESS OF THE INFORMATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT AND THOSE ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. It is up to you to take precautions to ensure that whatever you select for your use is free of such items as viruses, worms, trojan horses and other items of a destructive nature.
IN NO EVENT I'LL BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, THOSE RESULTING FROM LOST PROFITS, LOST DATA, LOST REVENUE OR BUSINESS INTERRUPTION) ARISING OUT OF THE USE, INABILITY TO USE, OR THE RESULTS OF USE OF, THIS SITE OR ANY SITE LINKED TO this blog or my personal WEBSITE: WWW.RONISCHUETZ.COM or WWW.RONISCHUETZ.NET. WITHOUT LIMITING THE FOREGOING, I SHALL BE NOT LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES THAT MAY RESULT FROM THE USE OF THIS SOFTWARE OR WEB SITE OR ANY WEB SITE INFORMATION WHETHER ARISING UNDER CONTRACT, NEGLIGENCE, TORT OR ANY OTHER LAW OR CAUSE OF ACTION.
SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY. ACCORDINGLY, SOME OF THE ABOVE MAY NOT APPLY TO YOU.
You agree to release, defend, indemnify and hold me harmless from and against any and all claims, liabilities, damages, losses or expenses, including reasonable attorneys' fees and costs, arising out of or in any way connected with your access to or use of this Software, Web Site or any Web Site Information.
Export and Trade Controls
You agree not to import, export, re-export, or transfer, directly or indirectly, any part of this Software, Web Site or any Web Site Information provided on or pursuant to this Web Site except in full compliance with all United States, foreign and other applicable laws and regulations.

Monday, April 27, 2009

ASP.NET MVC Action Filters project started at codeproject

I created a new project at codeplex which aims to contain a big collection of ASP.NET MVC Action Filters.

An action filter is an attribute you can slap on an action method in order to run some code before and after the action method executes. Typically, an action filter represents a cross-cutting concern to your action method. Output caching is a good example of a cross-cutting concern.

Hopefully a lot of people will provide their own Action Filters to create one big library which contains dozens of filters.

I found already several ASP.NET MVC Action Filters which solves the following problems:

  • Action Filter for Caching
  • Action Filter for Shared Cache
  • Action Filter to create easy REST API with JSON and XML
  • Action Filter for Health monitoring
  • Action Filter for LogFilters
  • Action Filter for Compression

If you have additional Action Filters please feel free to post them at http://mvcactionfilter.codeplex.com/.

Following link leads you to a tutorial about ASP.Net Action Filters: http://www.asp.net/learn/mvc/tutorial-14-cs.aspx

Sunday, April 19, 2009

ValidateInput Attribute in ASP.NET MVC - Potentially Dangerous Request.Form Values

By default, your controller actions will validate the Request.Form contents for potentially dangerous values. You will know this, because if you attempt to enter HTML tags in a form when submitting it:


e.g: <>

You will get the “A potentially dangerous Request.Form value was detected from the client...“ error as shown here:




ValidateInputAttribute in ASP.NET MVC
To get the validation of the Request.Form Values to turn off, there is a ValidationInputAttribute in the ASP.NET MVC Framework that you can use to decorate your MVC Action Methods or Controller Class to turn off input validation:

[AcceptVerbs(HttpVerbs.Post)]
[ValidateInput(false)]
public ActionResult Create(string title)
{
// Do Something...
}

Notice the ValidateInput Attribute above and the fact that I turned off validation by passing false to it.

If you look at the source of the ASP.NET MVC Framework you will see that the ValidateInput Attribute is masquerading as an IAuthorizationFilter so that it will be one of the first filters to run when a controller action is run. During the OnAuthorization Method it just quietly sets the controller's ValidateRequest Property to the value you passed to it ( false in this case ). That value of the property controls whether ValidateInput gets called on HttpRequest when the ControllerActionInvoker is invoking the action.

Good stuff to know as you start working with the ASP.NET MVC Framework.

Friday, April 17, 2009

IIS log analyzing tool based on LogAnalyzer

Indihiang Project is a IIS log analyzing tool based on LogAnalyzer. This tool analyzes IIS Web server in comprehensive graphs and reports. The project is located at codeplex: http://indihiang.codeplex.com/ and makes a very good impression. I could easly analyze IIS Logfiles which have a size of 1.2 GB and a bit more.

Project Features:
  • Web Log Viewer
  • Web Log Analyzer
  • Web Log Consolidation
  • Web Log Real-time Monitoring
  • Support for IIS6 and IIS7
  • Trend Data Analysis
  • Trend Data Reporting

Thursday, April 16, 2009

Change PROMPT default output

You can add within your Environment Variables the following value for variable PROMPT:

SET PROMPT=$T $P$G$S

If you don't have administrative rights then add this within user variables instead of system variables:



that's how the output looks like:



thanks to ronald for this tip.

Wednesday, April 15, 2009

takeover of Shared Cache?

please read the following thread: http://sharedcache.codeplex.com/Thread/View.aspx?ThreadId=53282

Membership Management for ASP.NET MVC release 1.0

update: checkout this post: Visual Studio Content Installer for Asp.Net MVC Membership Management

With the release of Microsoft Visual Studio 2005, there is no "out of the box" solution for maintaining the Membership and Role databases in Microsoft IIS. This is a problem when you move your application from development to a production IIS server. The utility that Microsoft provides, ASP.NET Web Configuration, can be run only in a development, non-production environment.

This sources and its associated code solve this by implementing solution to Member and Role management while using standard Microsoft ASP.NET MVC tools. This means that it will run in any ASP.NET MVC 1.0 environment, including IIS.

I found 3 projects for membership management were 2 of them are outdated and one is not working with current asp.net mvc release 1.0 (ASP.Net MVC Membership Starter Kit). Some of my code is based on the started kit but most stuff I had to rewrite or make coding changes to make it work with asp.net mvc release 1.0.

I'm writing already 2 open source projects therfore I'm not able to share this sources for free and I plan to sell you full source bundle for around 30 EURO. In the meanwhile, if you're interessted in the code you welcome to drop me a line (schuetz [@] gmail [dot] com).

Please use this page to donate the amount.


Please notice that MVC is a precondition for this project.

The asp.net mvc membership management contains the following functionality:

  • Dashboard
  • Browse Users
  • User -> Details
  • User -> User's Roles
  • User -> Reset Password
  • User -> Delete User
  • Browse Roles
  • Roles -> Users in Roles
  • Statistical Information
  • Statistical Information -> Registerd users past 7 days (visualization with chart.apis.google.com)
  • Statistical Information -> Registerd users past 12 months (visualization with chart.apis.google.com)
  • Statistical Information -> Not approved users past 12 months (visualization with chart.apis.google.com)

Additinal functionality will be implemented after rel. 1. Have a look at the following printscreens to get an impression what you'll get. I plan to extend this unti l its gonna be a real managment application and as more people will use it as bigger the motivation :-)

INFO: ALL UPDATES WILL BE FREE!!














Monday, April 13, 2009

Compare DateTime - Linq and orderby

I had to create a small chart about Asp.Net Membership users. The easy way how to do this is to use the Method GetAllUsers(). Once we loaded all Membership data we ready to run over our data with 2 simple LINQ statements:

      DateTime now = DateTime.UtcNow;
Dictionary<datetime,> day = new Dictionary<datetime,>();
for (int i = 0; i < 7; ++i)
{
DateTime compareDate = new DateTime(now.Year, now.Month, now.Day);
compareDate = compareDate.AddDays(-i);
var d = from a in data
where a.CreationDate.Year == compareDate.Year &amp;&amp;
a.CreationDate.Month == compareDate.Month &amp;&amp;
a.CreationDate.Day == compareDate.Day
orderby a.CreationDate descending
select a;
day.Add(compareDate, d.Count());
}

Dictionary<datetime,> month = new Dictionary<datetime,>();
for (int i = 0; i < 12; ++i)
{
DateTime compareDate = new DateTime(now.Year, now.Month, now.Day);
compareDate = compareDate.AddMonths(-i);
var d = from a in data
where a.CreationDate.Year == compareDate.Year &amp;&amp;
a.CreationDate.Month == compareDate.Month
orderby a.CreationDate descending
select a;
month.Add(compareDate, d.Count());
}

Velocity CTP3 Released

Microsoft this week rolled out the next community test version of a distributed cache platform code-named "Velocity" that promises to speed up .NET-based applications.
Velocity CTP3 (Community Technology Preview 3) was published on Tuesday and can be downloaded here. The CTP3 represents pre-beta testing; it's of interest mostly to technical reviewers.

Saturday, April 04, 2009

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge