<%@ Register Src="~/controls/textLinkAds.ascx" TagName="textLinkAds" TagPrefix="tla"%> SuperWasp - Productivity tips, reviews, tools, software and gadgets.
SuperWasp

SuperWasp

Productivity tips, reviews, tools, software and gadgets.

 
Fix: Localhost unavailable with ESET NOD32

Developers using Visual Studio will probably encounter this problem after installing ESET NOD32 antivirus or ESET Smart Security Antivirus+Firewall: browsing the web with Internet Explorer works fine except for websites you develop yourself (localhost).

Screenshot with localhost unavailable

Disabling the firewall or antivirus features doesn't solve this problem, however replacing localhost with 127.0.0.1 (or using FireFox) does solve it.

The real problem is easily fixed though.

Windows Vista:

In the start menu, type "notepad %system%\drivers\etc\hosts" and instead of pressing enter, right-click on the notepad icon in the top of the list (see screenshot). In the context menu you must click on "Run as administrator".

Screenshot of Vista Start Menu with context menu

Windows XP and 2000:

Open a command prompt (cmd.exe) and type these commands:

cd %system%\drivers\etc

attrib -r -h -s hosts

notepad hosts

Screenshot of command prompt

You will then see the following file in notepad:

Screenshot of Notepad with the problematic Hosts file

The last line contains the problem. It reads:

::1             localhost

You can either remove this line and save the file, or comment it out with a pound/hash character #. Voila, fixed!

Labels: , , , , , , , , , , , , , , , ,

» Full Article

  Posted by oVan on Friday, March 21, 2008 | PermaLink | 2 comments
How-to enable adminstrative shares on Vista
When accessing Vista from a computer on the network, you'll soon discover that it's impossible to use the administrative shares we've known and loved for years (C$, D$, ...)

You might get this error message:
Logon unsuccessful:
Windows is unable to log you on.
Be sure that your user name and
password are correct.

The solution is to add the following key to the registry. Use regedit and navigate to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System and add a new DWORD labeled LocalAccountTokenFilterPolicy and set it's value to 1.

Although some sources state that you need to reboot the machine, I find it enough to logoff/logon your admin account. If you don't logoff or reboot, you'll get this error:
\\COMPUTER\c$ is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions. Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again.

Labels: , , , , , ,

» Full Article

  Posted by oVan on Thursday, April 19, 2007 | PermaLink | 0 comments
Adding a Content Role in MWPSK
Here's an easy solution to add a Content Editor role in the MyWebPagesStarterKit without defining a new role (which would take a lot of work):

Currently the authenticated user that is not part of the administrator role can do nothing more than an anonymous (unauthenticated user) user on the website.

So let's assume that those non-admin authenticated users are just content editors. We want them to be able to add/change the content of the defined section controls, without the ability to delete sections or to change the sitemap structure.

Here are the two easy steps to accomplish this:

1) Change the following in ~/Default.aspx.cs:


foreach (ISection section in _page.Sections)
{
SectionControlBaseClass ctl = (SectionControlBaseClass)LoadControl(section.UserControl);

if (User.Identity.IsAuthenticated && User.IsInRole(RoleNames.Administrators.ToString()))

Into:

foreach (ISection section in _page.Sections)
{
SectionControlBaseClass ctl = (SectionControlBaseClass)LoadControl(section.UserControl);

if ((User.Identity.IsAuthenticated))

The above change will enable the admin functions for sections on each page, whithout enabling the administration menu for administrators.


2) Change the following line in ~/SectionControls/SectionAdmin.ascx:

<asp:Button runat="server" ID="btnDeleteSection" OnClick="btnDeleteSection_Click" Text="<%$ Resources:stringsRes, glb__DeleteSection%>" CausesValidation="false" UseSubmitBehavior="false" />

Into:

<% if (Context.User.IsInRole(MyWebPagesStarterKit.RoleNames.Administrators.ToString())) {%><asp:Button runat="server" ID="btnDeleteSection" OnClick="btnDeleteSection_Click" Text="<%$ Resources:stringsRes, glb__DeleteSection%>" CausesValidation="false" UseSubmitBehavior="false" /><% } %>

The above change will remove the ability to delete section controls.

The result will enable authenticated users to update the content of the website, withouth the ability to destroy it :-)

Hope this helps!

Labels: , , , , , , , , , , ,

» Full Article

  Posted by oVan on Thursday, March 22, 2007 | PermaLink | 0 comments
Older articles are stored in the archives (see sidebar).