Blog Stats
  • Posts - 3
  • Articles - 0
  • Comments - 111
  • Trackbacks - 0

 

Tuesday, May 05, 2009

IIS System.Web.AspNetHostingPermission exception on Windows 7 RC


I recently upgraded my office workstation to Windows 7 RC from Vista SP1. Everything in the upgrade went smoothly, until I after installed the IIS 7 server components and tested my sites on my local IIS server.

When loading any asp.net site, I received the following error:

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I configured my usual permissions for the temp folders, .NET Temp folders, Application Pool security accounts and IIS Virtual directories. After doing some digging, I found several articles that pointed to changing the Trust Levels in the Security Zones for the Machine to Full Trust, however this did not correct the issue.

Anyway ... After much trial and error, it seems that the Application Pool setting, "Load User Profile=True" was the solution. It was set to False by Default. This is not a new setting of the application pools in IIS7, but it is now visible in the console.

 

In Windows Vista SP1, IIS 7 by default sets LoadUserProfile=True for you automatically, however it was not available in the console. This is why in IIS 7 this issue was not encountered on my previous Vista Development station. In Windows 7 RC this option is available in the Application Pool Advanced Properties and is set to False by Default.

It seems on Vista there were many cases when this setting needed to be set to false, but was not accessible via the console. The .config file had to be changed manually. In Windows 7 RC this setting is now available.

Wednesday, April 29, 2009

Skinning the ASP.NET AJAX Tab Control


The  TabContainer is an ASP.NET AJAX Control which creates a set of Tabs that can be used to organize page content. A TabContainer is a host for a number of TabPanel controls. You can change the look of the control by using the CSSClass property, however the styles must be overridden, and a slightly overlooked, but significant fact is that the GIF tab images must be redrawn if you are going to be changing the look of the tabs. The AJAX Control Toolkit can be found here: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Tabs/Tabs.aspx.

Here is the default appearance of the AJAX TabContainer.

Tabs Css classes

  • .ajax__tab_header: A container element that wraps all of the tabs at the top of the TabContainer. Child CSS classes:.ajax__tab_outer.
  • .ajax__tab_outer: An outer element of a tab, often used to set the left-side background image of the tab.Child CSS classes: .ajax__tab_inner.
  • .ajax__tab_inner: An inner element of a tab, often used to set the right-side image of the tab. Child CSS classes:.ajax__tab_tab.
  • .ajax__tab_tab: An element of the tab that contains the text content. Child CSS classes:none.
  • .ajax__tab_body: A container element that wraps the area where a TabPanel is displayed. Child CSS classes: none.
  • .ajax__tab_hover . This is applied to a tab when the mouse is hovering over. Child CSS classes:.ajax__tab_outer.
  • .ajax__tab_active: This is applied to a tab when it is the currently selected tab. Child CSS classes:.ajax__tab_outer.

You can find the default styles in the Toolkit solution in the "AjaxControlToolkit\Tabs\Tabs.css.

The tab appearance is divided into three sets of gif images comprising the elements of the tabs. An Active Tab, an In-Active Tab and a Hover Tab. For each set of tabs there are a corresponding number of GIF images that define its appearance. Mainly, a Left-Side, Main, and Right-Side.

The default Tab GIF Images for the control can be found in AjaxControlToolkit\Tabs\.

image

Here is the layout of the tab GIF Images as they appear on the TabContainer.

To do something a little more out of the box, you have to change both the CSS and the Images. Here we have a Black Theme with a Green Highlight and a Green Gradient Hover Effect.

First we copy over the default CSS Styles into your default.css and the Images into your App_Themes folder. Next, We’ll change the CSS to match our Black Appearance and change the style name to our custom name - DarkGoo, and then we change the reference to our custom GIF Tab images parts.

image

 

Next, using Paint or your favorite Image Editing Tool, You need to repaint the Default tab gif images, and then slice them out into the correct sizes.

 

Finally, in order to implement your new TabContainer Appearance, you will need to set the CSSClass property of your TabContainer to your new CSS Style.

Using C# Code-Behind Example:

AjaxControlToolkit.TabContainer MyTabContainer = new TabContainer();

MyTabContainer.CssClass = "DarthGoo__tab_xp";

 

The final Styles and images can be downloaded here. [Demo Code]

Enjoy!

 

 

 

 

 

 

 

 

Thursday, April 16, 2009

Microsoft Real-Time Translator Announced


 

At Mix09, the Microsoft Translator Team announced that they have released a preview of the very exciting in-place Translator Widget that works in conjunction with the current Windows Live Translator Site. They have provided an AJAX API to implement the translation functionality. Currently the feature is in Preview mode only and open to reviewers and testers only by Special Invitation.

 

To see a cool demo of the Translator Widget in action visit Laurent Duveau's Site.

As you can see from the code-snippet the widget requires an AppID similar to that of Windows Live ID.

<div id="MicrosoftTranslatorWidget" style="width: 200px; min-height: 0px; border-color: #3A5770; background-color: #78ADD0;">

<noscript>

<a href="http://www.microsofttranslator.com/BV.aspx?a=http://ww.microsoft.com">Translate this page</a><br />Translation powered by <a href="http://www.microsofttranslator.com">Microsoft® Translator</a></noscript></div>
<script id="MicrosoftTranslatorWidgetScript" type="text/javascript"

src="http://api.microsofttranslator.com/V1/Widget.svc/Embed?appId=A5GhD76AJoEx9q4jv_vaL4Jf03oVnyRaK&from=en&layout=ts"></script>

In Real-Time, the widget can be embedded in-place on any web page, and by a quick language selection and the click of a button, the page will immediately translate any page into a desired language available in the widget.

In addition to translation, the widget offers other cool features such as UI Customication, Localization and best of all its FREE!

UI Customization:

Localization:

 

Currently the widget only supports the following languages, with more coming in the future.

· Arabic

· Chinese (Simplified & Traditional)

· Dutch

· French

· German

· Italian

· Japanese

· Korean

· Polish

· Portuguese

· Russian

· Spanish

For more information you can visit Windows Live Translator Blog on msdn.

 

 

Copyright © ProjectLawson