Posts

Showing posts with the label Tipps

Lync and the "Cannot Generate SSPI Context" error

If you have this error, it is probable a Kerberos issue. Try to set the SPN of you SQL Service Account. Find out which user runs the SQL Service on your database server. Find out the port (Standard 1433) FQDN of the database server Use SetSpn -a MSSQLSvc/NX5015.swiss.group4net.com:1433 Reference: "Cannot Generate SSPI Context" error message, Poisoned DNS on MSDN

Debugging IIS 7.5 FTP Custom Authentication Provider

Image
A customers need was to have quickly an ftp server to share large files with some third party. The security restrictrions in our company need a two-factor autentication. So I had the idea to create a custom authentication provider where the user can provider his password and token in the ftp password field like password#token. In this post I will not explain how you create a custom authetication provider. This is explained very well on the links I'll post. I found this great blog post of Robert MyMurray where he describes how to create a custom provider with multiple examples. I followed his steps and realized that I couldn't debug the code I wrote with Visual Studio. Then I found this post on iis.net, which finally helped me to debug my code. Steps to debug: I assume that: You already created a solution and implemeted one of the examples of Rober McMurray or your own one. You signed your dll and deployed it to your Global Assembly Cache You installed and co...

Using WebDav on IIS 7 to access UNC Paths

Image
In this post I want to show you step by step how to connect to a file share using webdav on IIS 7. For this post I assume: that you have already an IIS installed on the server  that you have installed WebDav or enabled the WebDav Feature on IIS. the server on which is IIS installed can reach the file share. 1: CREATE APPLICATION POOL The first step is to create a seperate application pool on the IIS. Open the program "Internet Information Services Manager". Click on "Application Pools" Click on "Add Application Pool" on the right menu Name it "WebDav". Let the rest as it. Right click on the new created Application Pool "WebDav" and select "Advanced Settings". Pay attention to the following attributes: .Net Framework Version : No Managed Code Identity : The identity of the Application Pool should be an account which has permissions to read the file share. Load User Profile : Should be set to "False...

Replace row numbers from copied code

Image
This has nothing to do with SharePoint but I wanted to share the trick. When you copy code from some pages sometimes you have to copy the ugly row numbers, like 1: function XYZ 2:{ 3:     var a = b; You can delete these numbers easily with NotePad++ or another higher TextEditor. I use NotePad++ so I'll show you have I do that with NP. Copy the code into the editor Open the "Replace" dialog Check "Regular Expression" Enter the regular expression in "Find What" = \d*: (This can be any other regex) Enter nothing into "Replace String"

Network Credential and Webpage could not be found error

Windows XP and 2008 offer the ability to save credentials for websites and other network resources. Yes this is good to know if you have the following problem: You want to manage your SharePoint Server and each time you enter the url of your SharePoint Site a credential  window pops up of a user who possibly installed something on the server and saved his credentials. You say huh and try to delete the browsing history of your browser. Nothing changes and the credential window pops up if you type the url. You notice that this happend only if you want to surf to the url and not when you type another url which is used for the same webapplication. More worse is when nothing happens. You only see a message with "The webpage could not be found". You check your IIS and everthing seems fine. No error messages. Probably you see in the IIS logs a user which you don't know. The problem is that someone saved his credentials for the url. To delete these crendentials click Sta...

Creating a Custom Validator Control in .Net

The ASP .Net has its own form validation framework. This framework consists of: Base Validation Class, the BaseValidator ASP Validation Controls A Clientside Validation JavaScript Framework The "Base Validation Class" is the base of all validation controls and is also used to create own custom controls. If you want to create your own validation control, you have to inherit from the base class. The ASP validation controls are basic validation controls provided by Microsoft. These are: RequiredFieldControl : Checks an input field if its empty CompareValidator : Compares the value of a field with another value. This can be a value in another field or a constant value. RangeValidator : Checks if the value in a form field is within a range RegularExpressionValidator : RegularExpression validators are used to check if the value in a control matches a pattern defined by the regular expression. CustomValidator : If none of the Validators are useful for a purpose, you c...

Documentation of C# Code with SandCastle and Visual Studio 2010

Image
In this post I'll show you, how you can create a documention of your code. In the past ndoc was the tool to create code docus but the project seems to be dead. Therefore we use SandCastle, a freeware tool, that is also used by Microsoft to create Code-Documentations. Here is the reference of the comments within visual studio: http://msdn.microsoft.com/en-us/library/b2s063f7.aspx http://msdn.microsoft.com/en-us/magazine/cc302121.aspx First of all you need to install these things in the given order. Download and install SandCastle  http://sandcastle.codeplex.com/releases/view/47665 Download and install SandCastle Help File Builder (shfb). This is a gui for SandBox. Sandbox is mostly a command line driven tool, with a poor gui. This tool helps to create the documentation easier.  http://shfb.codeplex.com/releases/view/40105 If you want to create MS specific .chm (Compiled Html Help) files, download and install htmphelp.exe. http://www.microsoft.com/downloads/en/d...

RegularExpressionValidator autocomplete enter key problem in firefox

Image
I had some problems with the regularexpressionvalidator in firefox today. When I selected a value from the browsers autocomplete box, the field was validated to false. Autocomplete in firefox The validator throws an error The RegularExpressionValidator checks if the insert email address has the right format. If not than the validator outputs an error. In my case when I hit the enter key in the autocomplete box for the field, the validator message appeared, but when I hit the tab key all was fine. I digged a little into the javascript and found out that when I pressed Enter the value for the field to check in forefox was only the first character of the value entered. Therefore this was not a valid email address Then I found this post , that describes that this is a firefox bug The only solution for this problem seems to override the Microsoft core ValidateTextBoxOnKeyPress function somewhere in your page and check if the function is called in firefox. (I used here th...

Hooking into ASP Client Side Validation

The Problem: The ASP Validators are hard to style. The Validators only render a <span> with the error information. What if you want to display the complete div around the control to be red when an error occures? This is likely not possible with the standard asp validators. What you can do is o write a decorator in javascript. The function which displays the errormessages is the "ValidatorUpdateDisplay" method. 1: /** 2: * @requires JQuery 1.4.x 3: */ 4: var Biggy = {}; 5: 6: Biggy.Validator = { 7: /** 8: * Decorator for the ms validator update function 9: * 10: * @param {orig_fn} Function 11: * The function to decorate 12: * @return Function 13: * The decorated fucntion 14: */ 15: UpdateDisplayDecorator : function(orig_fn) { 16: return function(){ 17: var originalfunc = orig_fn.apply(this, arguments); 18: Biggy.Validator.UpdateParentDisplay( arguments[0] ); 19: return originalfunc; 20: };...

JediScript - Objektorientiertes JavaScript

Ich arbeite momentan an einem Whitepaper, in der ich meine Erkenntnisse mit objektorientierten JavaScript zusammenfasse. Es ist eine Zusammenfassung von den grundlegenden Prinzipien bis hinzu Konzepten in produktiven Umgebungen. Heute stelle ich eine Vorschau von 20 Seiten zur Verfügung. In meiner freien zeit versuche ich das Dokument zu vervollständigen. Inhalt in diesen 20 Seiten sind: Einleitung Wieso OO Typen in JS Michale JSON - Who is it Unterschied defined & null Funky functions Die magischen Klammern Do you know what this is? delete private und public Properties Namespaces Die Var-polizei Closures Download JediScript (pdf - 757kb)

Include Javascript and CSS Compression in Visual Studio

Image
For a frontend developer it is a must to compress his javascript and css files, before deploying a website to a productive environment. In this post I'll demonstrate how you can automate this process in Visual Studio. First of all download the YUI Compressor for .Net . (3.5) Extract the zip file and copy the to files into a folder in your visual studio solution. I have a folder called "Libraries" for third part dll files. YUI Dlls Create a file "MSBuildCompress.xml" in a folder you want. I put this file in my "_Tools" folder. Custom Compress Msbuild Task Put the following xml in your newly created xml file. <?xml version="1.0" encoding="utf-8"?> <!-- Author Baris Bikmaz --> <!-- MSBUILD Task to compress css and js files with the yui compressor --> <Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003">     <UsingTask         TaskName="CompressorTask...