zaterdag, december 31, 2005

 

ASP.NET 2.0 Authentication API, Hell or tres belle?

I have 2 say, it´s not as easy as it looks to implement the new authentication controls. But once u get ur head around it, it works like a charm.

here some links and stuff u have 2 keep in mind:

!!! REMEMBER: THE ACCOUNT CREATING WEBCONTROL WONT WORK IN A PROTECTED FOLDER/FILE (web.config), you only get the 'cant show page' error with no extra info, drove me nuts to figure out!!

http://msdn2.microsoft.com/en-us/library/8ayhh5e2(en-US,VS.80).aspxhttp://msdn2.microsoft.com/en-us/library/yh26yfzy.aspx
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe
http://msdn2.microsoft.com/en-us/library/6e9y4s5t.aspx
http://fredrik.nsquared2.com/viewpost.aspx?PostID=353&showfeedback=true#feedbackhttp://forums.asp.net/1150474/ShowPost.aspx
only worked 4 me with (bug?):
minRequiredNonalphanumericCharacters="0"
http://aspnet.4guysfromrolla.com/articles/121405-1.aspxhttp://samples.gotdotnet.com/quickstart/aspplus/doc/authorization.aspx
http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx

ill post some webconfig and DB info later..

vrijdag, december 30, 2005

 

watch ur step when creating webcontrols on the fly

I ran into a nasty problem. When you know the solution its easy, but when you see this error description at first you might be puzzeld like i was. I was initialising a treeview in the
Page_Prerender event of the page, works fine (Dont ask me how it got there in the first place :-) ). Now, when i tryed to open the tree in 'runtime' i kept getting this error: "The target 'ctl00$ContentPlaceHolder2$ctl01' for the callback could not be found or did not implement ICallbackEventHandler." Somehow some Javascript stuff doesnt get generated i guess when creating the control in this stage of creating the page. Simple solution, move the creation to the
Page_Load event..

donderdag, december 29, 2005

 

mobile application development: webcasts

http://www.microsoft.com/events/series/msdnmobility.mspx

starting at th 4th of january

 

referentie

http://msdn.microsoft.com/msdnmag/issues/05/12/AdvancedBasics/default.aspx

know ur client and server, nothing fancy just reference

 

quote problems

Using the freetextbox (www.freetextbox.com) i ran into some nasty quote problems. When i was a VB programmer i never had these problems and now with c# it went wrong, well, here some helping links. And yes, be aware of security issues when coding a CMS! (injections) (Joe Hummel has done some nice webcasts on that subject too)

http://channel9.msdn.com/wiki/default.aspx/Channel9.HowToPreventCrossSiteScripting

http://code.cside.com/3rdpage/us/unicode/converter.html

Table 1: Character representation

http://channel9.msdn.com/wiki/default.aspx/Channel9.HowToPreventCrossSiteScripting

dinsdag, december 27, 2005

 

Prototype vs Atlas.aspx

As most of the time we developers have a hard time choosing the right path. Discussions become nearly religious. But here to help to make up ur Ajax path, an aricle about Prototype and its relation to Atlas.

When you want to know more about Atlas i recommend the PDC05 sessions http://aspnet2.com/PDC05/Sessions.htm about this subject. They are working on cool stuff, the only downpart of it is, is that it isn´t going to come out in the nearby future. What i like about Atlas is that it wraps all the nasty Javascript coding by its serverside controls. Personally i dont like javascripting manually, to much time consuming without a descent debug tool. When ur short on time, just wait a bit with the Ajax stuff to let it settle down first.

http://www.dotnetslackers.com/Atlas/re-17513_Prototype_vs_Atlas.aspx

 

FlashControl for ASP.NET 2.0

 

Improve performance using ADO.NET 2.0 batch update feature

When you use SqlDataAdapter for performing updates, the SqlDataAdapter propagates the updates one by one.


http://www.dotnetslackers.com/_NET/re-17537_Improve_performance_using_ADO_NET_2_0_batch_update_feature.aspx
http://www.dotnetbips.com/articles/displayarticle.aspx?id=487

zaterdag, december 24, 2005

 

another podcast series

donderdag, december 22, 2005

 

pdf thumbs

sample of how to create thumbs of pdf documents

http://www.developerfusion.co.uk/show/5091/

woensdag, december 21, 2005

 

nice reference site

not shocking, just commonhandy

http://www.xoc.net/default.asp

dinsdag, december 20, 2005

 

Upcoming Releases of Useful ASP.NET 2.0 Things

 

podcast

Number of techpodcasts. Makes your carrides more usefull :-)

Downloading at this moment, so no clue if they are good.. When u go 4 the best podcasts, visit pholymorphic: http://polymorphicpodcast.com/

new one i found
http://www.mariocardinal.com/podcast/Show/0008.html

 

mmm pdc05 sessions

Volledige serie sessies van de afgelopen PDC05 hier gratis te downloaden. Zijn grote bestanden, dus ga er maar even voor zitten :-)

All sessions of the PDC05 downloadable 4free!

http://aspnet2.com/PDC05/Sessions.htm

zondag, december 18, 2005

 

Top 4 Coolest Features in 2.0

 

Cross page navigation techniques in ASP.NET 1.x and 2.0

still parsing variables from page 2 page by the querystring and hidden fields?? if your answer is yes, read this article! Nice summary of different techniques.

http://blogs.msdn.com/tinghaoy/archive/2005/12/15/504357.aspx

Anyone has a clue how to retrieve viewstate variables who are not webcontrols?

like:
page 1:
this.ViewState.Add("jaap", "bladiebla");
page 2:
this.PreviousPage.ViewState["jaap"]

anyone?

http://www.dotnetslackers.com/ASP_NET/re-17066_Cross_Page_Navigation_Techniques_in_ASP_NET.aspx

http://metasapiens.com/PageMethods/

vrijdag, december 16, 2005

 

to null or not to null, c# 2.0 makes it possible

recently I had a discussion of how to handle null variables/datafields. Personally I always tried to avoid these cases but now C# 2.0 has a new feature, called nullable type. Look at the next sample:

int? myInt;

if(dbReader.IsDBNull(dbReader.getOrdinal("whatever")))
myInt = null;
else
myInt = System.Conver.ToInt32(dbReader["whatever"]);

Bassically myInt is a simple struct with a bit flag to check 4 null...

nice clean solution i guess..

!! note the question mark !! > int?
note: try to write more articles in english, for a bigger audiance :-)

- edit -

vb variant:
dim myInt as Nullable(Of Integer)

myInt = nothing

if myInt.equals(nothing) then
'null
else
'data
end if

not so smooth as the C# flavour, more homegrown style :-(

 

free .net, gratis online book..

aardig om even doorheen te neuzen, niet veel diepgang maar wel van alles wat..


http://www.learnasp.com/freebook/learn/

 

Cool SQL Server and SQL Express Command-Line Utility

Aardig tooltje, vooral voor het uitvoeren van sqlscript bestanden, dit is namelijk iets wat je mist wanneer je alleen mssql2005 express.

http://www.dotnetslackers.com/SQL/re-16981_Cool_SQL_Server_and_SQL_Express_Command_Line_Utility.aspx

downloadlink:
http://www.microsoft.com/downloads/details.aspxFamilyID=fa87e828-173f-472e-a85c-27ed01cf6b02&DisplayLang=en

 

15 seconds .net 2.0 section

 

Serialize generics

o.a. nuttig bij webservices

Generics are a powerful new feature in .NET 2.0, but it's not so obvious how to use them as return values from Web services, or how to bind them to controls. Find out how to serialize, data bind, and consume generic collections in ASP.NET 2.0

http://www.dotnetslackers.com/_NET/re-16979_Serializing_Consuming_and_Binding_Generics_in_NET_2_0.aspx
http://www.devx.com/dotnet/Article/30158?trk=DXRSS_DOTNET

donderdag, december 15, 2005

 

dynamic masterpage

I dont like static stuff, so i wanted to set the masterpage dynamically. This is possible, but the timing is critical! must be PreInit!


protected void Page_PreInit(object sender, EventArgs e)
{

this.Page.MasterPageFile = (string)System.Configuration.ConfigurationManager.AppSettings["masterpagespath"]+ sMyMaster;
}

 

Client Callbacks in ASP.NET Whidbey

Ajax wat de klok slaat, kom ik dit tegen, whidbey out of the box:

Client Callback is a new feature in ASP.NET Whidbey(2.0). It allows calling server side events asynchronously, without causing postback. It is possible to do asynchronous call using XMLHttp Post in ASP.NET 1.0 itself, but in ASP.NET 2.0 a clean framework is available to do this. This article describes how Client Callbacks works and also explores how this Client Callback framework has been implemented in ASP.NET 2.0.

http://www.extremeexperts.com/Net/Articles/ClientCallbacksinASPNETWhidbey.aspx
http://www.dotnetjunkies.com/Article/E80EC96F-1C32-4855-85AE-9E30EECF13D7.dcik
http://fredrik.nsquared2.com/viewpost.aspx?PostID=113

 

Microsoft Domain-Specific Language

This download contains a set of tools hosted in Visual Studio 2005 to enable building custom designers for visual domain-specific languages. The tools include a wizard that generates a complete designer solution, a graphical designer for domain models (metamodels) and a set of code generators.

http://www.microsoft.com/downloads/details.aspx?FamilyID=57a14cc6-c084-48dd-b401-1845013bf834&DisplayLang=en

 

Sample Code Generator 1.4.2.1

The Sample Code Generator (XSDObjectGen) tool takes an XSD schema as input and generates sample code showing how to mark up C# and VB.Net classes so that when serialized with the XML serializer, the resulting XML will be valid according to the original schema. This update fixes some documentation changes and corrects a problem where the wizard did not generate code in

http://www.microsoft.com/downloads/details.aspx?familyid=89E6B1E5-F66C-4A4D-933B-46222BB01EB0&displaylang=en

 

RegEx, split

Doel, tags en content splitsen in twee array´s

string[] s = Regex.Split("one{/tagje1/}t{wo{/tagje2/}banana", "{/[^/}]+/}");
System.Text.RegularExpressions.MatchCollection myCol = Regex.Matches("one{/tagje1/}t{wo{/tagje2/}banana", "{/[^/}]+/}");

twee regels code! pretty cool..

 

Whidbey ASP.NET V2.0 New Features

Handig overzicht:

http://www.extremeexperts.com/Net/Articles/ASPNETWhidbeyNewFeatures.aspx

Bezig geweest met url rewriting, dan loop je dus tegen het postbackprobleem aan, oplossing is ook op deze pagina te vinden.

nog een linkje over de beperkingen van PostBackURL:
http://weblogs.asp.net/pwilson/archive/2003/10/29/34597.aspx

woensdag, december 14, 2005

 

Smart Client - Composite UI Application Block

Are you building applications with complex user interfaces Do you want to take full advantage of the power of the Microsoft Windows desktop Check out this recently released application block that provides guidance on building world-class...

http://www.dotnetslackers.com/Smart_Client_Applications/re-16833_Just_Released_Smart_Client_Composite_UI_Application_Block.aspx

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/cab.asp

 

Guidance Automation Toolkit and Guidance Automation Extensions Download

Using the patterns & practices of the Guidance Automation Toolkit, you can make reusable code and pattern assets directly available in Visual Studio 2005.

download links werken op moment van schrijven niet, heb het dus nog niet kunnen bekijken..

http://msdn.microsoft.com/vstudio/teamsystem/Workshop/gat/intro.aspx

- edit - Download links werken weer..

dinsdag, december 13, 2005

 

urlmapping

Bezig geweest met urlmapping. Hiervoor een aantal opties gevonden. Persoonlijk heb ik het liefst een oplossingen die ook op sharedhosting servers toegepast kunnen worden (geen extra rechten nodig e.d.)

ASP.Net 2.0 heeft de mogelijkheid om in de config file een aantal mappings op te geven



Aardig, maar natuurlijk heeft de gemiddelde developer wat meer nodig dan een statisch xml setje.

Oplossing in global asax file is beter naar je hand te zetten, opzetje:

void Application_BeginRequest(Object sender, EventArgs e)
{
System.Web.HttpContext Context = System.Web.HttpContext.Current;
string myurl = Request.Path.ToLower();
if (!myurl.Contains(".jpg") && !myurl.Contains(".gif"))
Context.RewritePath("ContentPage.aspx?PageID=1");
}

alleen ter demo, alles wordt naar ContentPage.aspx?PageID=1 geforward.

Je kunt ook regex oplossingen gebruiken, zie hiervoor de links:

http://weblogs.asp.net/scottgu/archive/2005/11/14/430493.aspx
http://davidhayden.com/blog/dave/archive/2005/12/07/2613.aspx
http://weblogs.asp.net/ssmith/archive/2003/11/06/36191.aspx
http://www.willasrari.com/blog/index.php/2005/11/26/url-rewriting-dynamic-remix/

http://pietschsoft.com/Blog/archive/2005/11/12/762.aspx

 

upload addin voor vs2005

De standaard upload functies van VS2005 zijn niet super, hier een aardige addin die dat kan verbeteren:

http://www.csharper.net/blog/web_deployer_2005_for_visual_studio_2005.aspx

 

GRASP patterns

 

bunch of asp.net webcasts

Dive head first into an in-depth, hands-on learning environment with the Microsoft ASP.NET webcast series and come out a programming guru. More than 40 hours of free, on-demand training and valuable advice is available from industry leaders such as Rob Howard, Carl Franklin, and Ken Getz.

http://www.microsoft.com/events/series/msdnaspnetoct.mspx

 

Concurrency and Coordination Runtime

klinkt goed, wees niet bang voor de verteller, man! ADHD type.. Komt er op neer dat ze een lib hebben geschreven zodat ook ons simple mortals met threads kunnen werken..

http://channel9.msdn.com/Showpost.aspx?postid=143582

 

Microsoft Architecture JOURNAL5

maandag, december 12, 2005

 

google sitemap

Aardig artikeltje over het aanmelden van je sitemap bij google.

http://davidhayden.com/blog/dave/archive/2005/08/28/2443.aspx

 

wrap session, application and viewstate variables

Session, application en viewstate variables zijn niet getyped en ook nog eens niet te gebruiken met intellisense. Dat is natuurlijk zwaar niet bulletproof! Het schrijven van typed wrapper classes voor session en application variables bleek eenvoudig te doen echter blijf steken op de viewstate, das jammer, iemand een idee. Het probleem is dat ik de viewstate pointer niet over kan krijgen naar een wrapper.

aardig linkje:
http://www.codeproject.com/aspnet/PersistentStatePage.asp

zondag, december 11, 2005

 

email and asp.net 2.0

Sending Email with System.Net.Mail
.NET 2.0 includes much richer Email API support within the System.Net.Mail code namespace. I've seen a few questions from folks wondering about how to get started with it. Here is a simple snippet of how to send an email message from “sender@foo.bar.com” to multiple email recipients (note that the To a CC properties are collections and so can handle multiple address targets):

MailMessage message = new MailMessage();
message.From = new MailAddress("sender@foo.bar.com");

message.To.Add(new MailAddress("recipient1@foo.bar.com"));
message.To.Add(new MailAddress("recipient2@foo.bar.com"));
message.To.Add(new MailAddress("recipient3@foo.bar.com"));

message.CC.Add(new MailAddress("carboncopy@foo.bar.com"));
message.Subject = "This is my subject";
message.Body = "This is the content";

SmtpClient client = new SmtpClient();
client.Send(message);

System.Net.Mail reads SMTP configuration data out of the standard .NET configuration system (so for ASP.NET applications you’d configure this in your application’s web.config file). Here is an example of how to configure it:











http://weblogs.asp.net/scottgu/archive/2005/12/10/432854.aspx

 

aardige javascript tool?

klinkt wel aardig, nog niet getest:
http://www.nikhilk.net/Project.JSUtils.aspx

zaterdag, december 10, 2005

 

paging data

Altijd al een afweging tussen mogelijkheden geweest, paging in datasets. Vandaag een beetje aan het researchen hoe dat beter zou kunnen, kom ik een nieuwe feature van sql2005 tegen:

SP:

CREATE PROCEDURE dbo.ShowBlogPosts @PageIndex INT, @PageSize INT AS BEGIN WITH Posted AS ( SELECT ROW_NUMBER() OVER (ORDER BY PostID) AS RowNumber, PostID, PostDate FROM BlogPosts) SELECT * FROM Posted WHERE RowNumber between @PageIndex and @PageIndex+@PageSize END

Hhier kun je dus de page in meegeven, pretty cool.

Voor mensen die nog met 2000 aan de slag moeten:

SELECT TOP number_of_items_on_page *FROM tableWHERE id NOT IN (SELECT TOP offset id FROM table ORDER BY id)ORDER BY id;

Artikel:

http://codebetter.com/blogs/sahil.malik/archive/2005/12/09/135529.aspx

woensdag, december 07, 2005

 

Open Source and Visual Studio

Microsoft's forthcoming Visual Studio Team System will include source code control, integrated defect tracking, testing, reports, and a bunch of other project management and project governance tools and capabilities. All built in and integrated. BUT! That does not mean that there are not other options, even open source options. AnkhSVN and Igloo are a couple examples of source code control add-ins for Visual Studio. NUnit covers unit testing. There are others, too! Here's a brief list, with some details:

http://www.dotnetslackers.com/Visual_Studio/re-16278_Open_Source_and_Visual_Studio.aspx

maandag, december 05, 2005

 

Aardige samenvatting validators

 

C# Programming Tools

Titel spreekt voor zich...

http://msdn.microsoft.com/vcsharp/programming/tools/

zondag, december 04, 2005

 

Tuning AJAX

artikel over het analyseren / optimaliseren van je ajax elementen

http://www.xml.com/pub/a/2005/11/30/tuning-ajax-performance.html

vrijdag, december 02, 2005

 

UI on the Fly

Veel bezig met het schrijven van eigen ui controls (web), hier een aardig artikel over hoe je het renderen van controls kunt optimaliseren (zowel web als winforms)

Behoorlijk lang artikel...

http://msdn.microsoft.com/msdnmag/issues/05/12/CodeGeneration/default.aspx

 

Enterprise Library 2.0 update

Al eerder gereleased (geport vanaf 1.1) Entlib 20, hier een artikel over de november versie.

http://davidhayden.com/blog/dave/archive/2005/11/13/2564.aspx

donderdag, december 01, 2005

 

crash crash crash VS2005 crashes all the time

Knap iri, VS2005 hangt echt veeeeeeeel te vaak, volgens mij ligt het probleem in de interne webserver..

-edit-

Om onduidelijke redenen crashed IE vaak, process kille is genoeg om ook VS weer tot leven te wekken... toch wel r*k!