want to be a .NET star **{*}**?

you can not sing -

you are running slow-

you are not rich -

you haven't invented the wheel ?

perhaps you a good coder? we are looking for our German and Austrian sub's for upcoming .NET star's.  Several MVP's, authors and speakers come from us. If you want attend the star way, take a look at our web site.

sternelogo_sg

Posted by preishuber | with no comments

Visendo SMTP (pop3) Extender for Windows 2008 Server

We are migrating some web server from ppedv to windows 2008. IIS 7 is a great improvement. But as always in live, nothing is perfect and we miss the pop3 server from windows 2003.

Our software "visendo" department  have build several products around pop3 (popconnect) and smtp. So we build an extender for IIS Microsoft SMTP server. So you can now use pop3 client to read mails. The solution consists of a filesystem watcher which is moving from drop to other folder(s) fitting the destination address. We support domain and single account (more than windows 2003). Configuration is done with xml. config file by notepad. Visendo SMTP Extender is developed as service with c++ for performance reasons.

On bottom you find links for download first prototype. Support by blog comments. We will open up a support group on our www.visendo.com forums. At the moment product is free an without any warranty.

btw SMTP management is still no part of iis 7 so management is done by old mmc snap in.

[UPDATE]

x64 and x32 editons with minor changes

http://www.visendo.com/download/visendosmtpextender/VisendoSMTPExtender_x64.msi

http://www.visendo.com/download/visendosmtpextender/VisendoSMTPExtender_x86.msi

 

Posted by preishuber | 4 comment(s)

Visual Studio IIS 7 and WebDAV

Visual Studio 2008 have still no native WebDAV support. On the other hand Microsoft is stopping Frontpage Server Extensions development. Both of this web publishing protocols are *not* implemented in IIS7 standard installation. You can download the fitting modules on the iis7 website. If you decide to use WebDAV you have to do following configuration steps

1) Download (X86)

2) installation

3) Enable WebDAV on Site level

4) Enable Authentication BASIC

5) create WebDAV authoring rule which allows read, write for specific user

Steps are described with screenshots here

For visual studio you have to map a file share like

net use z: http://www.fileserver.de

The explorer redirector (which is included since win 2000) only accepts

a) windows authentication or

b) Basic authentication over https =ssl

For resources on the web we have to go way b).

We have to created and assign a certificate to the website on our iis 7. The self signed certificates of iis 7 have no possibility to change the domain name. So default name is always machine name. For solving that I decided to use selfssl from iis6 resource kit. You can install it on windows 2008.

Following code on command line creates an assign the certificate.

selfssl /n:CN=www.fileserver.de /v:1999 /s:1
Microsoft (R) SelfSSL Version 1.0
Copyright (C) 2003 Microsoft Corporation. All rights reserved.

Do you want to replace the SSL settings for site 1 (Y/N)?y
The self signed certificate was successfully assigned to site 1.

Ensure that the SLL binding is enabled in IIS7 site.

Then i opened the website over https   in browser ( Admin mode with uac)and installed the certificate in trustworthy root authority store of client machine. After that following on command line should work on client

net use z: https://www.fileserver.de
Geben Sie den Benutzernamen für "www.fileserver.de
" ein: Username
Geben Sie das Kennwort für "
www.fileserver.de
" ein:
Der Befehl wurde erfolgreich ausgeführt.

Then you should see in Vista explorer

image

Posted by preishuber | 3 comment(s)

360° Visual Studio 2008, where we are?

I attended as speaker the Bigdays Austria. My session was 360° Visual Studio which I made with Max Knor from Microsoft. Our goal was to give in 70 minutes a complete overview and to code five samples  which have a story line. In sum we had ~1000 attendees in our session. Bigdays is a kind of roadshow in four cities.

Story: new community for developers. Key points: Photo, name, preferedlanguages stored in XML file.

I did everything with VB and Max used C#.

Lesson learned: more than half of audience are using 2008 and less then 20% use VB :-(

1) Sample: Web page with Listview, LINQ2XML, AJAX AlwaysvisibleControlextender

Lesson learned: audience love it, nearly everbody is thinking about web development

2) Sample by Max: WCF with REST which shows developers depending URI

Lesson learned: only few people are using WCF right now. Even less knows about REST or JSON.

3) Sample by Max: codeless list with WPF, Pictures, Border, Text

Lesson learned: only 1 % have used WPF, Audience miss better UI support ( eg Databinding) in Visual Studio. Max did it pure XAML and audience don't like it.

4) Sample dropped: Windows Mobile: plan was to shoot pictures live and upload it to WCF service. Not enough time, cool sample

Lesson learned: there is so much to tell about Visual Studio 2008.

5) Sample VSTO: Use Smart Tags to display picture of developers in Word document.

Lesson learned: not enough time to code. Only drag an drop of code snippet from toolbar was possible. After running the sample I could feel the "aha" in the room. Was something complete new which I believe have nobody seen before.

So back to my question

Where we are?

Visual Studio 2008 is a quite useful tool for the job. You can do more with it than even before. This would the chance to make upselling to our customers to offer eg alternative UI like mobile, web or WPF. The problem is we have not enough Microsoft minded developers.

Posted by preishuber | 3 comment(s)

AJAX drag& drop challenge: science fiction with web.preview

Drag and drop is one of the missing features from the final ASP.NET 2.0 AJAX Extensions 1.0 (what a name). On my research work I figured out several ways to implement drag and drop and add profile support.

My next sample uses the ASP.NET 3.5 Extensions Preview. Earlier builds were named ASP.NET AJAX Futures. Both includes a microsoft.web.preview.dll (version in this sample 1.2.61025). That sample works without additional jscript code.

The idea comes from my visual studio which shows an extender which should be removed from toolkit some time ago. But it is here. 

image

It comes from installed 3.5 extensions.

After coping the microsoft.web.preview.dll into the local BIN directory of your website you have to add the tagPrefix in controls section of web.config.

<add tagPrefix="aspPreview" namespace="Microsoft.Web.Preview.UI" assembly="Microsoft.Web.Preview"/>

<add tagPrefix="aspPreview" namespace="Microsoft.Web.Preview.UI.Controls" assembly="Microsoft.Web.Preview"/>

Then you can add the DragPanelExtender Control which points to a panel control using attribut targetControlID. The position of the dragged panel will be stored in profile information as a single string. The name must be set by profileproperty attribut. Internal it must store x and y position. The attribut profileserviceID points to a new servercontrol profileservice. 

<asp:ScriptManager ID="ScriptManager1" runat="server">

<ProfileService LoadProperties="dragdropprofile.top,dragdropprofile.left"/>

</asp:ScriptManager>

<asp:Panel ID="Panel1" runat="server" BorderColor="#3333FF" BorderWidth="5px" Width="112px">

DragOverlay<br />

extender<br />

</asp:Panel>

<aspPreview:DragOverlayExtender ID="Panel1_DragOverlayExtender" runat="server" TargetControlID="Panel1"

ProfileServiceID="ProfileService1" ProfileProperty="dragoverlaystring" >

</aspPreview:DragOverlayExtender>

<asppreview:profileservice id="ProfileService1" runat="server" AutoSave="True">

</asppreview:profileservice>

Try it- The samples will store the new position of your panel also if you close the browser and reopen it. But- dont forget that is preview and can be changed by microsoft without any notice. Positive is that that function will be supported from microsoft. Documentation
Posted by preishuber | 1 comment(s)
Filed under:

AJAX drag drop Challenge: new with profile support

I have written a proof of concept blog post about drag and drop with AJAX toolkit. In my second part I will take a look at the possibility's to store the new position. I earlier builds toolkit control supports direct storing in profile. That feature was dropped from toolkit.

My goal is to use DragPanelextender and read and write panel position from profile store. So I use a Panel, DragPanelExtender and a Label as dragobject.

<asp:Panel ID="dragPanel1" runat="server" BackColor="#00CC66" Height="83px"

Width="138px">

<asp:Label ID="dragLabel1" runat="server" Text="Dragme!"></asp:Label></asp:Panel>

<cc1:DragPanelExtender ID="Panel1_DragPanelExtender" runat="server"

DragHandleID="dragLabel1"

BehaviorID="dragPanelBehavior1"

Enabled="True" TargetControlID="dragPanel1">

</cc1:DragPanelExtender><br />

First we have to register a Event when dragpanel have a new location on page. We use propertchanged when  Page and AJAX Application is loaded. The Function Storeposition1 will handle the communication to AJAX profile service. The function setPostion is reading the values and setting the position on loading the page.

<script type="text/javascript" language="javascript">

window.onload = function() {

Sys.Application.add_load(ApplicationLoaded);

}

function ApplicationLoaded()

{

setPosition();

$find("dragPanelBehavior1").add_propertyChanged(storePosition1);

}

In web.config following entry's are necessary

First the typical format information of Profile Service

<profile enabled="true">

<properties>

<group name="dragdropprofile">

<add name="top" type="Integer" allowAnonymous="true"/>

<add name="left" type="Integer" allowAnonymous="true"/>

</group>

<add name="hannes" type="string"/>

</properties>

</profile>

Second the settings for the application bridge of profileService. The sample enable read and  write of top and left within dargdropprofile group.

<system.web.extensions>

<scripting>

<webServices>

<profileService enabled="true"

readAccessProperties="dragdropprofile.top, dragdropprofile.left"

writeAccessProperties="dragdropprofile.top, dragdropprofile.left"/>

</webServices>

</scripting>

</system.web.extensions>

Then we can go to the "dragged" event storePosition1 and look for the new location of the Panel. Use the behaviorID from DragPanelextender.

function storePosition1(sender, eventargs)

{

if(eventargs.get_propertyName() == 'location')

{

var dragPanel = $find('dragPanelBehavior1');

var loc = dragPanel.get_location() ;

Sys.Services.ProfileService.properties.dragdropprofile.top = loc.x;

Sys.Services.ProfileService.properties.dragdropprofile.left = loc.y;

Sys.Services.ProfileService.save(null, onSaveSuccess, onError,null);

}

}

Cause callbacks to server can take a while and should not stop UI from responding, profile save is done asynchronously. Events for succes and error are needed.

function onSaveSuccess(result, userContext, methodName)

{

alert("saved");

}

function onError()

{

alert("not saved");

}

When you have values in aspnetdb profile table you can restore the position of panel on page load.

function setPosition(){

var x=Sys.Services.ProfileService.properties.dragdropprofile.top;

var y=Sys.Services.ProfileService.properties.dragdropprofile.left;

var newLocation = new Sys.UI.Point(x,y);

$find('dragPanelBehavior1').set_location(newLocation)

}

At the end don't forget the Scriptmanager as first control on your page. I use a trick to load the profile property's without code by declaration.

<asp:ScriptManager ID="ScriptManager1" runat="server">

<ProfileService LoadProperties="dragdropprofile.top,dragdropprofile.left" />

</asp:ScriptManager>

that should it be! have fun and extend it with your ideas.

 

 

 

 

Posted by preishuber | 6 comment(s)

the "it's free" problem: caching of images

a long time ago journalists were paid for investigate in story's. Today content is almost free. Blogger's dominate the world. The problem is also if 99% of the information is true and useful, 1% is wrong and dangerous. I found the following free article in web which describes some issues with images and caching.

http://www.codeproject.com/KB/aspnet/CachingImagesInASPNET.aspx

The general caching topic is not easy, it depends on a lot of variables. But caching of images is solved in a quite nearly perfect matter with IIS 6.

The article suggest that you have to write instead of default handling a ashx handler. Then you add some header information in response and send image to client like:

Response.Cache.SetExpires(Date.Now.AddHours(3))

Response.Cache.SetCacheability(HttpCacheability.Public)

Response.Cache.SetValidUntilExpires(False)

Response.AddHeader("content-dispostion", "inline: default.aspx")

You can do that also with a aspx page, should be the same result.

in short word's: thats wrong! 

1) i would not suggest network monitor to watch http traffic. Tools like fiddler are specialized for that task

2) i would not reinvent the wheel. Caching of images is solved

3) i would not redirect requests through additional code, especially when the amount of request is high and you want to optimize performance

4) Caching should be done in a 200- 304 matter. Server must decided if newer information is available and send a 304 message or the new content with code 200

5) caching of sample page of the author doesn't work like fiddler shows

 

don?t believe anything- including this post ;-)

Posted by preishuber | 2 comment(s)
Filed under:

LinqDatasource and Datapager Rocks

With small words. ASP.NET 3.5 Datapager support automatic optimized SQL paging for sql server 2000 and 2005 with LINQDatasource.

SQL 2005

SELECT COUNT(*) AS [value] FROM [Customers] AS [t0] -- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.21022.8 SELECT [t1].[CustomerID], [t1].[CompanyName], [t1].[ContactName], [t1].[ContactTitle], [t1].[Address], [t1].[City], [t1].[PostalCode], [t1].[Country], [t1].[Phone], [t1].[Fax] FROM ( SELECT ROW_NUMBER() OVER (ORDER BY [t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName], [t0].[ContactTitle], [t0].[Address], [t0].[City], [t0].[PostalCode], [t0].[Country], [t0].[Phone], [t0].[Fax]) AS [ROW_NUMBER], [t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName], [t0].[ContactTitle], [t0].[Address], [t0].[City], [t0].[PostalCode], [t0].[Country], [t0].[Phone], [t0].[Fax] FROM [Customers] AS [t0] ) AS [t1] WHERE [t1].[ROW_NUMBER] BETWEEN @p0 + 1 AND @p0 + @p1 ORDER BY [t1].[ROW_NUMBER] -- @p0: Input Int (Size = 0; Prec = 0; Scale = 0) [20] -- @p1: Input Int (Size = 0; Prec = 0; Scale = 0) [10] -- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.21022.8

SQL 2000

SELECT COUNT(*) AS [value] FROM [dbo].[PRODUKTE] AS [t0] -- Context: SqlProvider(Sql2000) Model: AttributedMetaModel Build: 3.5.21022.8 SELECT TOP 10 [t0].[ProduktID], [t0].[ProduktName], [t0].[ProduktVersion], [t0].[DownloadType], [t0].[DownloadURL] FROM [dbo].[PRODUKTE] AS [t0] WHERE NOT (EXISTS( SELECT NULL AS [EMPTY] FROM ( SELECT TOP 10 [t1].[ProduktID] FROM [dbo].[PRODUKTE] AS [t1] ) AS [t2] WHERE [t0].[ProduktID] = [t2].[ProduktID] )) -- Context: SqlProvider(Sql2000) Model: AttributedMetaModel Build: 3.5.21022.8

Posted by preishuber | with no comments

'ListView' is ambiguous in the namespace 'System.Web.UI.WebControls'.

When you have Visual Studio 2008 and ASP.NET 3.5 Extensions installed you may run in following error.

BC30560: 'ListView' is ambiguous in the namespace 'System.Web.UI.WebControls'.

In my case, this happens when i drag an drop a Listview Control from toolbar. Then Visual Studio adds following line in web.config

<

add assembly="System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies>

Remove it - and it should work again.

In a second case, same action, added following in ASPX page

<%

@ Register assembly="System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.WebControls" tagprefix="asp" %>

Remove it also

seems to be a bug from 3.5 extensions.

Posted by preishuber | with no comments
Filed under:

LINQ to SQL HOL VB.NET Code

Microsoft offers a hands on lab (HOL) which guides you step by step through creation of a application using LINQ. As always, somebody forgot to show the VB code.

Here it is

Imports System.Data.Linq Imports System.Data.Linq.Mapping

Module Module1

Sub Main()

Dim conn As String = "Data Source=.\sqlexpress;Initial Katalog=Northwind"

Dim db As DataContext = New DataContext(conn)

Dim customers As Table(Of Customer) = db.GetTable(Of Customer)()

db.Log = Console.Out

Dim custs = From c In customers _

Where c.city = "London" _

Select c

For Each cust In custs

Console.WriteLine("ID={0}, City={1}", cust.CustomerID, cust.City)

Next

Console.ReadLine()

End Sub

<Table(Name:="Customers")> _

Public Class Customer

<Column(IsPrimarykey:=True)> _

Public customerid As String

Private _city As String

<Column(Storage:="_city")> _

Public Property city() As String

Get

Return _city

End Get

Set(ByVal value As String)

_city = value

End Set

End Property

End Class

End Module

Link to linq HOL

Posted by preishuber | 1 comment(s)
Filed under: ,
More Posts Next page »