<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Dev Bros &#187; ASP (VBScript)</title>
	<atom:link href="http://www.webdevbros.net/category/deutsche-artikel/asp-vbscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdevbros.net</link>
	<description>hot talk about web development</description>
	<lastBuildDate>Wed, 16 Dec 2009 12:59:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Launched with ajaxed: Tourmandu &#8211; Platform for local tour guides</title>
		<link>http://www.webdevbros.net/2008/10/31/launched-with-ajaxed-tourmandu-platform-for-local-tour-guides/</link>
		<comments>http://www.webdevbros.net/2008/10/31/launched-with-ajaxed-tourmandu-platform-for-local-tour-guides/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 08:05:06 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[ASP (VBScript)]]></category>
		<category><![CDATA[ajaxed]]></category>
		<category><![CDATA[communities]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://www.webdevbros.net/2008/10/31/launched-with-ajaxed-tourmandu-platform-for-local-tour-guides/</guid>
		<description><![CDATA[I proudly announce the launch of a new project developed with ajaxed &#8211; yes with classic asp :). It&#8217;s a platform for everyone who wants to show tourists/visitors around in his/her hometown and earn some pocket money. Let&#8217;s face this:

You are a student and love to get in touch with people from around the globe. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tourmandu.com"><img height="38" alt="tourmandu.com" src="http://www.webdevbros.net/wp-content/uploads/2008/10/logo.png" width="200" align="left" /></a>I proudly announce the launch of a new project developed with <a href="http://www.webdevbros.net/ajaxed/">ajaxed</a> &#8211; yes with classic asp :). It&#8217;s a platform for everyone who wants to show tourists/visitors around in his/her hometown and earn some pocket money. Let&#8217;s face this:</p>
<blockquote>
<p>You are a student and love to get in touch with people from around the globe. On Tourmandu you can offer a tour in your hometown and tourists can get in touch with you. You show them &#8217;round and they pay/tip you afterwards. Not a bad idea :) Great part time income &#8230;</p>
</blockquote>
<p>As the project has been recently launched its a bit empty, but have a look at some existing tour to get an idea of what i am talking about..</p>
<ul dir="ltr">
<li>
<div><a title="Locals in australia" href="http://www.tourmandu.com/local-tours/Australia/">Tours in Australia</a></div>
</li>
<li>
<div><a title="locals in paris" href="http://www.tourmandu.com/local-tours/Paris/">Tours is Paris, France</a></div>
</li>
<li>
<div><a href="http://www.tourmandu.com/local-tours/Spain/159/">Tours in Spain</a></div>
</li>
<li>
<div><a href="http://www.tourmandu.com/local-tours/Usa/27/">Tours in the USA</a></div>
</li>
<li>
<div><a href="http://www.tourmandu.com/local-tour-guides/City/Famous-sightseeing-spots/">Guides for Famous sightseeing spots</a></div>
</li>
</ul>
<div><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://www.webdevbros.net/2008/10/31/launched-with-ajaxed-tourmandu-platform-for-local-tour-guides/&amp;t=Launched+with+ajaxed%3A+Tourmandu+-+Platform+for+local+tour+guides&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td> <td><iframe src='http://www.reddit.com/button_content?newwindow=1&amp;url=http://www.webdevbros.net/2008/10/31/launched-with-ajaxed-tourmandu-platform-for-local-tour-guides/&amp;title=Launched+with+ajaxed%3A+Tourmandu+-+Platform+for+local+tour+guides&amp;t=2 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http://www.webdevbros.net/2008/10/31/launched-with-ajaxed-tourmandu-platform-for-local-tour-guides/&amp;title=Launched+with+ajaxed%3A+Tourmandu+-+Platform+for+local+tour+guides&amp;t=1 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><script type="text/javascript"><!--yahooBuzzArticleHeadline=Launched+with+ajaxed%3A+Tourmandu+-+Platform+for+local+tour+guides;//--></script><script type="text/javascript" src="http://d.yimg.com/ds/badge2.js" badgetype=square></script></td> <td><script type="text/javascript">tweetmeme_url='http://www.webdevbros.net/2008/10/31/launched-with-ajaxed-tourmandu-platform-for-local-tour-guides/'; tweetmeme_style = 'normal';; </script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js" ></script></td></table></div><!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	-->]]></content:encoded>
			<wfw:commentRss>http://www.webdevbros.net/2008/10/31/launched-with-ajaxed-tourmandu-platform-for-local-tour-guides/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>ajaxed gets a face</title>
		<link>http://www.webdevbros.net/2008/07/25/ajaxed-gets-a-face/</link>
		<comments>http://www.webdevbros.net/2008/07/25/ajaxed-gets-a-face/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 03:01:55 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[ASP (VBScript)]]></category>
		<category><![CDATA[ajaxed]]></category>

		<guid isPermaLink="false">http://www.webdevbros.net/?p=193</guid>
		<description><![CDATA[I proudly present the new logo of our ajaxed library. Just achieve a bit of identity ;) What do you think? Do you like it or is it just another web 2.0 logo :) Btw: I have just purchased ajaxed.org which will be the new home for ajaxed. A lot of tutorials, better documentation and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.webdevbros.net/wp-content/uploads/2008/07/ajaxed.gif" alt="" title="ajaxed" width="285" height="99" class="alignleft size-full wp-image-194" />I proudly present the new logo of our <a hreft="http://www.webdevbros.net/ajaxed/">ajaxed</a> library. Just achieve a bit of identity ;) What do you think? Do you like it or is it just another web 2.0 logo :) Btw: I have just purchased <a href="http://www.ajaxed.org">ajaxed.org</a> which will be the new home for ajaxed. A lot of tutorials, better documentation and version 2 is coming soon. Thanks again for all your support guys!</p>
<div><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://www.webdevbros.net/2008/07/25/ajaxed-gets-a-face/&amp;t=ajaxed+gets+a+face&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td> <td><iframe src='http://www.reddit.com/button_content?newwindow=1&amp;url=http://www.webdevbros.net/2008/07/25/ajaxed-gets-a-face/&amp;title=ajaxed+gets+a+face&amp;t=2 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http://www.webdevbros.net/2008/07/25/ajaxed-gets-a-face/&amp;title=ajaxed+gets+a+face&amp;t=1 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><script type="text/javascript"><!--yahooBuzzArticleHeadline=ajaxed+gets+a+face;//--></script><script type="text/javascript" src="http://d.yimg.com/ds/badge2.js" badgetype=square></script></td> <td><script type="text/javascript">tweetmeme_url='http://www.webdevbros.net/2008/07/25/ajaxed-gets-a-face/'; tweetmeme_style = 'normal';; </script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js" ></script></td></table></div><!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	-->]]></content:encoded>
			<wfw:commentRss>http://www.webdevbros.net/2008/07/25/ajaxed-gets-a-face/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>File Selector</title>
		<link>http://www.webdevbros.net/2005/06/14/file-selector/</link>
		<comments>http://www.webdevbros.net/2005/06/14/file-selector/#comments</comments>
		<pubDate>Tue, 14 Jun 2005 12:01:28 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[ASP (VBScript)]]></category>
		<category><![CDATA[Deutsche Artikel]]></category>

		<guid isPermaLink="false">http://www.webdevbros.net/2005/06/14/file-selector/</guid>
		<description><![CDATA[Um dieses Teil handelt es sich: File Selector DEMO
Letztens hab ich für ein Projekt ein Control benötigt welches Dateien aus einem bestimmten Ordner ausliest und diese zum Auswählen bereit stellt. Man soll ein oder mehrere Files auswählen können, ausserdem sollen Files auch vorselektiert werden. Durch dieses Problem ist ein nettes Control entstanden welches ich mal [...]]]></description>
			<content:encoded><![CDATA[<p>Um dieses Teil handelt es sich: <a href="http://www.grafix.at/michal/files/fileSelector/class_fileSelector/demo/index.asp" target="_blank"><strong>File Selector DEMO</strong></a></p>
<p>Letztens hab ich für ein Projekt ein Control benötigt welches Dateien aus einem bestimmten Ordner ausliest und diese zum Auswählen bereit stellt. Man soll ein oder mehrere Files auswählen können, ausserdem sollen Files auch vorselektiert werden. Durch dieses Problem ist ein nettes Control entstanden welches ich mal "FileSelector" benamst hab.<br />
Mit Hilfe dessen kann man nun einiges im Filesystem anstellen. mögliche Szenarien: selektierte dateien löschen, verschieben, umbennen, etc. oder (wie in meinem fall) in die Datenbank schreiben. Hier mal ein Screenshot wie das Control live aussieht:</p>
<p><img src='http://www.webdevbros.net/wp-content/uploads/2007/05/fileselector.gif' alt='Fileselector' /><br />
<span id="more-48"></span></p>
<p><strong>Einige Features:</strong></p>
<ul>
<li>Für jeden Dateityp kann ein eigenes Icon anzeigt werden. Zur Zeit 26 unterstützte Dateitypen. Um einen neuen Dateityp zu unterstützen muss lediglich ein GIF-image in den images-ordner kopiert werden.</li>
<li>Selektieren von mehreren (checkboxes) Dateien erlauben oder nur ein einzelnes (radiobutton).</li>
<li> Radiobuttons durch doppelklick wieder deaktivierbar</li>
<li>Styles komplett mit CSS.</li>
<li>Vorselektieren von Dateien. (Ordner werden automatisch geöffnet und Files selektiert)</li>
<li>unterstützt StringBuilder: DLL wird aber benötigt. ist standardmäßig aus. Durch den Stringbuilder wirds um 100% schneller.</li>
<li>Komplett mit Tooltips</li>
<li>Getestet im Internet Explorer und Firefox (funktioniert auch)</li>
<li>Dateien werden per Doppelklick geöffnet</li>
<li>Objektorientiert</li>
<li>und mehr</li>
</ul>
<p>Anbei ein kurzes Code-Beispiel wie man den File Selector verwendet:</p>
<div class="igBar"><span id="lasp-2"><a href="#" onclick="javascript:showCodeTxt('asp-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-2">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;!--#include <span style="color:#990099; font-weight:bold;">file</span>=<span style="color:#CC0000;">"../fileSelector.asp"</span>--&gt;</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF; font-weight:bold;">&lt;%</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">set</span> fs = <span style="color:#0000FF; font-weight:bold;">new</span> fileSelector</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">with</span> fs</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; .<span style="color:#9900CC;">sourcePath</span> = <span style="color:#CC0000;">"/michal/files/"</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">if</span> <span style="color:#990099; font-weight:bold;">request</span>.<span style="color:#330066;">form</span>.<span style="color:#9900CC;">count</span>&gt; <span style="color:#800000;color:#800000;">0</span> <span style="color:#990099; font-weight:bold;">then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; .<span style="color:#9900CC;">selected</span> = .<span style="color:#9900CC;">selected</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">end</span> <span style="color:#990099; font-weight:bold;">if</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">end</span> <span style="color:#990099; font-weight:bold;">with</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF; font-weight:bold;">%&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;form action=<span style="color:#CC0000;">"index.asp"</span> method=<span style="color:#CC0000;">"post"</span> name=<span style="color:#CC0000;">"frm"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;div style=<span style="color:#CC0000;">"padding:30;"</span>&gt;&lt;% fs.<span style="color:#9900CC;">draw</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> %&gt;&lt;/div&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;div&gt;&lt;input type=<span style="color:#CC0000;">"Submit"</span> name=<span style="color:#CC0000;">"submit"</span>&gt;&lt;/div&gt;</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/form&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF; font-weight:bold;">&lt;%</span> <span style="color:#990099; font-weight:bold;">set</span> fs = <span style="color:#0000FF; font-weight:bold;">nothing</span> <span style="color:#0000FF; font-weight:bold;">%&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Es wird ein FileSelector instanziert und dessen Höhe und der Ursprungspfad (sourcPath) eingestellt. (in diesem Fall "/michal/files"). Weiter unten sieht man die Ausgabe des Selectors mittels der draw()-methode. Klickt man nun auf den Submit-Button merkt sich das Control die Auswahl. Dies geschieht in bei Zuweisung des selected-getter- an das selected-setter -property. Ich denke mit diesem Control kann man einiges anstellen. So wäre es z.b. kein Problem mehr die selektierten Dateien einfach zu löschen. Viel Spaß beim experimentieren!</p>
<p><a href='http://www.webdevbros.net/wp-content/uploads/2007/05/class_fileselector.zip' title='Fileselector'><strong>Fileselector download</strong></a><br />
(es liegt ein readme-file bei in dem noch einige Bemerkungen zu finden sind.)</p>
<div><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://www.webdevbros.net/2005/06/14/file-selector/&amp;t=File+Selector&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td> <td><iframe src='http://www.reddit.com/button_content?newwindow=1&amp;url=http://www.webdevbros.net/2005/06/14/file-selector/&amp;title=File+Selector&amp;t=2 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http://www.webdevbros.net/2005/06/14/file-selector/&amp;title=File+Selector&amp;t=1 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><script type="text/javascript"><!--yahooBuzzArticleHeadline=File+Selector;//--></script><script type="text/javascript" src="http://d.yimg.com/ds/badge2.js" badgetype=square></script></td> <td><script type="text/javascript">tweetmeme_url='http://www.webdevbros.net/2005/06/14/file-selector/'; tweetmeme_style = 'normal';; </script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js" ></script></td></table></div><!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	-->]]></content:encoded>
			<wfw:commentRss>http://www.webdevbros.net/2005/06/14/file-selector/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Paging leicht gemacht</title>
		<link>http://www.webdevbros.net/2005/05/25/paging-leicht-gemacht/</link>
		<comments>http://www.webdevbros.net/2005/05/25/paging-leicht-gemacht/#comments</comments>
		<pubDate>Wed, 25 May 2005 10:12:51 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[ASP (VBScript)]]></category>
		<category><![CDATA[Deutsche Artikel]]></category>

		<guid isPermaLink="false">http://www.webdevbros.net/2005/05/25/paging-leicht-gemacht/</guid>
		<description><![CDATA[Wer kennt das nicht? Tausende von Daten müssen seitenweise navigierbar zur Verfügung gestellt werden. z.b. Suchergebnisse, etc. Da dies ein häufiges Problem ist und in fast jedem Projekt mal vorkommt hab ich ein schönes Objekt dafür geschrieben welches die Implementierung solch einer Funktionalität erleichtern soll. Und vorallem: den Code leserlicher und übersichtlicher! Hier gleich mal [...]]]></description>
			<content:encoded><![CDATA[<p>Wer kennt das nicht? Tausende von Daten müssen seitenweise navigierbar zur Verfügung gestellt werden. z.b. Suchergebnisse, etc. Da dies ein häufiges Problem ist und in fast jedem Projekt mal vorkommt hab ich ein schönes Objekt dafür geschrieben welches die Implementierung solch einer Funktionalität erleichtern soll. Und vorallem: den Code leserlicher und übersichtlicher! Hier gleich mal ein Screenshot was am Ende rauskommen soll:</p>
<p><img src='/wp-content/uploads/2007/05/pageable.gif' alt='Pageable' /><span id="more-45"></span></p>
<p>Man sieht hier sehr schön die Anforderung an ein komfortables "Paging". Hervorheben der aktuellen Seite, Navigation zur vorherigen und nächsten Seite sowie zur ersten und letzten. Ausserdem noch die Limitierung der Seiten auf eine bestimmte Anzahl, da es nicht recht sinnvoll wäre 1000 Seiten aufeinmal anzuzeigen. (im Screenshot deuten dies die Punkte an). All dies lösen wir nun mit der <strong>pageable-klasse</strong> welche Teil der gabLibrary ist. Da ich heut richtig in Schreibstimmung bin versuch ich ein umfangreiches Tutorial zu schreiben und einiges näher zu erläutern.</p>
<p>Wenn ich mir ein Tutorial zu Gemüte führ will ich gleich mal das Resultat selber testen ;) <a href="http://www.grafix.at/michal/files/paging/paging.asp" target="_blank"><strong>somit gibts hier die DEMO-Paging-Bar zum Testen.</strong></a> Aber nun zum Eigentlichen:</p>
<p><em>Gleich vorweg: das Objekt kann für alle möglichen Datenstrukturen werden. Ich demonstriere es in diesem Beispiel mit einem Array um die wesentliche Funktionalität herzuheben. Funktioniert aber genauso gut mit einem Recordset-objekt oder dictionary, etc. </em></p>
<p><strong>1. Vorbereitung:</strong> Als erstes müssen wir die Klasse (pageable.asp) inkludieren und eine Basis für die Verwendung des Objekts schaffen (da dieses uns ja "nur" die Funktionalität kapselt). Bei einer paging-bar müssen wir uns irgendwie merken auf welcher Seite wir uns gerade befinden. Ich löse das mal über einen querystring-parameter namens page. Dafür hab ich die Funktion getCurrentPage() , geschrieben, welche lediglich überprüft ob dieser Wert vorhanden ist und gibt diesen weiter. Ist dieser nicht vorhanden (aller erster Aufruf der Seite) wird 1 zurückgegeben.</p>
<div class="igBar"><span id="lasp-9"><a href="#" onclick="javascript:showCodeTxt('asp-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-9">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;!--#include <span style="color:#990099; font-weight:bold;">file</span>=<span style="color:#CC0000;">"pageable.asp"</span>--&gt;</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">'liefert die aktuelle Seitennummer</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF; font-weight:bold;">function</span> getCurrentPage<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; getCurrentPage = <span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">if</span> <span style="color:#990099; font-weight:bold;">request</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"page"</span><span style="color:#006600; font-weight:bold;">&#41;</span> &lt;&gt; <span style="color:#CC0000;">""</span> <span style="color:#990099; font-weight:bold;">then</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; getCurrentPage = <span style="color:#990099; font-weight:bold;">request</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"page"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">end</span> <span style="color:#990099; font-weight:bold;">if</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">end</span> <span style="color:#0000FF; font-weight:bold;">function</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ich hab mir gedacht die Navigation mittels "Buttons" zu realisieren und beim Klick per Javascript die Seite mit der gewünschten Seiternummer neu zu laden. Deshalb hier eine Funktion welche einen Button ausgibt. Recht allgemein gehalten, zeichnet einfach einen Button. Parameter wie disabled oder eine Css-klasse können übergeben werden. hab diese Funktion mal drawButton() genannt:</p>
<div class="igBar"><span id="lasp-10"><a href="#" onclick="javascript:showCodeTxt('asp-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-10">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">'zeichnet einen button</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF; font-weight:bold;">sub</span> drawButton<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#330066;">value</span>, pageNr, cssClass, disabled<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">with</span> <span style="color:#990099; font-weight:bold;">response</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#990099; font-weight:bold;">if</span> disabled <span style="color:#990099; font-weight:bold;">then</span> dis = <span style="color:#CC0000;">" disabled"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; onClick = <span style="color:#CC0000;">"document.location.href='paging.asp?page="</span> &amp; pageNr</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; .<span style="color:#330066;">write</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"&lt;button type=button class="</span><span style="color:#CC0000;">"btn "</span> &amp; cssClass &amp; <span style="color:#CC0000;">""</span><span style="color:#CC0000;">" onclick="</span><span style="color:#CC0000;">""</span> &amp; onClick &amp; <span style="color:#CC0000;">"'"</span><span style="color:#CC0000;">""</span> &amp; dis &amp; <span style="color:#CC0000;">"&gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; .<span style="color:#330066;">write</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#330066;">value</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; .<span style="color:#330066;">write</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"&lt;/button&gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">end</span> <span style="color:#990099; font-weight:bold;">with</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">end</span> <span style="color:#0000FF; font-weight:bold;">sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Man erkennt hier schön die <a href="/2005/03/02/wiederverwendung-von-stylesheetangaben/">Wiederverwendung von CSS-Klassen</a>. Jeder Button verwendet aufjedenfall die btn-klasse und zusätzlich eine individuelle welche von außen kommt. Dadruch können wir später gemeinsame Eigenschaften eines jeden Buttons konfigurieren.</p>
<p>Zu letzt benötigen wir noch eine Funktion, welche uns die gesamte Paging-Bar zeichnet. Also den Vor- und Zurück-Button, die einzelnen Seiten, etc. Dafür verwenden wir die zuvor erstellte Funktion drawButton(), da ja alle Funktionen mittels Buttons realisiert werden. Anbei die Funktion drawPagingBar():</p>
<div class="igBar"><span id="lasp-11"><a href="#" onclick="javascript:showCodeTxt('asp-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-11">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">'zeichnet unsere seiten-bar</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF; font-weight:bold;">sub</span> drawPagingBar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; drawButton <span style="color:#CC0000;">"&lt;&lt;"</span>, paging.<span style="color:#9900CC;">firstPage</span>, <span style="color:#CC0000;">"prevnext"</span>, paging.<span style="color:#9900CC;">isOnFirstPage</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; drawButton <span style="color:#CC0000;">"&lt;"</span>, paging.<span style="color:#9900CC;">currentPage</span> - <span style="color:#800000;color:#800000;">1</span>, <span style="color:#CC0000;">"prevnext"</span>, <span style="color:#990099; font-weight:bold;">not</span> paging.<span style="color:#9900CC;">hasPreviousPage</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">if</span> paging.<span style="color:#9900CC;">hasPreviousBlock</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#990099; font-weight:bold;">then</span> <span style="color:#990099; font-weight:bold;">response</span>.<span style="color:#330066;">write</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"...."</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">for</span> i = <span style="color:#800000;color:#800000;">0</span> <span style="color:#990099; font-weight:bold;">to</span> <span style="color:#990099; font-weight:bold;">uBound</span><span style="color:#006600; font-weight:bold;">&#40;</span>paging.<span style="color:#9900CC;">pages</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; drawButton paging.<span style="color:#9900CC;">page</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span>, paging.<span style="color:#9900CC;">page</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#CC0000;">"common"</span>, paging.<span style="color:#9900CC;">page</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span> = paging.<span style="color:#9900CC;">currentPage</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">next</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">if</span> paging.<span style="color:#9900CC;">hasNextBlock</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#990099; font-weight:bold;">then</span> <span style="color:#990099; font-weight:bold;">response</span>.<span style="color:#330066;">write</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"...."</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; drawButton <span style="color:#CC0000;">"&gt;"</span>, paging.<span style="color:#9900CC;">currentPage</span> + <span style="color:#800000;color:#800000;">1</span>, <span style="color:#CC0000;">"prevnext"</span>, <span style="color:#990099; font-weight:bold;">not</span> paging.<span style="color:#9900CC;">hasNextPage</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; drawButton <span style="color:#CC0000;">"&gt;&gt;"</span>, paging.<span style="color:#9900CC;">lastPage</span>, <span style="color:#CC0000;">"prevnext"</span>, paging.<span style="color:#9900CC;">isOnLastPage</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">end</span> <span style="color:#0000FF; font-weight:bold;">sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Mit Hilfe dieser Funktion wird die komplette Paging-Bar gezeichnet. Eigentlich keine Hexerei. Die verwendete Instanz paging vom Typ pageable bietet alle Funktionalitäten. So wird z.b. in der ersten Zeile der Button fürs "springen zur ersten Seiten" gezeichnet. Seitennummer muss logischerweise die erste sein, dafür steht das property paging.firstPage zur Verfügung. Befinden wir uns auf der ersten Seite wollen wir den Button natürlich deaktivieren, somit kommt der letzte Parameter der drawButton()-Funktion ins Spiel. Da übergeben wir einfach den Rückgabewert der Methode paging.isOnFirstPage(). Eh kloa weil ja dieser Button disabled wird wenn wir uns bereits auf der ersten Seite befinden (on first page...).<br />
Genauso verhält es sich mit all den weiteren Buttons (nächste Seite, vorige Seite, etc.). Nicht viel schwieriger ist die Darstellung der einzelnen Seiten. Ein einfacher Loop. Unabhängig davon ob man die pageable-Klasse bereits kennt oder nicht, der Code ist aufjedenfall verständlich.</p>
<p><strong>2. Die Daten:</strong> Da wir die Vorbereitungen erledigt haben benötigen wir nun einige Daten welche "gepaged" werden sollen. Hierfür erstell ich einfach ein Array mit Zufallszeichen als Inhalt. Achtung: dies führt dazu, dass bei jedem Seitewechsel neue Daten in jedem Feld vorhanden sind. Sollte aber für die Demo kein Problem darstellen da wir uns nicht um den Inhalt kümmern sondern um die Aufteilung der Daten in Seiten und deren Navigation. Das Array mit Zufallszeichen:</p>
<div class="igBar"><span id="lasp-12"><a href="#" onclick="javascript:showCodeTxt('asp-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-12">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">'wir verwenden ein array befüllt mit daten</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF; font-weight:bold;">dim</span> data<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">for</span> i = <span style="color:#800000;color:#800000;">0</span> <span style="color:#990099; font-weight:bold;">to</span> <span style="color:#990099; font-weight:bold;">uBound</span><span style="color:#006600; font-weight:bold;">&#40;</span>data<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">randomize</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; data<span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span> = <span style="color:#990099; font-weight:bold;">chr</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">255</span> * <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#990099; font-weight:bold;">rnd</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">next</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>3. pageable konfigurieren:</strong> nun kommt der wichigste Part, nämlich die Pageable-Klasse. Dieser müssen wir unsere "Wünsche" bekanntgeben. Also an welcher Seitennummer steht meine Seite gerade (.currentPage) ? Wieviele Datensätze beinhaltet meine Datenspeicher (.recordCount)? Wieviele Datensätze will ich pro Seite anzeigen (.recordsPerPage)? und natürlich wieviele Seiten will ich in meiner Paging-Bar den gleichzeitig anzeigen (.numberOfPages)? Wenn all dies angegeben wurde führt man die perform() Methode aus und kann dannach alle Werte der Pageable verwenden. Hier nun die Instanz der pageable</p>
<div class="igBar"><span id="lasp-13"><a href="#" onclick="javascript:showCodeTxt('asp-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-13">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">'pageable wird instanziert und mit den nötigen werten versorgt</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">set</span> paging = <span style="color:#0000FF; font-weight:bold;">new</span> Pageable</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">with</span> paging</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; .<span style="color:#9900CC;">currentPage</span> = getCurrentPage<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; .<span style="color:#9900CC;">recordCount</span> = <span style="color:#990099; font-weight:bold;">uBound</span><span style="color:#006600; font-weight:bold;">&#40;</span>data<span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; .<span style="color:#9900CC;">recordsPerPage</span> = <span style="color:#800000;color:#800000;">10</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; .<span style="color:#9900CC;">numberOfPages</span> = <span style="color:#800000;color:#800000;">7</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; .<span style="color:#9900CC;">perform</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">end</span> <span style="color:#990099; font-weight:bold;">with</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Man sieht hier schön die Verwendung der anfangs definierten Funktion getCurrentPage(), welche uns die aktuelle Seite zurückliefert (speicherung mittels Querystring). Anzahl der Datensätze ist auch klar, +1 weil das Array auch ein 0er Feld hat.</p>
<p><strong>4. Der Output:</strong> Zu guter letzt müssen wir es noch am Bildschirm ausgeben.</p>
<div class="igBar"><span id="lhtml-14"><a href="#" onclick="javascript:showCodeTxt('html-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-14">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/style.html"><span style="color: #000000; font-weight: bold;">&lt;style&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; .btn { width:30; border:0; background-color:white; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; .common { color:blue; }</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; .prevnext { font-weight:bold; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/style&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">&lt;form&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">"center"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;">&lt;% drawPagingBar<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> %<span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/br.html"><span style="color: #000000; font-weight: bold;">&lt;br&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;">&lt;% <span style="color: #000066;">for</span> i = paging.dataStartPosition to paging.dataEndPosition %<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">"center"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Data<span style="color: #009900;">&lt;%= i - <span style="color: #cc66cc;color:#800000;">1</span>%<span style="color: #000000; font-weight: bold;">&gt;</span></a></span>: <span style="color: #009900;">&lt;%= <span style="color: #000066;">data</span><span style="color: #66cc66;">&#40;</span>i - <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span> %<span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;">&lt;% next %<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Wir zeichen die pagingbar an die gewünschte Stelle mit drawPagingBar(). Dann müssen auch noch die richtigen Daten ausgegeben werden. Dafür stellt uns die pageable folgende Eigenschaften zur Verfügung: dataStartPosition und dataEndPosition. Mit Hilfe dieser kann man nun die angeforderten Datensätze aus dem Array darstellen. Innerhalb der Schleife wird 1 subtrahiert, da im 0er Feld auch Nutzdaten vorhanden sind.</p>
<p>Ich verwende dieses Objekt schon einige Zeit (vorallem für Recordsets) und es hat sich bewährt. Viel Spaß damit. Hier gehts zum download der Klasse und des Demobeispiels:</p>
<p><strong><a href='/wp-content/uploads/2007/05/paging.zip' title='Paging download'>Paging.zip download</a></strong></p>
<p>Hab ein paar Anfragen bekommen wie man das an ein Recordset hängt. Dafür gibts einen Thread im ASP-Forum: <a href="http://www.aspforum.de/topic.asp?TOPIC_ID=26136" target="_blank">http://www.aspforum.de/topic.asp?TOPIC_ID=26136</a></p>
<div><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://www.webdevbros.net/2005/05/25/paging-leicht-gemacht/&amp;t=Paging+leicht+gemacht&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td> <td><iframe src='http://www.reddit.com/button_content?newwindow=1&amp;url=http://www.webdevbros.net/2005/05/25/paging-leicht-gemacht/&amp;title=Paging+leicht+gemacht&amp;t=2 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http://www.webdevbros.net/2005/05/25/paging-leicht-gemacht/&amp;title=Paging+leicht+gemacht&amp;t=1 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><script type="text/javascript"><!--yahooBuzzArticleHeadline=Paging+leicht+gemacht;//--></script><script type="text/javascript" src="http://d.yimg.com/ds/badge2.js" badgetype=square></script></td> <td><script type="text/javascript">tweetmeme_url='http://www.webdevbros.net/2005/05/25/paging-leicht-gemacht/'; tweetmeme_style = 'normal';; </script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js" ></script></td></table></div><!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	-->]]></content:encoded>
			<wfw:commentRss>http://www.webdevbros.net/2005/05/25/paging-leicht-gemacht/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.net Dropdownlist für klassisches ASP</title>
		<link>http://www.webdevbros.net/2005/03/25/net-dropdownlist-fur-klassisches-asp/</link>
		<comments>http://www.webdevbros.net/2005/03/25/net-dropdownlist-fur-klassisches-asp/#comments</comments>
		<pubDate>Fri, 25 Mar 2005 18:15:28 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[ASP (VBScript)]]></category>
		<category><![CDATA[Deutsche Artikel]]></category>

		<guid isPermaLink="false">http://www.webdevbros.net/2005/03/25/net-dropdownlist-fur-klassisches-asp/</guid>
		<description><![CDATA[Vielleicht recht brauchbar für alle die noch mit klassischem ASP programmieren: habe das Dropdownlist-control aus .net nachgebastelt. Namensgebung und Funktionalität sollte im wesentlichen übereinstimmen. Kleinigkeiten wollte ich besser (bzw. anders) machen als wie es bereits existiert. Zumindest intuitiver, meinen Vorstellungen nach :) Kurz eine Zusammenfassung was es so bietet:

OO-Control für klassisches ASP
Namesgebung und Funktionalität grösstenteils [...]]]></description>
			<content:encoded><![CDATA[<p>Vielleicht recht brauchbar für alle die noch mit klassischem ASP programmieren: habe das Dropdownlist-control aus .net nachgebastelt. Namensgebung und Funktionalität sollte im wesentlichen übereinstimmen. Kleinigkeiten wollte ich besser (bzw. anders) machen als wie es bereits existiert. Zumindest intuitiver, meinen Vorstellungen nach :)<span id="more-62"></span> Kurz eine Zusammenfassung was es so bietet:</p>
<ul>
<li>OO-Control für klassisches ASP</li>
<li>Namesgebung und Funktionalität grösstenteils vom .net übernommen</li>
<li>als Datenquelle kann array, recordset oder dictionary verwendet werden</li>
<li>Ereignisbehandlung während dem rendering (onItemCreated)</li>
<li>direkte Ausgabe mittels draw() oder output als String mit toString()</li>
<li>Volle Multiple-dropdown funktionalität. (selectedItems können einer sein oder mehrere (array))</li>
<li>Stringbuilder-kompatibel. DLL muss dafür am Server vorhanden sein.</li>
<li>sollte leicht leserlicher und verständlicher Code sein ... hoffentlich :)</li>
</ul>
<p>Anbei nun ein kurzes Beispiel wie man damit startet. Den Rest bitte aus den Klassen selber rauslesen. Die Schnittstelle sollte genügend dokumentiert sein:</p>
<p><a href='/wp-content/uploads/2007/05/dropdown.zip' title='Dropdown'>Hier gibts das Control zum downloaden</a></p>
<p><strong>1. Zuerst mal den Import der Klasse realisieren. Eh klar mit einem Include:</strong></p>
<div class="igBar"><span id="lasp-18"><a href="#" onclick="javascript:showCodeTxt('asp-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-18">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;!--#include <span style="color:#990099; font-weight:bold;">file</span>=<span style="color:#CC0000;">"dropdown.asp"</span>--&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>2. Nun erstellen wir ein einfaches Dropdown und zwar mit einem Array als Datenquelle:</strong></p>
<div class="igBar"><span id="lasp-19"><a href="#" onclick="javascript:showCodeTxt('asp-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-19">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">set</span> dd = <span style="color:#0000FF; font-weight:bold;">new</span> Dropdown</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">dd.<span style="color:#9900CC;">datasource</span> = <span style="color:#990099; font-weight:bold;">array</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"one"</span>, <span style="color:#CC0000;">"two"</span>, <span style="color:#CC0000;">"three"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">dd.<span style="color:#9900CC;">draw</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">set</span> dd = <span style="color:#0000FF; font-weight:bold;">nothing</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Mittels draw() wirds direkt zum Browser geschickt (gezeichnet eben). Um es z.b. als String zu erhalten verwende einfach toString(). Bei Dropdowns mit riesigen Datenmengen empfiehlt es sich das Dropdown mit Hilfe vom Stringbulider zu verwenden. Hierzu dient die useStringBuilder-Eigenschaft. </p>
<p><strong>3. Beispiel zur Behandlung des onItemcreated-Ereignisses</strong></p>
<div class="igBar"><span id="lasp-20"><a href="#" onclick="javascript:showCodeTxt('asp-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-20">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">set</span> dd = <span style="color:#0000FF; font-weight:bold;">new</span> Dropdown</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">set</span> aDict = <span style="color:#990099; font-weight:bold;">server</span>.<span style="color:#330066;">createObject</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"scripting.dictionary"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">aDict.<span style="color:#330066;">add</span> <span style="color:#800000;color:#800000;">1</span>, <span style="color:#CC0000;">"yes"</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">aDict.<span style="color:#330066;">add</span> <span style="color:#800000;color:#800000;">2</span>, <span style="color:#CC0000;">"no"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">set</span> dd.<span style="color:#9900CC;">datasource</span> = aDict</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">dd.<span style="color:#9900CC;">onItemCreated</span> = <span style="color:#CC0000;">"onDDItemCreated"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">dd.<span style="color:#9900CC;">draw</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">set</span> dd = <span style="color:#0000FF; font-weight:bold;">nothing</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF; font-weight:bold;">function</span> onDDItemCreated<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#330066;">item</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">if</span> <span style="color:#330066;">item</span>.<span style="color:#9900CC;">index</span> = <span style="color:#800000;color:#800000;">1</span> <span style="color:#990099; font-weight:bold;">then</span> <span style="color:#330066;">item</span>.<span style="color:#9900CC;">style</span> = <span style="color:#CC0000;">"color:red"</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">end</span> <span style="color:#0000FF; font-weight:bold;">function</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In diesem Beispiel verwende ich ein Dictionary als Datenquelle. Funktioniert auch Prima! Um das onItemCreated-Ereignis behandeln zu können, muss der onItemCreated-Eigenschaft der Name der ereignisbehandelnden Funktion übergeben werden. In unserem Fall onDDItemCreated. Diese muss natürlich auch implementiert werden inkl. einem Parameter, welcher natürlich das gerade durchlaufende dropdownItem darstellt. In meinem Beispiel färbe ich das 2.Element rot ein. Nichts einfach als das ;)<br />
Mit Hilfe dieser Ereignisbehandlung ist nun eine einfach Manipulation sämtlicher Einstellungen zur "Laufzeit" möglich. Z.b. könnte man auf die Datenquelle des Dropdowns zugreifen und somit auf den Inhalt dessen reagieren. Sehr interessant vorallem dann wenn ein Recordset als Quelle verwendet wird. </p>
<p><strong>4. Viel Spaß damit!</strong></p>
<p>Kurze Anmerkung noch: Sollte ein Recordset als Quelle verwendet, dann muss dieses einen statischen Cursor verwenden (rs.cursorType = adOpenStatic). Bin erfreut über jedes Kommentar. Verwende das Control in all meinen Projekten und alle Probleme waren damit lösbar ... somit nicht gleich aufgeben falls etwas nicht gleich beim ersten mal klappt.</p>
<div><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://www.webdevbros.net/2005/03/25/net-dropdownlist-fur-klassisches-asp/&amp;t=.net+Dropdownlist+f%C3%BCr+klassisches+ASP&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td> <td><iframe src='http://www.reddit.com/button_content?newwindow=1&amp;url=http://www.webdevbros.net/2005/03/25/net-dropdownlist-fur-klassisches-asp/&amp;title=.net+Dropdownlist+f%C3%BCr+klassisches+ASP&amp;t=2 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http://www.webdevbros.net/2005/03/25/net-dropdownlist-fur-klassisches-asp/&amp;title=.net+Dropdownlist+f%C3%BCr+klassisches+ASP&amp;t=1 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><script type="text/javascript"><!--yahooBuzzArticleHeadline=.net+Dropdownlist+f%C3%BCr+klassisches+ASP;//--></script><script type="text/javascript" src="http://d.yimg.com/ds/badge2.js" badgetype=square></script></td> <td><script type="text/javascript">tweetmeme_url='http://www.webdevbros.net/2005/03/25/net-dropdownlist-fur-klassisches-asp/'; tweetmeme_style = 'normal';; </script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js" ></script></td></table></div><!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	-->]]></content:encoded>
			<wfw:commentRss>http://www.webdevbros.net/2005/03/25/net-dropdownlist-fur-klassisches-asp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
