<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>This is how I do my business</title>
	
	<link>http://www.cosmocentral.com</link>
	<description />
	<lastBuildDate>Sat, 19 Sep 2009 00:16:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/CosmoCentral" type="application/rss+xml" /><feedburner:emailServiceId>CosmoCentral</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>the type or namespace name ‘webmethod’ could not be found</title>
		<link>http://feedproxy.google.com/~r/CosmoCentral/~3/ATr-2hv579k/</link>
		<comments>http://www.cosmocentral.com/2009/09/the-type-or-namespace-name-webmethod-could-not-be-found/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 00:16:27 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=573</guid>
		<description><![CDATA[If you are adding Page Method on your ASP .Net page and you see this compile error: the type or namespace name 'webmethod' could not be found....]]></description>
			<content:encoded><![CDATA[<p>If you are adding Page Method on your ASP .Net page and you see this compile error:</p>
<p><span style="color: #ff0000;">the type or namespace name &#8216;webmethod&#8217; could not be found&#8230;.</span></p>
<p>then you are missing one of these things:</p>
<p>A. Make sure you have reference to System.Web.Services on your class.</p>
<p>using System.Web.Services;</p>
<p>B. Make sure on your web.config you have</p>
<p>&lt;system.web&gt;<br />
&lt;httpModules&gt;<br />
&lt;add name=&#8221;ScriptModule&#8221; type=&#8221;System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&#8243;/&gt;<br />
&lt;/httpModules&gt;<br />
&lt;/system.web&gt;</p>
<p>C. Make sure you have EnablePageMethods set to true on your ScriptManager</p>
<p>&lt;asp:ScriptManager ID=&#8221;ScriptManager1&#8243; EnablePageMethods=&#8221;true&#8221; runat=&#8221;server&#8221;&gt;<br />
&lt;/asp:ScriptManager&gt;</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ATr-2hv579k:HNZERBET5bs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ATr-2hv579k:HNZERBET5bs:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ATr-2hv579k:HNZERBET5bs:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=ATr-2hv579k:HNZERBET5bs:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ATr-2hv579k:HNZERBET5bs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=ATr-2hv579k:HNZERBET5bs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ATr-2hv579k:HNZERBET5bs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=ATr-2hv579k:HNZERBET5bs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ATr-2hv579k:HNZERBET5bs:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ATr-2hv579k:HNZERBET5bs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ATr-2hv579k:HNZERBET5bs:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=ATr-2hv579k:HNZERBET5bs:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ATr-2hv579k:HNZERBET5bs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=ATr-2hv579k:HNZERBET5bs:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CosmoCentral/~4/ATr-2hv579k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2009/09/the-type-or-namespace-name-webmethod-could-not-be-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cosmocentral.com/2009/09/the-type-or-namespace-name-webmethod-could-not-be-found/</feedburner:origLink></item>
		<item>
		<title>Truncate MS SQL 2008 Database Log File</title>
		<link>http://feedproxy.google.com/~r/CosmoCentral/~3/ct91lOB_gng/</link>
		<comments>http://www.cosmocentral.com/2009/09/truncate-ms-sql-2008-database-log-file/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 22:10:56 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=569</guid>
		<description><![CDATA[So you need to truncate the log files often to keep the log file smaller in size. The process I am demonstrating here is for MS SQL 2008.]]></description>
			<content:encoded><![CDATA[<div>If you need to truncate the SQL database log files to keep them smaller in size. The process I am demonstrating here is for MS SQL 2008.–Get in the database</p>
<p>use Test<br />
GO</p>
<p>–see current file sizes<br />
SELECT name,size from sys.database_files</p>
<p>–see current recovery model<br />
select name,recovery_model_desc from sys.databases</p>
<p>–According to the articles if you switch the Recovery Model to Simple inactive part of the transaction log should be removed in MS SQL 2008.<br />
–This command will reduce the log file somewhat<br />
Alter database Test SET Recovery simple</p>
<p>–check if the recovery model is changed<br />
select name,recovery_model_desc from sys.databases</p>
<p>–check file sizes<br />
select name,size from sys.database_files</p>
<p>–changing the recovery model to Simple might not reduce the size enough. to reduce it further<br />
DBCC SHRINKFILE (N’Test_log’ , 1)</p>
<p>–check file size<br />
select name,size from sys.database_files</p>
<p>Source: <a href="http://www.bostonwebdeveloper.com/2009/09/truncate-ms-sql-2008-database-log-file/" target="_blank">http://www.bostonwebdeveloper.com/2009/09/truncate-ms-sql-2008-database-log-file/</a></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ct91lOB_gng:EJAbWHcA4_g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ct91lOB_gng:EJAbWHcA4_g:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ct91lOB_gng:EJAbWHcA4_g:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=ct91lOB_gng:EJAbWHcA4_g:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ct91lOB_gng:EJAbWHcA4_g:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=ct91lOB_gng:EJAbWHcA4_g:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ct91lOB_gng:EJAbWHcA4_g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=ct91lOB_gng:EJAbWHcA4_g:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ct91lOB_gng:EJAbWHcA4_g:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ct91lOB_gng:EJAbWHcA4_g:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ct91lOB_gng:EJAbWHcA4_g:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=ct91lOB_gng:EJAbWHcA4_g:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=ct91lOB_gng:EJAbWHcA4_g:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=ct91lOB_gng:EJAbWHcA4_g:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CosmoCentral/~4/ct91lOB_gng" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2009/09/truncate-ms-sql-2008-database-log-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cosmocentral.com/2009/09/truncate-ms-sql-2008-database-log-file/</feedburner:origLink></item>
		<item>
		<title>How To Start / Stop MS SQL Server 2005</title>
		<link>http://feedproxy.google.com/~r/CosmoCentral/~3/zepUVtRrjBE/</link>
		<comments>http://www.cosmocentral.com/2009/09/how-to-start-stop-ms-sql-server-2005/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 22:32:04 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=565</guid>
		<description><![CDATA[How To Start / Stop MS SQL Server 2005]]></description>
			<content:encoded><![CDATA[<p>Open the MS DOS command prompt.</p>
<p>To start MS SQL Server type:<br />
<strong>net start mssqlserver</strong></p>
<p>To stop MS SQL Server type:<br />
<strong>net stop mssqlserver</strong></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=zepUVtRrjBE:OvDbAoriigc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=zepUVtRrjBE:OvDbAoriigc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=zepUVtRrjBE:OvDbAoriigc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=zepUVtRrjBE:OvDbAoriigc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=zepUVtRrjBE:OvDbAoriigc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=zepUVtRrjBE:OvDbAoriigc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=zepUVtRrjBE:OvDbAoriigc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=zepUVtRrjBE:OvDbAoriigc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=zepUVtRrjBE:OvDbAoriigc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=zepUVtRrjBE:OvDbAoriigc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=zepUVtRrjBE:OvDbAoriigc:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=zepUVtRrjBE:OvDbAoriigc:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=zepUVtRrjBE:OvDbAoriigc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=zepUVtRrjBE:OvDbAoriigc:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CosmoCentral/~4/zepUVtRrjBE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2009/09/how-to-start-stop-ms-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cosmocentral.com/2009/09/how-to-start-stop-ms-sql-server-2005/</feedburner:origLink></item>
		<item>
		<title>Php Visitor Counter File Based</title>
		<link>http://feedproxy.google.com/~r/CosmoCentral/~3/jB5UgI0_I9k/</link>
		<comments>http://www.cosmocentral.com/2009/08/php-visitor-counter-file-based/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 15:53:36 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=558</guid>
		<description><![CDATA[I am  not a Php programmer, these days I work with Asp .Net. However I used to work with Php in the past, and that gives me some edge working with simple php stuffs these days for clients, in case I need to.
One of my clients asked to do a visitor counter for them. Looking [...]]]></description>
			<content:encoded><![CDATA[<p>I am  not a Php programmer, these days I work with Asp .Net. However I used to work with Php in the past, and that gives me some edge working with simple php stuffs these days for clients, in case I need to.</p>
<p>One of my clients asked to do a visitor counter for them. Looking at the options it could be done in many ways e.g. file based, mySql based etc. To keep it simple I developed a file based version of the visitor counter for the client.</p>
<p>We had to make sure that only one visitor visit is counted for each visit to the website, and counter does not increase count for every page visit.</p>
<p><strong>Here is the scenario how it works:</strong></p>
<ul>
<li>The counter is placed on an include file which is used by all the pages, this way we can make sure that only one count per visitor visit is logged in the counter. I have put it on footer.php include file. Also we can have the counter working from any page no matter which page user first lands in on the website.</li>
<li>User lands on any page on the website.</li>
<li>Read the current count from the counter file.</li>
<li>We check if the counter session is set.</li>
<li>If the counter session is set, we do nothing but show the current visitor count.</li>
<li>If the counter session is not set we create a new session, increase the count by 1 and then write it back to the counter file.</li>
</ul>
<p><strong>How it works:</strong></p>
<p>Make a text file hitcounter.txt and make sure it have write permission.</p>
<p>Make an include file for the counter called counter.php. Here is the code for that.</p>
<blockquote><p>&lt;?php<br />
session_start();<br />
$count_my_page = (&#8221;hitcounter.txt&#8221;);<br />
$hits = file($count_my_page);<br />
if( !isset($_SESSION['last_access']) )<br />
{<br />
$_SESSION['last_access'] = time();<br />
$hits[0] ++;<br />
$fp = fopen($count_my_page , &#8220;w&#8221;);<br />
fputs($fp , &#8220;$hits[0]&#8220;);<br />
fclose($fp);<br />
}<br />
echo $hits[0];<br />
?&gt;</p></blockquote>
<p>Now all that left is calling this include file from the footer include file. Here is the code that just does that:</p>
<blockquote><p>You Are Visitor #:&amp;nbsp;&lt;/b&gt;&lt;?php include (&#8221;includes/counter.php&#8221;); ?&gt;</p></blockquote>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=jB5UgI0_I9k:NuEzTa5MeQw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=jB5UgI0_I9k:NuEzTa5MeQw:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=jB5UgI0_I9k:NuEzTa5MeQw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=jB5UgI0_I9k:NuEzTa5MeQw:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=jB5UgI0_I9k:NuEzTa5MeQw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=jB5UgI0_I9k:NuEzTa5MeQw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=jB5UgI0_I9k:NuEzTa5MeQw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=jB5UgI0_I9k:NuEzTa5MeQw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=jB5UgI0_I9k:NuEzTa5MeQw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=jB5UgI0_I9k:NuEzTa5MeQw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=jB5UgI0_I9k:NuEzTa5MeQw:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=jB5UgI0_I9k:NuEzTa5MeQw:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=jB5UgI0_I9k:NuEzTa5MeQw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=jB5UgI0_I9k:NuEzTa5MeQw:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CosmoCentral/~4/jB5UgI0_I9k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2009/08/php-visitor-counter-file-based/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cosmocentral.com/2009/08/php-visitor-counter-file-based/</feedburner:origLink></item>
		<item>
		<title>100% Height Div On Asp .Net Page</title>
		<link>http://feedproxy.google.com/~r/CosmoCentral/~3/1-GIyCOGI3g/</link>
		<comments>http://www.cosmocentral.com/2009/08/100-height-div-on-asp-net-page/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 15:58:57 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=550</guid>
		<description><![CDATA[Asp .Net pages need a form tag to have the cool Asp .Net controls working. What if you wanna have div with 100% height?]]></description>
			<content:encoded><![CDATA[<p>Asp .Net pages need a form tag to have the cool Asp .Net controls working. What if you wanna have div with 100% height? Lets try this code:</p>
<blockquote><p>&lt;%@ Page Language=&#8221;C#&#8221; AutoEventWireup=&#8221;true&#8221; CodeFile=&#8221;Test.aspx.cs&#8221; Inherits=&#8221;Test&#8221; %&gt;<br />
&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221; &gt;<br />
&lt;head runat=&#8221;server&#8221;&gt;<br />
&lt;title&gt;Untitled Page&lt;/title&gt;<br />
&lt;style media=&#8221;screen&#8221; type=&#8221;text/css&#8221;&gt;<br />
html,body {margin:0;padding:0;height:100%;}<br />
#container {width:790px;text-align:left;margin:0 auto 0 auto;padding:0;border:0;min-height:100%;position:relative;background:#ccc;}<br />
#header {background:#ff0;padding:10px;}<br />
#body {padding:10px;padding-bottom:60px;}<br />
#footer {position:absolute;bottom:0;width:100%;height:60px;background:#6cf;}<br />
&lt;/style&gt;<br />
&lt;!&#8211;[if lt IE 7]&gt;<br />
&lt;style media=&#8221;screen&#8221; type=&#8221;text/css&#8221;&gt;<br />
#container {<br />
height:100%;<br />
}<br />
&lt;/style&gt;<br />
&lt;![endif]&#8211;&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;form id=&#8221;form1&#8243; style=&#8221;height:100%;&#8221; runat=&#8221;server&#8221;&gt;<br />
&lt;div id=&#8221;container&#8221;&gt;<br />
aaa<br />
&lt;/div&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>Do you think you would get a 100% height for &lt;div id=&#8221;container&#8221;&gt;? Not relly. Different browsers act differently on this. IE seem to work fine without any problem However Mozilla does not work.</p>
<p><strong>Why?</strong></p>
<p>Although body, html, and the Div with id=&#8221;container&#8221; has the 100% height opened up, <strong>form</strong> element does not have a 100% height.</p>
<p><strong>Solution</strong></p>
<p>Simply open the 100% height for the form element that should get you 100% height. Here is the revised code:</p>
<blockquote><p>&lt;%@ Page Language=&#8221;C#&#8221; AutoEventWireup=&#8221;true&#8221; CodeFile=&#8221;Test.aspx.cs&#8221; Inherits=&#8221;Test&#8221; %&gt;<br />
&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221; &gt;<br />
&lt;head runat=&#8221;server&#8221;&gt;<br />
&lt;title&gt;Untitled Page&lt;/title&gt;<br />
&lt;style media=&#8221;screen&#8221; type=&#8221;text/css&#8221;&gt;<br />
html,body {margin:0;padding:0;height:100%;}<br />
#container {width:790px;text-align:left;margin:0 auto 0 auto;padding:0;border:0;min-height:100%;position:relative;background:#ccc;}<br />
#header {background:#ff0;padding:10px;}<br />
#body {padding:10px;padding-bottom:60px;}<br />
#footer {position:absolute;bottom:0;width:100%;height:60px;background:#6cf;}<br />
&lt;/style&gt;<br />
&lt;!&#8211;[if lt IE 7]&gt;<br />
&lt;style media=&#8221;screen&#8221; type=&#8221;text/css&#8221;&gt;<br />
#container {<br />
height:100%;<br />
}<br />
&lt;/style&gt;<br />
&lt;![endif]&#8211;&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;form id=&#8221;form1&#8243;<span style="color: #ff0000;"><strong> style=&#8221;height:100%;&#8221;</strong></span> runat=&#8221;server&#8221;&gt;<br />
&lt;div id=&#8221;container&#8221;&gt;<br />
aaa<br />
&lt;/div&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>For the demonstration, I placed an inline style for the form tag:</p>
<p>&lt;form id=&#8221;form1&#8243; style=&#8221;height:100%;&#8221; runat=&#8221;server&#8221;&gt;</p>
<p>You can use a css class if you like.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=1-GIyCOGI3g:2Bc6rTVEfuo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=1-GIyCOGI3g:2Bc6rTVEfuo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=1-GIyCOGI3g:2Bc6rTVEfuo:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=1-GIyCOGI3g:2Bc6rTVEfuo:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=1-GIyCOGI3g:2Bc6rTVEfuo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=1-GIyCOGI3g:2Bc6rTVEfuo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=1-GIyCOGI3g:2Bc6rTVEfuo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=1-GIyCOGI3g:2Bc6rTVEfuo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=1-GIyCOGI3g:2Bc6rTVEfuo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=1-GIyCOGI3g:2Bc6rTVEfuo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=1-GIyCOGI3g:2Bc6rTVEfuo:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=1-GIyCOGI3g:2Bc6rTVEfuo:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=1-GIyCOGI3g:2Bc6rTVEfuo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=1-GIyCOGI3g:2Bc6rTVEfuo:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CosmoCentral/~4/1-GIyCOGI3g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2009/08/100-height-div-on-asp-net-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cosmocentral.com/2009/08/100-height-div-on-asp-net-page/</feedburner:origLink></item>
		<item>
		<title>How to Check IIS Version on Website?</title>
		<link>http://feedproxy.google.com/~r/CosmoCentral/~3/D5TaeleGc2A/</link>
		<comments>http://www.cosmocentral.com/2009/07/how-to-check-iis-version-on-website/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 22:31:49 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=546</guid>
		<description><![CDATA[How do you check the version of IIS on the server of a website?]]></description>
			<content:encoded><![CDATA[<p>How do you check the version of IIS on the server of a website?</p>
<p>Simply put this on the code behind of a page:</p>
<p>Response.Write(Request.ServerVariables["SERVER_SOFTWARE"]);</p>
<p>When you view the page it should show you something like this:</p>
<p>Microsoft-IIS/6.0</p>
<p>Where 6.0 is the version.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=D5TaeleGc2A:8OQoIf8OKUQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=D5TaeleGc2A:8OQoIf8OKUQ:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=D5TaeleGc2A:8OQoIf8OKUQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=D5TaeleGc2A:8OQoIf8OKUQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=D5TaeleGc2A:8OQoIf8OKUQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=D5TaeleGc2A:8OQoIf8OKUQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=D5TaeleGc2A:8OQoIf8OKUQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=D5TaeleGc2A:8OQoIf8OKUQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=D5TaeleGc2A:8OQoIf8OKUQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=D5TaeleGc2A:8OQoIf8OKUQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=D5TaeleGc2A:8OQoIf8OKUQ:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=D5TaeleGc2A:8OQoIf8OKUQ:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=D5TaeleGc2A:8OQoIf8OKUQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=D5TaeleGc2A:8OQoIf8OKUQ:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CosmoCentral/~4/D5TaeleGc2A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2009/07/how-to-check-iis-version-on-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cosmocentral.com/2009/07/how-to-check-iis-version-on-website/</feedburner:origLink></item>
		<item>
		<title>ASP .Net Code Within JavaScript</title>
		<link>http://feedproxy.google.com/~r/CosmoCentral/~3/YvjGkj-9XZU/</link>
		<comments>http://www.cosmocentral.com/2009/07/asp-net-code-within-javascript/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 16:27:06 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=543</guid>
		<description><![CDATA[Simple thing really, often times you might need to use a asp .net variable within javascript code. How you do that?

Declare the variable as protected(public will do as well)
Set the code on JavaScript to use the Asp .net Variable within JavaScript

Example:
Declare the variable as protected like this.
protected string myVar;
On your code you would initialize it [...]]]></description>
			<content:encoded><![CDATA[<p>Simple thing really, often times you might need to use a asp .net variable within javascript code. How you do that?</p>
<ul>
<li>Declare the variable as protected(public will do as well)</li>
<li>Set the code on JavaScript to use the Asp .net Variable within JavaScript</li>
</ul>
<p><strong>Example:</strong></p>
<p>Declare the variable as protected like this.</p>
<p>protected string myVar;</p>
<p>On your code you would initialize it somewhere. e.g. myVar=&#8221;Great webmaster forum webcosmoForums.com&#8221;;</p>
<p>Set the code on JavaScript to use the Asp .net Variable within JavaScript e.g.</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>var aVar= &#8216;&lt;%=myVar %&gt;&#8217;;    /*= here is shorthand for Response.Write*/</p>
<p>alert(aVar);</p>
<p>&lt;/script&gt;</p></blockquote>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=YvjGkj-9XZU:--78UF-RDTY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=YvjGkj-9XZU:--78UF-RDTY:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=YvjGkj-9XZU:--78UF-RDTY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=YvjGkj-9XZU:--78UF-RDTY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=YvjGkj-9XZU:--78UF-RDTY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=YvjGkj-9XZU:--78UF-RDTY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=YvjGkj-9XZU:--78UF-RDTY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=YvjGkj-9XZU:--78UF-RDTY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=YvjGkj-9XZU:--78UF-RDTY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=YvjGkj-9XZU:--78UF-RDTY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=YvjGkj-9XZU:--78UF-RDTY:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=YvjGkj-9XZU:--78UF-RDTY:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=YvjGkj-9XZU:--78UF-RDTY:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=YvjGkj-9XZU:--78UF-RDTY:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CosmoCentral/~4/YvjGkj-9XZU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2009/07/asp-net-code-within-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cosmocentral.com/2009/07/asp-net-code-within-javascript/</feedburner:origLink></item>
		<item>
		<title>payment_status value in Paypal Sandbox always pending</title>
		<link>http://feedproxy.google.com/~r/CosmoCentral/~3/g0CTB6T2Uek/</link>
		<comments>http://www.cosmocentral.com/2009/07/payment_status-value-in-paypal-sandbox-always-pending/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 17:59:49 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[paypal developer]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=539</guid>
		<description><![CDATA[I was working with the Paypal sandbox to test a Paypal application for a client. I was using IPN for the payment notification from PayPal so I could update member record on database. While testing I was getting the payment_status value Pending. ]]></description>
			<content:encoded><![CDATA[<p>I was working with the Paypal sandbox to test a Paypal application for a client. I was using IPN for the payment notification from PayPal so I could update member record on database. While testing I was getting the payment_status value Pending.  I played with the sandbox account after I created it, so things might have got messed up. After searching these steps below seem to have solved the problem getting me payment_status value Completed.</p>
<p><span>1. Login to your Developer Central.</span></p>
<p><span>2. Click on Test Accounts tab on the left.</span> You should have created these test accounts for testing on Sandbox.</p>
<p><span>3. Find the column &#8216;Payment Review&#8217;.</span></p>
<p><span>4. Find the sandbox account you are using  and click on &#8220;Enabled&#8221; in the &#8216;Payment Review&#8217; column.</span></p>
<p><span>5. This should change to &#8220;Disabled&#8221; and now payments funded from your balance and credit card will complete instantly.</span></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=g0CTB6T2Uek:JnQEzojzIGg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=g0CTB6T2Uek:JnQEzojzIGg:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=g0CTB6T2Uek:JnQEzojzIGg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=g0CTB6T2Uek:JnQEzojzIGg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=g0CTB6T2Uek:JnQEzojzIGg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=g0CTB6T2Uek:JnQEzojzIGg:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=g0CTB6T2Uek:JnQEzojzIGg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=g0CTB6T2Uek:JnQEzojzIGg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=g0CTB6T2Uek:JnQEzojzIGg:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=g0CTB6T2Uek:JnQEzojzIGg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=g0CTB6T2Uek:JnQEzojzIGg:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=g0CTB6T2Uek:JnQEzojzIGg:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=g0CTB6T2Uek:JnQEzojzIGg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=g0CTB6T2Uek:JnQEzojzIGg:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CosmoCentral/~4/g0CTB6T2Uek" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2009/07/payment_status-value-in-paypal-sandbox-always-pending/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cosmocentral.com/2009/07/payment_status-value-in-paypal-sandbox-always-pending/</feedburner:origLink></item>
		<item>
		<title>Finding Controls in Repeater/DataList From The Event Handler</title>
		<link>http://feedproxy.google.com/~r/CosmoCentral/~3/WHCmd5mWnn8/</link>
		<comments>http://www.cosmocentral.com/2009/06/finding-controls-in-repeaterdatalist-from-the-event-handler/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 17:09:50 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=536</guid>
		<description><![CDATA[You may have Button, DropDownList etc controls in a Repeater/DataList that generates an Event. From those event handlers how do you find other controls inside the Repeater/DataList, in case you need the values from other controls.]]></description>
			<content:encoded><![CDATA[<p>You may have Button, DropDownList etc controls in a Repeater/DataList that generates an Event. From those event handlers how do you find other controls inside the Repeater/DataList, in case you need the values from other controls.</p>
<p>Here in this example below we have a button and a textbox inside a Repeater. The Button have an OnClick event. Inside that event handler we want to get the value from the TextBox.</p>
<p>&lt;asp:repeater id=&#8221;rpt&#8221;&#8230;&#8230;&gt;<br />
&lt;ItemTemplate&gt;<br />
&lt;asp:TextBox id=&#8221;txt&#8221; runat=&#8221;server&#8221; /&gt;<br />
&lt;asp:Button id=&#8221;btn&#8221; Text=&#8221;TEST&#8221; onclick=&#8221;btn_Click&#8221; runat=&#8221;server&#8221;/&gt;<br />
&lt;/ItemTemplate&gt;<br />
&lt;/asp:Repeater&gt;</p>
<p>protected void btn_Click(object sender, System.EventArgs e)<br />
{<br />
Button btn=(Button)sender;<br />
Repeater rpt=(Repeater)btn.Parent;<br />
//now you can use this rpt to find any control inside it<br />
//For example<br />
TextBox txt=(TextBox)rpt.FindControl(&#8221;txt&#8221;);<br />
string val=txt.Text;<br />
}</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=WHCmd5mWnn8:tKYzDmZHGn8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=WHCmd5mWnn8:tKYzDmZHGn8:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=WHCmd5mWnn8:tKYzDmZHGn8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=WHCmd5mWnn8:tKYzDmZHGn8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=WHCmd5mWnn8:tKYzDmZHGn8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=WHCmd5mWnn8:tKYzDmZHGn8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=WHCmd5mWnn8:tKYzDmZHGn8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=WHCmd5mWnn8:tKYzDmZHGn8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=WHCmd5mWnn8:tKYzDmZHGn8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=WHCmd5mWnn8:tKYzDmZHGn8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=WHCmd5mWnn8:tKYzDmZHGn8:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=WHCmd5mWnn8:tKYzDmZHGn8:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=WHCmd5mWnn8:tKYzDmZHGn8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=WHCmd5mWnn8:tKYzDmZHGn8:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CosmoCentral/~4/WHCmd5mWnn8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2009/06/finding-controls-in-repeaterdatalist-from-the-event-handler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cosmocentral.com/2009/06/finding-controls-in-repeaterdatalist-from-the-event-handler/</feedburner:origLink></item>
		<item>
		<title>The text, ntext, and image data types are invalid in this subquery or aggregate expression</title>
		<link>http://feedproxy.google.com/~r/CosmoCentral/~3/f50hhozoxV8/</link>
		<comments>http://www.cosmocentral.com/2009/06/the-text-ntext-and-image-data-types-are-invalid-in-this-subquery-or-aggregate-expression-the-text-ntext-and-image-data-types-are-invalid-in-this-subquery-or-aggregate-expression/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 15:40:10 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=530</guid>
		<description><![CDATA[I have a client I was building an e-commerce website for. I was developing the website on MS SQL 2005 Database, but their deployment server have MS SQL 2000. From experience I knew there are some stuffs that would not work in MS SQL 2000, so I avoid them. This one missed my eyes. I get this error message on the search results page:

The text, ntext, and image data types are invalid in this subquery or aggregate expression.]]></description>
			<content:encoded><![CDATA[<p>I have a client I was building an e-commerce website for. I was developing the website on MS SQL 2005 Database, but their deployment server have MS SQL 2000. From experience I knew there are some stuffs that would not work in MS SQL 2000, so I avoid them. This one missed my eyes. I get this error message on the search results page:</p>
<p><span style="color: #ff0000;"><strong><span id="ctl00_ctl00_cphContent_cphMainContent_lblStatus" class="orange">The text, ntext, and image data types are invalid in this subquery or aggregate expression.</span></strong></span></p>
<p><span class="orange">After checking I found I was trying to get a TEXT column in a subquery, and that was causing the problem. An example query is:</span></p>
<p><span style="color: #0000ff;"><span class="orange">Select customerName,customerNote=(select top 1<strong> note</strong> from customerNotes Where customerId=C.customerId) from Customers C</span></span></p>
<p><span class="orange">Note that the column NOTE is a text column that was causing the problem.</span></p>
<p><strong><span class="orange">Solution:</span></strong></p>
<p><span class="orange">The text column need to be retrieved as a varchar column. Rewriting the query this way solves the problemma:</span></p>
<p><span style="color: #0000ff;"><span class="orange">Select customerName,customerNote=(select top 1<strong> Cast(note As varchar(500))</strong> from customerNotes Where customerId=C.customerId) from Customers C</span></span></p>
<p><span class="orange">You can also use Convert instead of Cast like this:</span></p>
<p><span style="color: #0000ff;"><span class="orange">Select customerName,customerNote=(select top 1<strong> Convert(</strong></span><span class="orange"><strong>varchar(500),</strong></span><span class="orange"><strong>note)</strong> from customerNotes Where customerId=C.customerId) from Customers C</span></span></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=f50hhozoxV8:uC-WQ3W0BME:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=f50hhozoxV8:uC-WQ3W0BME:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=f50hhozoxV8:uC-WQ3W0BME:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=f50hhozoxV8:uC-WQ3W0BME:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=f50hhozoxV8:uC-WQ3W0BME:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=f50hhozoxV8:uC-WQ3W0BME:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=f50hhozoxV8:uC-WQ3W0BME:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=f50hhozoxV8:uC-WQ3W0BME:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=f50hhozoxV8:uC-WQ3W0BME:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=f50hhozoxV8:uC-WQ3W0BME:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=f50hhozoxV8:uC-WQ3W0BME:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=f50hhozoxV8:uC-WQ3W0BME:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CosmoCentral?a=f50hhozoxV8:uC-WQ3W0BME:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CosmoCentral?i=f50hhozoxV8:uC-WQ3W0BME:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CosmoCentral/~4/f50hhozoxV8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2009/06/the-text-ntext-and-image-data-types-are-invalid-in-this-subquery-or-aggregate-expression-the-text-ntext-and-image-data-types-are-invalid-in-this-subquery-or-aggregate-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cosmocentral.com/2009/06/the-text-ntext-and-image-data-types-are-invalid-in-this-subquery-or-aggregate-expression-the-text-ntext-and-image-data-types-are-invalid-in-this-subquery-or-aggregate-expression/</feedburner:origLink></item>
	</channel>
</rss>
