<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4128767709785759609</id><updated>2011-11-27T17:30:01.056-08:00</updated><category term='Network'/><category term='Visual Studio'/><category term='Windows Forms'/><category term='jQuery'/><category term='helm'/><category term='CSS'/><category term='Email'/><category term='Javascript'/><category term='Web Services'/><category term='SQL Server'/><category term='AJAX'/><category term='VB.NET'/><category term='Windows'/><category term='Security'/><category term='IIS'/><category term='ASP.NET'/><category term='C#'/><category term='PHP'/><category term='VBA'/><category term='Web server'/><category term='Firefox'/><category term='FTP'/><category term='HTML'/><category term='Software'/><category term='Tools'/><category term='SSL'/><category term='Apache'/><category term='Web development'/><category term='SQL std'/><category term='.NET'/><category term='Excel'/><title type='text'>w3 Dev BLOG - Share the knowledge .NET</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default?start-index=101&amp;max-results=100'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>129</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-4613519351650475803</id><published>2011-11-01T08:19:00.000-07:00</published><updated>2011-11-01T08:26:15.491-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>Windows 7: How to access password protected shared folder</title><content type='html'>How to pass current Windows credentials to password protected network share&lt;br /&gt;&lt;br /&gt;1. Create user/password on destination computer matching the user/password of current computer&lt;br /&gt;2. Share a folder on the destination computer giving access to the new created user&lt;br /&gt;3. On current computer change the local security settings as following:&lt;br /&gt;   3.1 Open Local Security Policy Console&lt;br /&gt;   3.2 Select Local policies -&gt; Security Options -&gt; Network security: LAN Manager authentication level&lt;br /&gt;   3.3 Select Send LM and NTLM response and click OK.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can also specify different user to connect by during mapping a network drive on the destination computer.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-4613519351650475803?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/4613519351650475803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2011/11/windows-7-how-to-access-password.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/4613519351650475803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/4613519351650475803'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2011/11/windows-7-how-to-access-password.html' title='Windows 7: How to access password protected shared folder'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-2580257103048599219</id><published>2011-07-14T08:42:00.000-07:00</published><updated>2011-07-14T08:54:49.666-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><title type='text'>IIS Redirection with Page and Query String</title><content type='html'>By default IIS redirects to a given domain and/or application.&lt;br /&gt;The web page and query string can be transferred to the destination url by using the respective parameters $S and $Q.&lt;br /&gt;&lt;br /&gt;Ex. &lt;br /&gt;&lt;span style="font-style:italic;"&gt;template:&lt;/span&gt; http://example.com$S$Q&lt;br /&gt;&lt;span style="font-style:italic;"&gt;redirection from &lt;/span&gt;&lt;br /&gt;http://old-example.com/default.aspx?id=1 &lt;br /&gt;&lt;span style="font-style:italic;"&gt;will lead to&lt;/span&gt; &lt;br /&gt;http://example.com/default.aspx?id=1&lt;br /&gt;&lt;br /&gt;In IIS 6 the checkbox "Exact Url" will avoid appending the web page to the query string.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-2580257103048599219?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/2580257103048599219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2011/07/iis-redirection-with-page-and-query.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2580257103048599219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2580257103048599219'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2011/07/iis-redirection-with-page-and-query.html' title='IIS Redirection with Page and Query String'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7933326429527155599</id><published>2011-04-22T08:53:00.000-07:00</published><updated>2011-08-11T04:00:10.207-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><title type='text'>How to concatenate row data into string using SQL</title><content type='html'>Very simple way to achieve this is to use FOR XML statement. The result of the following example is list of user names including first and last name separated by commas.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span"&gt;SELECT FirstName+' '+LastName+', ' FROM UserProfile FOR XML PATH('')&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;But the result string ends with a comma and space. We can either remove it by SUBSTR or REPLACE functions. Using REPLACE as it is shown below saves the usage of subquery or calcualtion of the length of the same expression.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span"&gt;SELECT&lt;br /&gt;REPLACE((REPLACE((REPLACE(&lt;br /&gt;(SELECT FirstName+' '+LastName FROM UserProfile FOR XML PATH('A'))&lt;br /&gt;,'&amp;lt;/A&amp;gt;&amp;lt;A&amp;gt;',', '))&lt;br /&gt;, '&amp;lt;/A&amp;gt;',''))&lt;br /&gt;,'&amp;lt;A&amp;gt;','')&lt;/a&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;a&gt;&lt;br /&gt;&lt;br /&gt;Here is another way to achieve this which might be convinient in stored procedures.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span"&gt;DECLARE @Names VARCHAR(8000)&lt;br /&gt;set @Names=''&lt;br /&gt;SELECT @Names = @Names + CASE WHEN @Names&amp;lt;&amp;gt;''&lt;br /&gt;THEN ', ' ELSE '' END + Name&lt;br /&gt;FROM Users&lt;br /&gt;SELECT @Names&lt;/span&gt;&lt;/blockquote&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7933326429527155599?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7933326429527155599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2011/07/how-to-concatenate-row-data-into-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7933326429527155599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7933326429527155599'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2011/07/how-to-concatenate-row-data-into-string.html' title='How to concatenate row data into string using SQL'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-8621554989798136655</id><published>2011-01-23T08:44:00.000-08:00</published><updated>2011-01-23T08:55:27.089-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><title type='text'>Solution on "HTTP Error 414 Request URI too long"  error using getJSON</title><content type='html'>The explanation of 414 error is described here:&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/248061" target="_blank"&gt;http://support.microsoft.com/kb/248061&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;With regard to JSON queries with jQuery this basically means we are not able to use long GET parameters. But for sure this is necessary for sending bigger objects serialized as JSON.&lt;br /&gt;The solution would be using POST requests, but is jQuery support that?&lt;br /&gt;&lt;br /&gt;The answer is yes if we just extend jQuery with post requests as it is described in jQuery forum:&lt;br /&gt;&lt;a href="http://forum.jquery.com/topic/getjson-using-post" target="_blank"&gt;http://forum.jquery.com/topic/getjson-using-post&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;jQuery.extend({&lt;br /&gt;   postJSON: function( url, data, callback) {&lt;br /&gt;      return jQuery.post(url, data, callback, "json");&lt;br /&gt;   }&lt;br /&gt;});&lt;/blockquote&gt;&lt;br /&gt;Then just replace getJSON with postJSON where it is needed.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-8621554989798136655?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/8621554989798136655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2011/01/solution-on-http-error-414-request-uri.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8621554989798136655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8621554989798136655'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2011/01/solution-on-http-error-414-request-uri.html' title='Solution on &quot;HTTP Error 414 Request URI too long&quot;  error using getJSON'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-3466635448835005501</id><published>2010-12-29T03:07:00.000-08:00</published><updated>2010-12-29T03:23:33.102-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>IIS Url Rewriting - avoid repeat of querystring parameters</title><content type='html'>Using the URL rewriting mechanism of IIS causes repeat of querystring parameters on every postback, because it builds the postaback url (rewrites url) by appending the querystring to current url.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Actual url:&lt;/div&gt;&lt;div&gt;/product.aspx?type=hats&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rewritten url:&lt;/div&gt;&lt;div&gt;/product/hats&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rewritten url after postback:&lt;/div&gt;&lt;div&gt;/product/hats?type=hats&lt;/div&gt;&lt;div&gt;which is actually equal to /product.aspx?type=hats&amp;amp;type=hats&lt;/div&gt;&lt;div&gt;So the &lt;i&gt;type&lt;/i&gt; value is "hats,hats". &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To avoid repeat of querystring variables simply check if the url is already rewritten:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;    if ( !String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_ORIGINAL_URL"]) )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;    {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;        form1.Action = Request.ServerVariables["HTTP_X_ORIGINAL_URL"];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Detailed description:&lt;/div&gt;&lt;div&gt;&lt;a href="http://blogs.iis.net/ruslany/archive/2008/10/23/asp-net-postbacks-and-url-rewriting.aspx"&gt;http://blogs.iis.net/ruslany/archive/2008/10/23/asp-net-postbacks-and-url-rewriting.aspx&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-3466635448835005501?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/3466635448835005501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2010/12/iis-url-rewriting-avoid-repeat-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3466635448835005501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3466635448835005501'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2010/12/iis-url-rewriting-avoid-repeat-of.html' title='IIS Url Rewriting - avoid repeat of querystring parameters'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-4508617128311782815</id><published>2010-11-23T01:57:00.000-08:00</published><updated>2011-08-23T02:03:49.791-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server Express and IIS: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path.</title><content type='html'>SQL Express user instancing fails with the default IIS 7.x configuration. To solve this you can do the following:&lt;br /&gt;&lt;br /&gt;1. Create new application pool in IIS&lt;br /&gt;2. Open Application Pool Advanced settings&lt;br /&gt;3. Change Identity from ApplicationPoolIdentity to NETWORK SERVICE and confirm&lt;br /&gt;4. Change the application pool that the web application belongs to by opening Advanced setting of the web application&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-4508617128311782815?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/4508617128311782815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2010/11/sql-server-express-and-iis-failed-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/4508617128311782815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/4508617128311782815'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2010/11/sql-server-express-and-iis-failed-to.html' title='SQL Server Express and IIS: Failed to generate a user instance of SQL Server due to failure in retrieving the user&apos;s local application data path.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-3305505266288322282</id><published>2010-10-11T08:04:00.000-07:00</published><updated>2010-10-11T08:14:38.862-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>3 ways to get date in SQL without time</title><content type='html'>Here are 3 ways of getting date-only part of timestamp in SQL Server:&lt;br /&gt;&lt;br /&gt;1. DATEADD( DAY, 0 , DATEDIFF(DAY,0, CURRENT_TIMESTAMP) )&lt;br /&gt;&lt;br /&gt;2. CONVERT( datetime, FLOOR(CONVERT(float(24), GETDATE())) )&lt;br /&gt;&lt;br /&gt;3. CAST( CONVERT(CHAR(8), GETDATE(),112) as DATETIME)&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-3305505266288322282?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/3305505266288322282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2010/10/3-ways-to-get-date-in-sql-without-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3305505266288322282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3305505266288322282'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2010/10/3-ways-to-get-date-in-sql-without-time.html' title='3 ways to get date in SQL without time'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-2092251652658336947</id><published>2010-09-02T13:58:00.000-07:00</published><updated>2010-09-02T14:26:02.353-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Services'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Passing Parameters to .NET Web Service as a Query String (GET Method) or POST Request</title><content type='html'>First of all the way of passing parameters must be defined in web.config as follows:&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;lt;webServices&amp;gt;&lt;br /&gt;  &amp;lt;protocols&amp;gt;&lt;br /&gt;    &amp;lt;add name="HttpGet"/&amp;gt;&lt;br /&gt;    &amp;lt;add name="HttpPost"/&amp;gt;&lt;br /&gt;  &amp;lt;/protocols&amp;gt;&lt;br /&gt;&amp;lt;/webServices&amp;gt;&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Then the URL of the web service may include parameters as query string.&lt;br /&gt;http://tempuri.org/webservice.asmx/MethodCaseSensitive?parameter1=yes&amp;amp;parameter2=123&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;MethodCaseSensitive &lt;/span&gt;is the name of web method to be performed as part of the webservice called&lt;span style="font-weight: bold;"&gt; webservice.asmx&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In case you need POST method of sending parameters just use a form and text fields as in the following example:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;form name="input" action="http://tempuri.org/webservice.asmx/MethodCaseSensitive" method="post"&amp;gt;&lt;br /&gt;&amp;lt;input name="parameter1" type="text"&amp;gt;&lt;br /&gt;&amp;lt;input name="parameter2" type="text"&amp;gt;&lt;br /&gt;&amp;lt;input value="Submit" type="submit"&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Both of methods return XML response as it is defined in the web method.&lt;br /&gt;&lt;br /&gt;The Web Service results can be easily checked using the .NET ability for integrated passing of parametersin a web interface:&lt;br /&gt;http://tempuri.org/webservice.asmx?op=MethodCaseSensitive&lt;br /&gt;&lt;br /&gt;The screen allows the user to enter web service parameters and submit them. The result is the same.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-2092251652658336947?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/2092251652658336947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2010/09/passing-parameters-to-net-web-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2092251652658336947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2092251652658336947'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2010/09/passing-parameters-to-net-web-service.html' title='Passing Parameters to .NET Web Service as a Query String (GET Method) or POST Request'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-5174417668208264127</id><published>2010-02-18T12:36:00.000-08:00</published><updated>2010-02-18T12:44:33.201-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>How to add custom shortcuts in Save / Open dialogs on Windows Vista</title><content type='html'>1. Start Group Policy Editor by starting gpedit.msc&lt;br /&gt;2. Navigate to:&lt;br /&gt;     User Configuration -&gt; Administrative Templates -&gt; Windows Components -&gt; Windows Explorer -&gt; Common Open File Dialog&lt;br /&gt;3. Open "Items displayed in Place Bar"&lt;br /&gt;4. Enter appropriate paths for you shortcuts&lt;br /&gt;&lt;br /&gt;The changes take effect immediately.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-5174417668208264127?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/5174417668208264127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2010/02/how-to-add-custom-shortcuts-in-save.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5174417668208264127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5174417668208264127'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2010/02/how-to-add-custom-shortcuts-in-save.html' title='How to add custom shortcuts in Save / Open dialogs on Windows Vista'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7178125211439826889</id><published>2010-01-16T04:35:00.000-08:00</published><updated>2010-02-16T04:36:48.581-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Stop a postback by javascript with IE7</title><content type='html'>Somehow the statement javascritpt:return false; doesnt work with IE 7. But there is a workaround by setting the event.returnValue to false.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;OnClientClick="javascript:event.returnValue=false; return false;"&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7178125211439826889?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7178125211439826889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2010/01/stop-postback-by-javascript-with-ie7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7178125211439826889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7178125211439826889'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2010/01/stop-postback-by-javascript-with-ie7.html' title='Stop a postback by javascript with IE7'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-3137599946594811568</id><published>2010-01-10T14:46:00.000-08:00</published><updated>2010-01-10T14:57:52.494-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Minifying javascript source files.</title><content type='html'>I just want to recommend you a very simple tool called &lt;a href="http://www.crockford.com/javascript/jsmin.html"&gt;JSMin&lt;/a&gt;, which helps minifying the javascript sources. This code improvement significantly decreases the download time because of the smaller page size. The toll successfully removes whitespaces and comments which are not needed on client side.&lt;br /&gt;&lt;br /&gt;The tool is available as a script or a console application.&lt;br /&gt;&lt;br /&gt;The usage of jsmin.exe is simple:&lt;br /&gt;jsmin.exe &lt;source_file.js&gt; output.js&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-3137599946594811568?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/3137599946594811568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2010/01/minifying-javascript-source-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3137599946594811568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3137599946594811568'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2010/01/minifying-javascript-source-files.html' title='Minifying javascript source files.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-762999351038933584</id><published>2010-01-09T01:35:00.000-08:00</published><updated>2010-01-11T01:46:38.340-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Query String</title><content type='html'>The query string is reachable through window.location.search property. Splitting it by &amp;amp; gives you list of passed GET parameters.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;function GetPageParameter(param) {  &lt;br /&gt;         var query ='';&lt;br /&gt;   if (window.location.search.length&gt;3){&lt;br /&gt;       //removes '?' from the query string&lt;br /&gt;       query = window.location.search.substring(1);&lt;br /&gt;   }else{&lt;br /&gt;       return '';&lt;br /&gt;   }&lt;br /&gt;   params = query.split("&amp;amp;");&lt;br /&gt;   for (i=0;i&lt;params.length;i++) pair="params[i].split(&amp;quot;=&amp;quot;);" if="" length=""&gt;1){&lt;br /&gt;           if (pair[0] == param) {&lt;br /&gt;               return pair[1];&lt;br /&gt;           }&lt;br /&gt;       }else{&lt;br /&gt;           return '';&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   return '';&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var value = GetPageParameter("value");&lt;/params.length;i++)&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-762999351038933584?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/762999351038933584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2010/01/javascript-query-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/762999351038933584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/762999351038933584'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2010/01/javascript-query-string.html' title='Javascript Query String'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-6470819171494240286</id><published>2009-12-21T11:31:00.000-08:00</published><updated>2009-12-21T12:14:50.641-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How to fix a WebClient timeout issue</title><content type='html'>The issue occurs when the time for generating the whole response of a WebClient request is longer than the default timeout (2 minutes / 60000 miliseconds) . So the solution is to increase this timout value. The WebClient class doesn't have such property or method, so you have 2 possibilities:&lt;br /&gt;&lt;br /&gt;1. Use HttpWebRequest instead of WebClient and set its timeout by ReadWriteTimeout property. Of course the usage of this class is more complex than WebClisnt's one but it gives you more flexibility.&lt;br /&gt;&lt;br /&gt;2. Make a derived class (wrapper) , which willset the timeout propery of the base class of the WebClient.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre class="prettyprint"&gt;&lt;code&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;MyWebClient&lt;/span&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;WebClient&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun"&gt;{&lt;br /&gt;   //time in milliseconds&lt;br /&gt;&lt;/span&gt;&lt;span class="pln"&gt;    private int timeout;&lt;br /&gt;   public int Timeout&lt;br /&gt;   {&lt;br /&gt;           get {&lt;br /&gt;               return timeout;&lt;br /&gt;           }&lt;br /&gt;           set {&lt;br /&gt;               timeout = value;&lt;br /&gt;           }&lt;br /&gt;    }&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="typ"&gt;MyWebClient&lt;/span&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="pun"&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;           &lt;/span&gt;&lt;span class="kwd"&gt;this&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;timeout&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pun"&gt; =&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;60000&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="pln"&gt;     &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="typ"&gt;MyWebClient&lt;/span&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="pun"&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;timeout&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;           &lt;/span&gt;&lt;span class="kwd"&gt;this&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;timeout&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pun"&gt; =&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;timeout&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class="kwd"&gt;protected&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;override&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;WebRequest&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;GetWebRequest&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;Uri&lt;/span&gt;&lt;span class="pln"&gt; address&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span class="pun"&gt;   {&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;           &lt;/span&gt;&lt;span class="kwd"&gt;var&lt;/span&gt;&lt;span class="pln"&gt; result &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;base&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;GetWebRequest&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;address&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;           result&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Timeout&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; this.timeout&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;           &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; result&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="typ"&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pun"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;The usage is pretty much the same as the WebClient's usage but we have to specify the new timeout in the constructor or by setting the Timeout property:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre class="prettyprint"&gt;&lt;code&gt;&lt;span class="typ"&gt;MyWebClient&lt;/span&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="pun"&gt;&lt;/span&gt;&lt;/code&gt; &lt;code&gt;&lt;span class="pun"&gt;wClient = new &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="typ"&gt;MyWebClient&lt;/span&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="pun"&gt;&lt;/span&gt;&lt;/code&gt;(&lt;code&gt;&lt;span class="pun"&gt;1800000);&lt;br /&gt;          &lt;br /&gt;UTF8Encoding objUTF8 = new UTF8Encoding();&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;    {               &lt;br /&gt;           byte[] data = &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pun"&gt;wClient&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pun"&gt;.DownloadData(url);&lt;br /&gt;&lt;br /&gt;           File.WriteAllBytes(&lt;br /&gt;             System.AppDomain.CurrentDomain.BaseDirectory + @"\files\output.xls", data);&lt;br /&gt;&lt;br /&gt;           &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pun"&gt;wClient &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pun"&gt;= null;&lt;br /&gt;           objUTF8 = null;&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;          objWebClient = null;&lt;br /&gt;          objUTF8 = null;&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; &lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;As you see this timeout property solves the problems by client side. The server response should also have longer timeout for generating the response. It is set by machine.config or web.config - &lt;a href="http://msdn.microsoft.com/en-us/library/e1f13641%28VS.71%29.aspx"&gt;httpRuntime &lt;/a&gt;section. Note that the timeout in web.config is specified in seconds.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-6470819171494240286?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/6470819171494240286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2009/12/how-to-fix-webclient-timeout-issue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6470819171494240286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6470819171494240286'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2009/12/how-to-fix-webclient-timeout-issue.html' title='How to fix a WebClient timeout issue'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-3777175808880377033</id><published>2009-10-05T01:52:00.000-07:00</published><updated>2009-10-05T02:03:24.735-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL – Cannot resolve collation conflict for equal to operation</title><content type='html'>When the sql collation of strings is not equal but need to me compared we need to explicitly define the collation. The most common way is the using of the default database collation as in the example:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;WHERE Table1.Name COLLATE DATABASE_DEFAULT=Table2.Name COLLATE DATABASE_DEFAULT&lt;/blockquote&gt;The collation change can be performed on tables joining, 'where' clausesq as part of stored procedures and functions, as well as database Default collation change.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-3777175808880377033?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/3777175808880377033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2009/10/sql-cannot-resolve-collation-conflict.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3777175808880377033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3777175808880377033'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2009/10/sql-cannot-resolve-collation-conflict.html' title='SQL – Cannot resolve collation conflict for equal to operation'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7398060728992177056</id><published>2009-09-30T13:22:00.000-07:00</published><updated>2009-09-30T13:35:08.437-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Forcing downloading files by save dialog</title><content type='html'>Here is the code snippet for downloading files with asp.net:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Response.Clear();&lt;br /&gt;       &lt;br /&gt;Response.AddHeader("content-disposition", "attachment;filename=" + filename);&lt;br /&gt;Response.Cache.SetCacheability(HttpCacheability.NoCache);&lt;br /&gt;Response.ContentType = "image/jpeg";&lt;br /&gt;&lt;br /&gt;byte[] data = System.IO.File.ReadAllBytes(MapPath(url));&lt;br /&gt;Response.BinaryWrite(data);&lt;br /&gt;Response.Flush();&lt;br /&gt;Response.End();&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The key moment in forced save dialog is the header "content-disposition" with file attachment. This will tell to your browser to show you dialog and give you the possibility to get directly that file.&lt;br /&gt;If you use attachment in "inline" header (appending it instead of "content-disposition") the file is gonna be opened in the same window. Browser back button can get you back on your page.&lt;br /&gt;&lt;br /&gt;List of content types can be found here: &lt;a href="http://www.w3schools.com/media/media_mimeref.asp"&gt;MIME Reference&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7398060728992177056?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7398060728992177056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2009/09/forcing-downloading-files-by-save.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7398060728992177056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7398060728992177056'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2009/09/forcing-downloading-files-by-save.html' title='Forcing downloading files by save dialog'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-8514410749776026663</id><published>2009-07-27T12:47:00.000-07:00</published><updated>2009-12-06T10:33:30.828-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio - Pre or Post-build events - copying example</title><content type='html'>The Pre or Post events are simple and useful actions before or after building the solution, which can be used for performing customized actions to simplify deployment or testing.&lt;br /&gt;&lt;br /&gt;The following example copying all output files to myproject\bin located in the solution directory.&lt;br /&gt;Ex.&lt;br /&gt;copy "$(TargetDir)*.*" "$(SolutionDir)myproject\Bin"&lt;br /&gt;&lt;br /&gt;For reference see  &lt;a href="http://msdn.microsoft.com/en-us/library/42x5kfw4%28VS.80%29.aspx"&gt;Macro table in MSDN&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Batch files can be used as well for more complex predefined actions using the  &lt;tt&gt;call&lt;/tt&gt; statement Ex. &lt;tt&gt;call C:\Batch.bat&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-8514410749776026663?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8514410749776026663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8514410749776026663'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2009/07/pre-or-post-build-events-copying.html' title='Visual Studio - Pre or Post-build events - copying example'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-721047798725813471</id><published>2009-04-24T01:38:00.000-07:00</published><updated>2009-04-24T02:05:30.807-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>VB.NET How to encrypt and decrypt a string (password) using Rijndael cipher.</title><content type='html'>&lt;span style="font-family:arial;"&gt;The Rijndael algorithm is part of AES (Advanced encryption standard) which is approved by US government as enough secure way of protecting data.&lt;br /&gt;&lt;br /&gt;The .NET offers pretty easy way for encrypting and decrypting data using Rijndael cipher:&lt;br /&gt;&lt;br /&gt;            &lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Dim cryptography As New System.Security.Cryptography.RijndaelManaged&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;              Dim ms As New MemoryStream()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;              Dim cs As New CryptoStream(ms, _&lt;/span&gt;&lt;br /&gt;                   &lt;span style="font-family:courier new;"&gt;cryptography.CreateEncryptor(ASCIIEncoding.ASCII.GetBytes("[16 bytes ascii string]"), _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                    ASCIIEncoding.ASCII.GetBytes(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;[16 bytes ascii string]&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;)), CryptoStreamMode.Write)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                Dim sw As New StreamWriter(cs)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                sw.Write(inputString)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                sw.Flush()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                cs.FlushFinalBlock()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                ms.Flush()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                Dim encryptedString As String = _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                      Convert.ToBase64String(ms.GetBuffer(), 0, CType(ms.Length, Integer))&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The example encrypts inputString using for private key and salt two 16 bytes ascii strings. The private key and salt can be predefined as byte arrays . The result is 128 bit encrypted string stored in encryptedString.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Dim cryptography As New System.Security.Cryptography.RijndaelManaged&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                Dim buf As Byte() = Convert.FromBase64String(encryptedString.Trim())&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                Dim ms As New MemoryStream(buf)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                ms.Position = 0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                Dim cs As New CryptoStream(ms, _                                           &lt;/span&gt;&lt;br /&gt;                   &lt;span style="font-family:courier new;"&gt;cryptography.CreateDecryptor(ASCIIEncoding.ASCII.GetBytes("&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;[16 bytes ascii string]&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;"),  _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                   ASCIIEncoding.ASCII.GetBytes("&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;[16 bytes ascii string]&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;")), _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                     CryptoStreamMode.Read)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                Dim sr As New StreamReader(cs)&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                Dim decryptedString As String = sr.ReadToEnd()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The encrypted string is decrypted using the same private key and salt as in the encrytpion in and it is stored in &lt;/span&gt;&lt;span style="font-family:arial;"&gt;decryptedString finally.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-721047798725813471?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/721047798725813471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2009/04/vbnet-how-to-encrypt-and-decrypt-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/721047798725813471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/721047798725813471'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2009/04/vbnet-how-to-encrypt-and-decrypt-string.html' title='VB.NET How to encrypt and decrypt a string (password) using Rijndael cipher.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7736027786844031896</id><published>2009-03-18T04:09:00.000-07:00</published><updated>2009-03-18T05:17:12.255-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><title type='text'>SQL: Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRAN is missing.</title><content type='html'>The following error message is got when the number of open transactions is different than the number of committed or rolled back transaction in the end of the stored procedure.&lt;br /&gt;&lt;br /&gt;The global variable @@TRANCOUNT gives the number of opened transactions in the moment of check-up. If you are not sure what is number of opened transactions you can check the number at the end of the procedure and commit or rollback.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;DECLARE @TranStarted   bit&lt;br /&gt;   SET @TranStarted = 0&lt;br /&gt; &lt;br /&gt;IF( @@TRANCOUNT = 0 )&lt;br /&gt; BEGIN&lt;br /&gt;  BEGIN TRANSACTION&lt;br /&gt;  SET @TranStarted = 1&lt;br /&gt; END&lt;br /&gt;ELSE&lt;br /&gt; SET @TranStarted = 0&lt;br /&gt;      &lt;br /&gt;-- do something&lt;br /&gt;-- use select statements with locking rows or tables using&lt;br /&gt;-- WITH ( UPDLOCK, HOLDLOCK ), WITH (HOLDLOCK)&lt;br /&gt;&lt;br /&gt;IF( @@ERROR &lt;&gt; 0 )&lt;br /&gt;       GOTO Cleanup&lt;br /&gt;&lt;br /&gt;--do something&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;IF( @@ERROR &lt;&gt; 0 )&lt;br /&gt;       GOTO Cleanup&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- if no errors commit the transaction&lt;br /&gt;IF( @TranStarted = 1 )&lt;br /&gt;BEGIN&lt;br /&gt;SET @TranStarted = 0&lt;br /&gt;  COMMIT TRANSACTION&lt;br /&gt;  END&lt;br /&gt;&lt;br /&gt;RETURN 1&lt;br /&gt;&lt;br /&gt;-- in case of errors jump to the label cleanup to rollback the transaction&lt;br /&gt;Cleanup:&lt;br /&gt;&lt;br /&gt;   IF( @TranStarted = 1 )&lt;br /&gt;   BEGIN&lt;br /&gt;       SET @TranStarted = 0&lt;br /&gt;    ROLLBACK TRANSACTION&lt;br /&gt;   END&lt;br /&gt;&lt;br /&gt;   RETURN 0  &lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7736027786844031896?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7736027786844031896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2009/03/sql-transaction-count-after-execute.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7736027786844031896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7736027786844031896'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2009/03/sql-transaction-count-after-execute.html' title='SQL: Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRAN is missing.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-5684670826470124989</id><published>2009-03-14T11:54:00.000-07:00</published><updated>2009-03-14T12:01:43.874-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>History support on Microsoft Ajax Library 3.5 SP1</title><content type='html'>The history control maintain the browser back button. An explanation of the feature is located in the Readme documentation of the  Microsoft Ajax Library 3.5 SP1 package.&lt;br /&gt;For quick reference the links are listed below:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Managing Browser History Using Client Script: &lt;a href="http://msdn.microsoft.com/en-us/library/cc488538.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc488538.aspx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Sys.Application.addHistoryPoint:&lt;a href="http://msdn.microsoft.com/en-us/library"&gt; http://msdn.microsoft.com/en-us/library&lt;/a&gt;/cc488025.aspx&lt;/li&gt;&lt;li&gt;Sys.Application.navigate event: &lt;a href="http://msdn.microsoft.com/en-us/library/cc488024.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc488024.aspx&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;In order to allow the browser history feature without using the server-side ScriptManager control, it is necessary to add the following markup into the page for Internet Explorer versions before 8:&lt;br /&gt;&lt;br /&gt;&amp;lt;iframe id="__historyFrame" src="/System.Web.Extensions/3.5.0.0/3.5.30729.1/empty.htm" style="display:none;"&amp;gt;&amp;lt;/iframe&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-5684670826470124989?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/5684670826470124989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2009/03/history-support-on-microsoft-ajax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5684670826470124989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5684670826470124989'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2009/03/history-support-on-microsoft-ajax.html' title='History support on Microsoft Ajax Library 3.5 SP1'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-2892816264468579750</id><published>2009-03-11T08:28:00.000-07:00</published><updated>2009-03-11T08:48:33.600-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# Implicitly Typed Local Variables and Arrays</title><content type='html'>As a whole C# is a strongly-typed language. In other word the C# variables can hold explicitly defined data type.&lt;br /&gt;&lt;br /&gt;From C# version 3.0 on the developer get the possibility to assign any values to a variable and the compiler to obtain accordingly the data type. It is not in the C# style as we know it but has some advantages  of course.&lt;br /&gt;&lt;pre class="libCScode" style="white-space: pre-wrap;" id="ctl00_rs1_mainContentContainer_ctl02CSharp" space="preserve"&gt;&lt;span style="color: green;"&gt;&lt;/span&gt;&lt;br /&gt;var intVariable = 1235;&lt;br /&gt;var stringVariable = &lt;span style="color: maroon;"&gt;&lt;span style="color: maroon;"&gt;"Hello"&lt;/span&gt;&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The &lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;span class="input"&gt;var&lt;/span&gt;&lt;/span&gt; keyword instructs the compiler to infer the type of the variable from the expression on the right side of the initialization statement. The may be a built-in type, an anonymous type, a user-defined type, or a type defined in the .NET Framework class library.&lt;br /&gt;&lt;br /&gt;The biggest advantage of this new feature is the usage in LINQ query expression using anonymous data types.  The anonymous type name is automatically generated by the compiler and is not available at the source code level, but his usage saves much developer's efforts.&lt;br /&gt;&lt;br /&gt;For more information in MSDN &lt;a href="http://msdn.microsoft.com/en-us/library/bb384061.aspx"&gt;click here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-2892816264468579750?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/2892816264468579750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2009/03/c-implicitly-typed-local-variables-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2892816264468579750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2892816264468579750'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2009/03/c-implicitly-typed-local-variables-and.html' title='C# Implicitly Typed Local Variables and Arrays'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1808407379230570814</id><published>2009-03-06T03:36:00.000-08:00</published><updated>2009-03-06T03:41:36.014-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How to get the value of the server variable LOGON_USER</title><content type='html'>1. Uncheck Allow Anonymous in the security tab of the site properties in IIS. At least Basic or Windows Authetication is needed.&lt;br /&gt;&lt;br /&gt;2. Use the variable Request.ServerVariables("LOGON_USER")  to get the full user name&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1808407379230570814?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1808407379230570814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2009/03/how-to-get-value-of-server-variable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1808407379230570814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1808407379230570814'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2009/03/how-to-get-value-of-server-variable.html' title='How to get the value of the server variable LOGON_USER'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1566622937308884701</id><published>2009-01-06T03:54:00.000-08:00</published><updated>2009-01-06T04:00:03.502-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Forms'/><title type='text'>How to open ComboBox (DropDown it) hosted in DataGridView with single mouse click.</title><content type='html'>The usage of ComboBox in a DataGridView delivers some limitations of its usage. Very common problem is opening the ComboBox with single click of the mouse. By default double mouse click is needed because the first click selects the cell and the second click enters into Edit mode where the ComboBox fires its DropDown event.&lt;br /&gt;&lt;br /&gt;We can do this using DataGridView.CellClick event. The following code is enough to open the ComboBox and fire its DropDown event.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Private Sub DataGridView1_CellClick(ByVal sender As System.Object, &lt;br /&gt;     ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) &lt;br /&gt;     Handles DataGridView1.CellClick&lt;br /&gt;        'enters into edit mode&lt;br /&gt;        DataGridView1.BeginEdit(True)&lt;br /&gt;&lt;br /&gt;        'checking if the editing control is a combobox&lt;br /&gt;        If TypeOf (DataGridView1.EditingControl) Is ComboBox Then&lt;br /&gt;&lt;br /&gt;            'casting the editing control and fire DropDown event&lt;br /&gt;            CType(DataGridView1.EditingControl, ComboBox).DroppedDown = True&lt;br /&gt;&lt;br /&gt;        End If&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;DataGridView.EditingControl represents the control hosted by the current cell.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1566622937308884701?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1566622937308884701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2009/01/how-to-open-combobox-dropdown-it-hosted.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1566622937308884701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1566622937308884701'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2009/01/how-to-open-combobox-dropdown-it-hosted.html' title='How to open ComboBox (DropDown it) hosted in DataGridView with single mouse click.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7822228658265946260</id><published>2008-12-15T05:46:00.000-08:00</published><updated>2009-03-15T05:56:05.529-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Escape apostrophe in javascript and dynamic built scripts</title><content type='html'>The apostrophe in javascript is its string delimiter. To render the apostrophe on the response without errors it must be escaped using backslash \.&lt;br /&gt;&lt;br /&gt;alert('John\'s name') will produce message box with text: John's name.&lt;br /&gt;&lt;br /&gt;Using asp.net usually the scripts are built dynamically on server side before rendering the page. Remember that the backslash is also escape character in C# and you have to put two backslashes to build the javascript correctly:&lt;br /&gt;&lt;br /&gt;Response.Write("alert('John\\'s name');");&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7822228658265946260?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7822228658265946260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/12/escape-apostrophe-in-javascript-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7822228658265946260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7822228658265946260'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/12/escape-apostrophe-in-javascript-and.html' title='Escape apostrophe in javascript and dynamic built scripts'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-4788411678685965846</id><published>2008-12-10T02:36:00.000-08:00</published><updated>2008-12-10T02:46:47.762-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='FTP'/><title type='text'>FTP over SSL with IIS is not supported.</title><content type='html'>This is a common problem when you need more secure connection. Microsoft explains the features of their FTP server here: &lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/283679"&gt;http://support.microsoft.com/kb/283679&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It is good to know that current FTP Service in IIS doesn't support Secure Sockets Layers (SSL). Of course that means your connection details and credentials to such service can be caught by Network listeners between you and the server. Therefore if you need secured connection you have to consider usage of Webdav over SSL or another FTP server which supports SSL.&lt;br /&gt;&lt;br /&gt;A suggestion for free and easy to set up server is FileZilla FTP Server for Windows.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-4788411678685965846?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/4788411678685965846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/12/ftp-over-ssl-with-iis-is-not-supported.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/4788411678685965846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/4788411678685965846'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/12/ftp-over-ssl-with-iis-is-not-supported.html' title='FTP over SSL with IIS is not supported.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7478120319813826735</id><published>2008-11-24T00:58:00.000-08:00</published><updated>2009-01-14T01:08:13.708-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>Edit shortcuts in Places bar in Save dialog / Open dialog in Windows</title><content type='html'>It's absolutely boring to navigate to your most often used folder in windows save or open dialogs. Th purpose of Places bar is to help you to do this faster. The Places bar locations can be edited via Group Policy editor in Windows XP Pro and Vista. Use the following way:&lt;br /&gt;&lt;br /&gt;1. Open gpedit.msc (Start-&gt;Run)&lt;br /&gt;2. Navigate to User Configuration -&gt; Administrative Templates -&gt; Windows Components -&gt; Windows Explorer -&gt; Common Open File Dialog&lt;br /&gt;3. Open "Items displayed in Places bar" and write down the locations you want with their paths. Symbolic names are also allowed like Desktop.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7478120319813826735?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7478120319813826735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/12/edit-shortcuts-in-places-bar-in-save.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7478120319813826735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7478120319813826735'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/12/edit-shortcuts-in-places-bar-in-save.html' title='Edit shortcuts in Places bar in Save dialog / Open dialog in Windows'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7644486676233540244</id><published>2008-11-11T05:50:00.000-08:00</published><updated>2008-11-11T06:08:46.450-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><title type='text'>SQL: How to check for existing contraint</title><content type='html'>Just an example how to get it form the database information schema:&lt;br /&gt;&lt;br /&gt;IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_SCHEMA='dbo' AND CONSTRAINT_NAME='IX_Constraint' AND TABLE_NAME='TableName')&lt;br /&gt;BEGIN&lt;br /&gt;ALTER TABLE [dbo].[TableName] WITH CHECK ADD CONSTRAINT ..... /* constraints */&lt;br /&gt;END&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7644486676233540244?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7644486676233540244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/11/sql-how-to-check-for-existing-contraint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7644486676233540244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7644486676233540244'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/11/sql-how-to-check-for-existing-contraint.html' title='SQL: How to check for existing contraint'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7747411977313060595</id><published>2008-11-07T16:03:00.000-08:00</published><updated>2008-11-07T16:20:00.170-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How to set column width in a CheckBoxList in an ASP.NET page</title><content type='html'>Maybe this is common problem since CheckBoxList control doesn't have set of parameters for obtaining column width and row height. But we always can use CSS for styling this control getting in mind he is rendered as html table or floated div tag.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;asp:checkboxlist runat="server" id="chkBoxList1" cssclass="chkBoxList" repeatcolumns="4" repeatlayout="Table"&amp;gt;&lt;br /&gt;&amp;lt;/asp:checkboxlist&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here we explicitly define the layout to be rendered as table (which is by default) and also need to define the css class "chkBoxList" in current page or web site theme.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;style&amp;gt;&lt;br /&gt;.chkBoxList tr&lt;br /&gt;{&lt;br /&gt;   height:24px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.chkBoxList td&lt;br /&gt;{&lt;br /&gt;   width:120px; /* or percent value: 25% */&lt;br /&gt;}&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Of course any other css styles can be attached here. &lt;br /&gt;&lt;br /&gt;Only ASP.NET :)&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7747411977313060595?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7747411977313060595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/11/how-to-set-column-width-in-checkboxlist.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7747411977313060595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7747411977313060595'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/11/how-to-set-column-width-in-checkboxlist.html' title='How to set column width in a CheckBoxList in an ASP.NET page'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-6316590820143621595</id><published>2008-11-04T00:17:00.000-08:00</published><updated>2008-11-04T00:28:05.765-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><title type='text'>SQL Stored Procedures - getting return value</title><content type='html'>Starting directly with example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;CREATE PROCEDURE ProcessValue&lt;br /&gt;(&lt;br /&gt;@value int,&lt;br /&gt;@returnValue int OUTPUT&lt;br /&gt;)&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;/* do calculation and processing and assign the result value to output parameter */&lt;br /&gt;SET @returnValue = value + 5*value&lt;br /&gt;&lt;br /&gt;END&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The following calling of the procedure shows how to get output parameter.&lt;br /&gt;&lt;pre&gt;declare @result int&lt;br /&gt;EXEC ProcessValue 15, @result OUTPUT&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Of course this example is pretty simple - only for showing how to use. For such usage the SQL scalar-valued functions are better way.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-6316590820143621595?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/6316590820143621595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/11/sql-stored-procedures-getting-return.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6316590820143621595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6316590820143621595'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/11/sql-stored-procedures-getting-return.html' title='SQL Stored Procedures - getting return value'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1327794618561265547</id><published>2008-10-10T08:00:00.000-07:00</published><updated>2008-10-10T08:11:55.250-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Forms'/><title type='text'>Way for localizing MessageBox in Windows Forms</title><content type='html'>Very good article in code project, where you can see how the buttons of MessageBox can use custom text labels. The natural language of .NET platform will be overridden and only your labels will be shown.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/miscctrl/Localizing_MessageBox.aspx"&gt;http://www.codeproject.com/KB/miscctrl/Localizing_MessageBox.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Actually if you use MessageBoxOptions in the parameters of MessageBox.Show(..) only the original labels are shown. But I don't think this is big problem.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1327794618561265547?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1327794618561265547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/10/way-for-localizing-messagebox-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1327794618561265547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1327794618561265547'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/10/way-for-localizing-messagebox-in.html' title='Way for localizing MessageBox in Windows Forms'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7840306707623084063</id><published>2008-10-06T13:04:00.000-07:00</published><updated>2008-10-06T13:19:03.641-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>How to map an extension for server side scripting - html to php</title><content type='html'>Sometimes we need including some functionality or server includes into static web files - html. But changing the extension can lose current search engine index and rank. That is why leaving the fiels with the same name is the better way. Easy html files can be mapped to be parsed as php file.&lt;br /&gt;&lt;br /&gt;IIS 7.0:&lt;br /&gt;1. Open IIS Management Console&lt;br /&gt;2. Open Web-site node&lt;br /&gt;3. Open Handler Mapping&lt;br /&gt;4. Add the extension as request path (*.html)&lt;br /&gt;5. Set the handler application/library: something like C:\Program Files\PHP\php5isapi.dll&lt;br /&gt;6. Name it and click OK&lt;br /&gt;&lt;br /&gt;Apache:&lt;br /&gt;Just add the following row in the .htaccess file:&lt;br /&gt;AddType application/x-httpd-php .html&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7840306707623084063?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7840306707623084063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/10/how-to-map-extension-for-server-side.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7840306707623084063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7840306707623084063'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/10/how-to-map-extension-for-server-side.html' title='How to map an extension for server side scripting - html to php'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1697499551800580465</id><published>2008-10-02T05:09:00.000-07:00</published><updated>2008-10-02T05:16:10.502-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server 2005 - Out Of Memory exceptions connected to its RAM usage</title><content type='html'>After the allocated RAM for SQL Server exceeds the System memory unexpected behavior of the server is present.&lt;br /&gt;&lt;br /&gt;Here is a quick guide for configuring Sql server.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.mattec.com/service/appnotes/820-0019.pdf"&gt;http://www.mattec.com/service/appnotes/820-0019.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And remember: Never allocate less then 1 GB of RAM to SQL Server :)&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1697499551800580465?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1697499551800580465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/10/sql-server-2005-out-of-memory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1697499551800580465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1697499551800580465'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/10/sql-server-2005-out-of-memory.html' title='SQL Server 2005 - Out Of Memory exceptions connected to its RAM usage'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-2421791442602369051</id><published>2008-10-01T09:08:00.000-07:00</published><updated>2008-10-01T11:32:11.530-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Forms'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>VB.NET: General Exception Handling in Windows Forms</title><content type='html'>VB.NET&lt;br /&gt;&lt;br /&gt;My.Application.UnhandledException Event is the way for handling all unhandled exceptions in an windows forms application. The application raises this event when it encounters unhandled exception.&lt;br /&gt;For using the event editing ApplicationEvents.vb file is needed. By default ApplicationEvents.vb is hidden. For openning (unhiding) it use Project Properties -&gt; Application tab -&gt; View Appication Events.&lt;br /&gt;Then the handler can be added/edited as in the example below:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Private Sub MyApplication_UnhandledException( _&lt;br /&gt;              ByVal sender As Object, _&lt;br /&gt;              ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs _&lt;br /&gt;              ) Handles Me.UnhandledException&lt;br /&gt;&lt;br /&gt;          Try&lt;br /&gt;              //write log, which is nessted in Application Data folder&lt;br /&gt;              My.Application.Log.WriteException( _&lt;br /&gt;                  e.Exception, _&lt;br /&gt;                  TraceEventType.Critical, _&lt;br /&gt;                  "Unhandled Exception!")&lt;br /&gt;&lt;br /&gt;              //check up if the Event folder exists.&lt;br /&gt;              //if not - create new one&lt;br /&gt;              If Not EventLog.SourceExists("My software") Then&lt;br /&gt;                  EventLog.CreateEventSource("My software", "My Software")&lt;br /&gt;              End If&lt;br /&gt;&lt;br /&gt;              //write event log, can be seen by Event Viewer&lt;br /&gt;              EventLog.WriteEntry("My software", _&lt;br /&gt;                  e.Exception.ToString(), _&lt;br /&gt;                  EventLogEntryType.Error)&lt;br /&gt;          Catch ex As Exception&lt;br /&gt;&lt;br /&gt;          End Try&lt;br /&gt;&lt;br /&gt;          // code for notifying the user with user friendly message&lt;br /&gt;          ...................&lt;br /&gt;&lt;br /&gt;          //set the default application action (closing) not to be performed.&lt;br /&gt;          e.ExitApplication = False&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;And from now on all unhandled exception in the application will be stored as exception information and stack trace in the application log file or in the Windows Event log and the user will receive friendly message.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C#&lt;br /&gt;&lt;br /&gt;Of course most of my posts give examples with VB and C# when they are different. Now I will give up this pleasure to R. Newman with his great post &lt;a href="http://richnewman.wordpress.com/2007/04/07/top-level-exception-handling-in-windows-forms-applications-%E2%80%93-code-listing-1/"&gt;"Top-level Exception Handling in Windows Forms Applications"&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-2421791442602369051?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/2421791442602369051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/10/vbnet-general-exception-handling-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2421791442602369051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2421791442602369051'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/10/vbnet-general-exception-handling-in.html' title='VB.NET: General Exception Handling in Windows Forms'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7521413029231428490</id><published>2008-09-24T02:16:00.000-07:00</published><updated>2008-09-24T02:20:54.369-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to check the type of an object or control using VB.NET or C#</title><content type='html'>The VB.NET check up is:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;If (TypeOf sender Is TextBox)Then&lt;br /&gt; Dim txt As TextBox= DirectCast(sender, TextBox)&lt;br /&gt;End If&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And the C# code:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if (sender Is TextBox){&lt;br /&gt; TextBox txt=(TextBox)sender;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7521413029231428490?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7521413029231428490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/09/how-to-check-type-of-object-using-vbnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7521413029231428490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7521413029231428490'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/09/how-to-check-type-of-object-using-vbnet.html' title='How to check the type of an object or control using VB.NET or C#'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1647066999691340792</id><published>2008-09-17T21:34:00.000-07:00</published><updated>2008-09-17T21:57:11.775-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><title type='text'>Error reporting in PHP run on IIS</title><content type='html'>The PHP error reporting is controlled either by the php.ini file as a global setting or programatically, or using .htaccess.&lt;br /&gt;&lt;br /&gt;The error reporting in php.ini is defined in "Error handling and logging" section.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;error_reporting = E_ALL &amp;amp; ~E_NOTICE - shows all errors except E_NOTICE errors.  E_NOTICE are possible errors which can occur even during normal program workflow - something like Microsoft's warnings.&lt;/li&gt;&lt;li&gt;display_errors = On&lt;/li&gt;&lt;li&gt;display_startup_errors = On&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Programmatically the same settings are applied for current site like this:&lt;br /&gt;&lt;blockquote&gt;   ini_set('display_errors','1');&lt;br /&gt; ini_set('display_startup_errors','1');&lt;br /&gt; error_reporting(E_ALL &amp;amp; ~E_NOTICE);&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;In .htaccess the flags must be changed in the following way:&lt;br /&gt;&lt;blockquote&gt;php_flag display_errors 1&lt;br /&gt;php_flag display_startup_errors 1&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Php error_reproting help -&gt; http://php.net/error_reporting&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1647066999691340792?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1647066999691340792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/09/error-reporting-in-php-run-on-iis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1647066999691340792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1647066999691340792'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/09/error-reporting-in-php-run-on-iis.html' title='Error reporting in PHP run on IIS'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1610481106230343221</id><published>2008-09-10T14:36:00.000-07:00</published><updated>2008-09-10T14:46:03.719-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Web development'/><title type='text'>URL Encoding - reserved and unsafe characters</title><content type='html'>RFC 1738: Uniform Resource Locators (URL) specification is described in the following page. Also simple convertor is included.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.blooberry.com/indexdot/html/topics/urlencoding.htm"&gt;http://www.blooberry.com/indexdot/html/topics/urlencoding.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Server.URLEncode(url)&lt;/pre&gt;applies these rules to the url. During getting an url parameter from the query string the value will be automatically decoded.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1610481106230343221?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1610481106230343221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/09/url-encoding-reserved-and-unsafe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1610481106230343221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1610481106230343221'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/09/url-encoding-reserved-and-unsafe.html' title='URL Encoding - reserved and unsafe characters'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-5152723192563057173</id><published>2008-09-02T07:48:00.000-07:00</published><updated>2010-01-10T15:00:42.583-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Javascript trace log</title><content type='html'>Simple and useful tool can be found here:&lt;br /&gt;&lt;a href="http://v2.easy-designs.net/code/jsTrace/"&gt;&lt;br /&gt;http://v2.easy-designs.net/code/jsTrace/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Using it you can get rid of the alert messages while debug applications.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-5152723192563057173?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/5152723192563057173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/09/javascript-trace-log.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5152723192563057173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5152723192563057173'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/09/javascript-trace-log.html' title='Javascript trace log'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-6601011707243948190</id><published>2008-09-01T11:17:00.000-07:00</published><updated>2009-01-06T03:59:06.725-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Web development'/><title type='text'>How to excute string with javascript</title><content type='html'>Simply use eval().&lt;br /&gt;&lt;br /&gt;eval('peformAction()') will execute&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-6601011707243948190?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/6601011707243948190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/09/how-to-excute-string-with-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6601011707243948190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6601011707243948190'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/09/how-to-excute-string-with-javascript.html' title='How to excute string with javascript'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-5877161675157924683</id><published>2008-08-28T02:26:00.000-07:00</published><updated>2008-08-28T02:43:49.735-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Adding a relationship between DataTables</title><content type='html'>A DataTable can be related to another DataTable in the same DataSet using DataRelation object. Using DataRelation the navigation between DataTable (foreign key connection) becomes very easy.&lt;br /&gt;&lt;br /&gt;An example for using Child Relation is located here:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.childrelations.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.data.datatable.childrelations.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is an example for using Parent Relation:&lt;br /&gt;&lt;br /&gt;We have two DataTables: DataTableOrder (OrderId is foreign key to DataTableOrderDetails) and DataTableOrderDetails (Id is primary key)&lt;br /&gt;&lt;br /&gt;//create dataset&lt;br /&gt;       DataSet dataSet = new DataSet();&lt;br /&gt;     &lt;br /&gt;//add existing tables to the DataSet&lt;br /&gt;       dataSet.Tables.Add(DataTableOrder );                     &lt;br /&gt;       dataSet.Tables.Add(DataTableOrderDetails);&lt;br /&gt;     &lt;br /&gt;// create relation between both tables&lt;br /&gt;       dataSet.Relations.Add(&lt;br /&gt;       dataSet.Tables[1].Columns["Id"],&lt;br /&gt;       dataSet.Tables[0].Columns["OrderId"]);&lt;br /&gt;   &lt;br /&gt;       foreach (DataRow row in DataTableOrder .Rows)&lt;br /&gt;       {&lt;br /&gt;//get parent rows using relation - all order details for current order&lt;br /&gt;//use GetParentRows for relations 1 to many&lt;br /&gt;           DataRow dr=row.GetParentRow(dtm.ParentRelations[0]);&lt;br /&gt;//check if there is a parent row&lt;br /&gt;           if(dr!=null){&lt;br /&gt;                  Response.Write(row["OrderName"].ToString()  +"-&gt;"+ dr["OrderDetails"].ToString() +"&lt;br /&gt;")&lt;br /&gt;           }&lt;br /&gt;       }&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-5877161675157924683?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/5877161675157924683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/08/adding-relationship-between-datatables.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5877161675157924683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5877161675157924683'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/08/adding-relationship-between-datatables.html' title='Adding a relationship between DataTables'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-380325714788744288</id><published>2008-07-10T13:09:00.000-07:00</published><updated>2008-07-10T13:17:17.429-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Web development'/><title type='text'>Good working free CAPTCHA  control for asp.net</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.mondor.org/img/capex.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 204px; height: 61px;" src="http://www.mondor.org/img/capex.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart" and means  software peace which makes user input challenges which are easy for solving by humans and difficult for machines. The purpose is to avoid spam or hackers attacks which can harm your data or make unpredictable responses.&lt;br /&gt;&lt;br /&gt;This post will show you one very good CAPTCHA control, which is tested by me and works fine, even with ajax. It is easy for use and will save you time to develop such control.&lt;br /&gt;&lt;br /&gt;Thanks for Mondor software.&lt;br /&gt;&lt;a href="http://www.mondor.org/captcha.aspx"&gt;http://www.mondor.org/captcha.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-380325714788744288?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/380325714788744288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/07/good-working-free-captcha-control-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/380325714788744288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/380325714788744288'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/07/good-working-free-captcha-control-for.html' title='Good working free CAPTCHA  control for asp.net'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-8138400900211792420</id><published>2008-06-19T04:59:00.000-07:00</published><updated>2009-03-15T05:57:46.686-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Why don't you have .NET 3.5 as a selectable framework in IIS</title><content type='html'>The reason is that the .NET Framework 3.5 delivers not whole new runtime machine, but only library extension of .NET 2.0. In other words there are no new CLR or new language compilers. But there are new available libraries and new versions of C# (3.0) and VB (9)&lt;br /&gt;&lt;br /&gt;.NET Framework 2.0 includes the CLR, Winforms, Asp.NET and web services.&lt;br /&gt;&lt;br /&gt;.NET Framework 3.0 includes in addition libries for WCF (Windows Communication Foundation), WPF (Windows Presentation Foundation) and Windows Workflow (WF).&lt;br /&gt;&lt;br /&gt;.NET Framework 3.0 includes in addition libraries for AJAX, LINQ and REST&lt;br /&gt;&lt;br /&gt;Finally you will see there is no problem with your IIS. You've just received some new  additional and really good features for easier programming.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-8138400900211792420?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/8138400900211792420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/06/why-you-dont-have-net-35-as-selectable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8138400900211792420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8138400900211792420'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/06/why-you-dont-have-net-35-as-selectable.html' title='Why don&apos;t you have .NET 3.5 as a selectable framework in IIS'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-891570406528693866</id><published>2008-06-11T09:15:00.000-07:00</published><updated>2008-06-11T09:24:47.644-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Email'/><category scheme='http://www.blogger.com/atom/ns#' term='helm'/><title type='text'>Gmail consider the mail as SPAM. How to avoid that?</title><content type='html'>Obviously Gmail uses Sender-ID and DKIM to verify every email. That is why you need to modify DNS records for your domain using txt record. Here is a tutorial how to do that &lt;span style="font-style: italic;"&gt;openspf.org&lt;/span&gt;.&lt;br /&gt;    You can build your txt records using the wizard and add them. You need something like:&lt;br /&gt;record for domain.com in txt:  &lt;span style="font-weight: bold;"&gt;v=spf1 a mx ~all&lt;/span&gt;&lt;br /&gt;record for the mail server mail.domain.com in txt: &lt;span style="font-weight: bold;"&gt;v=spf1 a -all&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-891570406528693866?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/891570406528693866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/06/gmail-consider-mail-as-spam-how-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/891570406528693866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/891570406528693866'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/06/gmail-consider-mail-as-spam-how-to.html' title='Gmail consider the mail as SPAM. How to avoid that?'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-4019282027688409632</id><published>2008-06-07T06:46:00.000-07:00</published><updated>2011-01-23T10:06:02.546-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Very good way to see how your html table will look like</title><content type='html'>&lt;a href="http://www.somacon.com/p141.php"&gt;http://www.somacon.com/p141.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Interactive tool for creating good looking html table using css. Make the table you want and copy and paste the generated css classes.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-4019282027688409632?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/4019282027688409632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/06/very-good-way-to-see-how-your-html.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/4019282027688409632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/4019282027688409632'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/06/very-good-way-to-see-how-your-html.html' title='Very good way to see how your html table will look like'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-6870710587401704881</id><published>2008-05-19T08:59:00.000-07:00</published><updated>2008-05-19T09:02:41.139-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to obtain current SQL Server version using sql query</title><content type='html'>SELECT SERVERPROPERTY('productversion') As Version, SERVERPROPERTY ('edition') As Edition, SERVERPROPERTY ('productlevel') As Updates&lt;br /&gt;&lt;br /&gt;The first columns shows current version as number, the second one is the edition (standard, express etc.) and the third one shows which version level the server belongs to (SP1, SP2 etc.)&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-6870710587401704881?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/6870710587401704881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/05/how-to-obtain-current-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6870710587401704881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6870710587401704881'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/05/how-to-obtain-current-sql-server.html' title='How to obtain current SQL Server version using sql query'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-9216492622775196919</id><published>2008-05-17T03:12:00.000-07:00</published><updated>2008-05-19T06:08:58.717-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Trick to start web application with another SQL Server database</title><content type='html'>The following exception is thrown when you try to use one application with the another database. The problem is caused by asp.net membership provider which cannot recognize its schema.&lt;br /&gt;&lt;br /&gt;The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'.  However, the current database schema is not compatible with this version.  You may need to either install a compatible schema with aspnet_reqsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.&lt;br /&gt;&lt;br /&gt;First of all be sure the aspnet membership provider is registered on that database using aspnet_regsql.exe.&lt;br /&gt;&lt;br /&gt;Then the solution is: taking the web application offline and then online using Web Site Administration Tool. That makes some changes in web.config in the pages tag and globalization if needed. Then you can go!&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-9216492622775196919?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/9216492622775196919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/05/trick-to-start-web-application-with.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/9216492622775196919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/9216492622775196919'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/05/trick-to-start-web-application-with.html' title='Trick to start web application with another SQL Server database'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-6014283217216872178</id><published>2008-05-16T02:13:00.000-07:00</published><updated>2008-05-16T02:36:13.541-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL pagination: get fixed number of rows page by page</title><content type='html'>See the following examples:&lt;br /&gt;&lt;br /&gt;SELECT * FROM&lt;br /&gt;(SELECT ROW_NUMBER() OVER (ORDER BY Id) AS  [SortNum], * FROM MyTable) As Tmp&lt;br /&gt;WHERE SortNum Between 11 AND 20&lt;br /&gt;&lt;br /&gt;or &lt;br /&gt;&lt;br /&gt;WITH Tmp As &lt;br /&gt;SELECT ROW_NUMBER() OVER (ORDER BY Id) AS  [SortNum], * FROM MyTable)&lt;br /&gt;SELECT * FROM Tmp&lt;br /&gt;WHERE SortNum Between @StartRow AND @StartRow+@NumberOfRows-1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;WITH Tmp As &lt;br /&gt;SELECT ROW_NUMBER() OVER (ORDER BY Id) AS  [SortNum], * FROM MyTable)&lt;br /&gt;SELECT * FROM Tmp&lt;br /&gt;WHERE SortNum Between (@page-1)*10+1 AND (@page)*10 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The first one gives the second page of 10 records.&lt;br /&gt;The second example shows the usage of WITH keyword and getting rows passed as parameter of stored procedure.&lt;br /&gt;The third one shows you how to use 1 passed parameter as number of the desired page.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-6014283217216872178?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/6014283217216872178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/05/sql-pagination-get-fixed-number-of-rows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6014283217216872178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6014283217216872178'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/05/sql-pagination-get-fixed-number-of-rows.html' title='SQL pagination: get fixed number of rows page by page'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-6823331055392525247</id><published>2008-05-11T10:53:00.000-07:00</published><updated>2008-05-11T11:00:39.965-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How to set your master page by the nested page</title><content type='html'>The PreInit Page event n the nested page can be used for setting some Master page parameters. &lt;br /&gt;&lt;br /&gt;    protected void Page_PreInit(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        (this.Master as MasterType).Property = value;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;Then the Master page will be loaded and rendered using these settings.&lt;br /&gt;Master is the reference to the Master page. MasterType is the type of master page used.&lt;br /&gt;Property is the public variable which must be set before loading page.&lt;br /&gt;&lt;br /&gt;Using Page_PreInit the Master page can be set dynamically.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-6823331055392525247?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/6823331055392525247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/05/how-to-set-your-master-page-by-nested.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6823331055392525247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6823331055392525247'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/05/how-to-set-your-master-page-by-nested.html' title='How to set your master page by the nested page'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1936358695849134036</id><published>2008-05-09T13:05:00.000-07:00</published><updated>2008-05-09T13:24:33.399-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><title type='text'>Sql Date Manipulation</title><content type='html'>DATEPART (datepart, date) returns the desired part of the date specified by datepart parameter: year, &lt;br /&gt;quarter, month, dayofyear, day, week, weekday, hour, minute, second, millisecond.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Example: DATEPART(month, GETDATE()) returns current month number&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;DAY(date), MONTH(date), YEAR(date) return respectively the number of the day, month or year of the passed date.&lt;br /&gt;&lt;br /&gt;To add or subtract date parts from a given date use this function:&lt;br /&gt;DATEADD (datepart , number, date)&lt;br /&gt;where datepart is one of the following parameter (datepart):  year, &lt;br /&gt;quarter, month, dayofyear, day, week, weekday, hour, minute, second, millisecond.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Example: DATEADD(day, -7, GETDATE()) return the date week ago.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;DATEDIFF (datepart, startdate, enddate) gives you the difference between two dates in desired date part (see DATEPART date parts above). Startdate should be date before end date. Otherwise a negative number will be returned.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Example: DATEADD(day, DATEADD(day, -7, GETDATE()), GETDATE()) return 7 days. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1936358695849134036?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1936358695849134036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/05/sql-date-manipulation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1936358695849134036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1936358695849134036'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/05/sql-date-manipulation.html' title='Sql Date Manipulation'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-6609943489171130536</id><published>2008-04-28T04:41:00.000-07:00</published><updated>2008-04-28T04:50:02.209-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Ajax Error Message:The state information is invalid for this page and might be corrupted</title><content type='html'>The message is shown when a page with partial postback regions (update panels) is refreshed by F5 or browser's refresh button and then a new partial postback request is performed. In this case the information stored in the page has been changed and causes not to be possible to perform partial postback. For pages like these the page parameter EnableEventValidation must be set to false:&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Page EnableEventValidation="false" ....&lt;br /&gt;&lt;br /&gt;Another case is described here: &lt;a href="http://support.microsoft.com/kb/323744"&gt;http://support.microsoft.com/kb/323744&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-6609943489171130536?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/6609943489171130536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/04/ajax-error-messagethe-state-information.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6609943489171130536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6609943489171130536'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/04/ajax-error-messagethe-state-information.html' title='Ajax Error Message:The state information is invalid for this page and might be corrupted'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-4577919073076580154</id><published>2008-04-25T06:14:00.000-07:00</published><updated>2008-04-25T06:28:50.483-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to execute string (custom built sql query ) in a stored procedure</title><content type='html'>&lt;span style="font-weight: bold;"&gt;sp_executesql&lt;/span&gt; executes string in a stored procedure. It is used in more complex queries which we need to build concatenating strings. The string is run as a batch. The following example gets the TOP records from a table matching predefined conditions.&lt;br /&gt;&lt;br /&gt;CREATE PROCEDURE [GetTOPRecords]&lt;br /&gt;    @count varchar(6),&lt;br /&gt;    @conditions nvarchar(300)&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;DECLARE @SQL nvarchar(1000)&lt;br /&gt;&lt;br /&gt;SET&lt;br /&gt;@SQL='SELECT&lt;br /&gt;    TOP '+ @count + ' * FROM RecordsTable&lt;br /&gt;   WHERE ' + @conditions&lt;br /&gt;&lt;br /&gt;EXEC sp_executesql @SQL&lt;br /&gt;&lt;br /&gt;END   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The @count and @conditions are passed as parameters. The execution string is built run-time and executed. If you don't need any conditions here just pass the string ' 1=1 ' as @conditions.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-4577919073076580154?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/4577919073076580154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/04/how-to-execute-string-custom-built-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/4577919073076580154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/4577919073076580154'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/04/how-to-execute-string-custom-built-sql.html' title='How to execute string (custom built sql query ) in a stored procedure'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7378782400674045321</id><published>2008-04-24T11:22:00.000-07:00</published><updated>2008-04-24T11:36:02.583-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>How to build unsafe C# code with Visual Studio</title><content type='html'>&lt;b&gt;Unsafe code&lt;/b&gt; may only &lt;b&gt;appear if compiling&lt;/b&gt; with /&lt;b&gt;unsafe&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This appears as an error when you try to compile assembly which contains unsafe code in release mode.&lt;br /&gt;You must change the compiler options using project's Properties page -&gt; Build -&gt; and check Allow Unsafe Code. Consider if you want to use unsafe code :)))&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7378782400674045321?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7378782400674045321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/04/how-to-build-unsafe-c-code-with-visual.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7378782400674045321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7378782400674045321'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/04/how-to-build-unsafe-c-code-with-visual.html' title='How to build unsafe C# code with Visual Studio'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-3834599300095520166</id><published>2008-04-22T02:53:00.001-07:00</published><updated>2008-04-22T02:58:25.330-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript: How to check if the variable is a number?</title><content type='html'>There are some ways for doing this but I think the following is the most easiest and convenient for use:&lt;br /&gt;&lt;br /&gt;if (! isNaN(variable)) {&lt;br /&gt;//code here&lt;br /&gt;}            &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;isNaN comes from is Not A Number and can be used for understanding if the variable is a number.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-3834599300095520166?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/3834599300095520166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/04/javascript-how-to-check-if-variable-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3834599300095520166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3834599300095520166'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/04/javascript-how-to-check-if-variable-is.html' title='Javascript: How to check if the variable is a number?'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1427533486160877054</id><published>2008-04-15T09:45:00.000-07:00</published><updated>2008-04-15T10:21:45.843-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How to maintain the view state of dynamically added control in an asp.net page</title><content type='html'>&lt;span style="font-family:verdana;"&gt;First of all you must read these articles:&lt;/span&gt;&lt;br /&gt;&lt;ul style="font-family: verdana;"&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnet-pageobjectmodel.asp"&gt;The ASP.NET Page Object Model&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms178472.aspx"&gt;ASP.NET Page Life Cycle Overview&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms972976.aspx"&gt;Understanding ASP.NET View State&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;The viewstate of a dynamically added control can be saved for maintaining the state of the control after postback.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;This can be achieved by adding the controls before the Load Viewstate stage (see the page stages in the articles above). Therefore the viewstate information ( control value) from the request will be applied to already added controls as they are defined already in the page.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;The right place of adding dynamic controls is Page_Init. Use Page_Init also for defining dynamically master pages and themes.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1427533486160877054?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1427533486160877054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/04/how-to-maintain-view-state-of.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1427533486160877054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1427533486160877054'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/04/how-to-maintain-view-state-of.html' title='How to maintain the view state of dynamically added control in an asp.net page'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-6875324226576184317</id><published>2008-04-15T07:35:00.000-07:00</published><updated>2008-04-15T08:38:05.225-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Understanding AutoEventWireup attribute in Asp.net page. Event handlers.</title><content type='html'>The AutoEventWireup attribute indicates if the page events are auto-wired up. If the attribute is set to true .Net framework searches automatically for methods which names are created in the way Page_xxxxx (Page_Load, Page_Init etc.) and connects them to the events. Otherwise the developer or the environment must do that using delegates:&lt;br /&gt;&lt;br /&gt;this.Load += new System.EventHandler(this.Page_Load);&lt;br /&gt;&lt;br /&gt;for all handled page events. Setting AutoEventWireup to false is the better way because of the performance -&gt; the framework uses only the methods with code! &lt;br /&gt;&lt;br /&gt;The attribute can be set on several places: in machine.config, web.config and for every page.&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;The note is not connected directly to the page events, but to events of postback controls like button, linkbutton etc.&lt;br /&gt;In VB.NET the event handlers can be attached to the events using the keyword "Handles". &lt;br /&gt;&lt;br /&gt;Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click&lt;br /&gt;&lt;br /&gt;This method will handle the event Click and will work like adding the attribute &lt;br /&gt;OnClick="LinkButton1_Click" to the LinkButton tag. But NEVER USE both of the ways at the same because this will invoke the method twice!! &lt;br /&gt;Consider using keyword "Handles" OR OnEvent="", but never use them together.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-6875324226576184317?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/6875324226576184317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/04/understanding-autoeventwireup-attribute.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6875324226576184317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6875324226576184317'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/04/understanding-autoeventwireup-attribute.html' title='Understanding AutoEventWireup attribute in Asp.net page. Event handlers.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1347655161347100626</id><published>2008-04-10T12:31:00.000-07:00</published><updated>2008-04-16T06:19:01.696-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to covert System.Drawing.Color to a HTML/CSS color value</title><content type='html'>The System.Drawing.Color represenation of the color including the alpha color element:&lt;br /&gt;alpha, red, green, blue.&lt;br /&gt;The process is simple - convert the decimal color representation to a hexadecimal, then remove the alpha hexadecimal value from the string and concatenate to '#'.&lt;br /&gt;&lt;br /&gt;Dim HTMLColor As String = Hex(color.ToArgb())&lt;br /&gt;HTMLColor = "#" + HTMLColor.Substring(2)&lt;br /&gt;&lt;br /&gt;where "color" is an instance of System.Drawing.Color&lt;br /&gt;&lt;br /&gt;There is a difference between VB.NET and C# in getting the hexadecimal value as string. The C# fans can use the folloing code:&lt;br /&gt;&lt;br /&gt;string HTMLColor = color.ToArgb().ToString("X8");&lt;br /&gt;HTMLColor = "#" + HTMLColor.Substring(2);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The opposite process can be accomplished by ColorTranslator' services:&lt;br /&gt;Dim color As System.Drawing.Color = System.Drawing.ColorTranslator.FromHtml("#e5e5e5")&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1347655161347100626?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1347655161347100626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/04/how-to-covert-systemdrawingcolor-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1347655161347100626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1347655161347100626'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/04/how-to-covert-systemdrawingcolor-to.html' title='How to covert System.Drawing.Color to a HTML/CSS color value'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-8251969011937825159</id><published>2008-04-04T05:41:00.000-07:00</published><updated>2009-03-12T02:37:45.162-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript string functions</title><content type='html'>Let's see how to use replace() function for replacing string with another one. The specialty here is the usage of regular expressions to replace the string if it occurs more than once in the source string.&lt;br /&gt;&lt;br /&gt;replace('aa','a'); is gonna replace only the first occurrence of the 'aa'.&lt;br /&gt;replace(/aa/g, 'a') will replace all  occurrences  of the 'aa' string.&lt;br /&gt;replace(/A/i, 'b') will replace the occurrences  of 'A' or 'a' with 'b' - case insensitive.&lt;br /&gt;&lt;br /&gt;Very common problems  are the special character replacement. These characters should be escaped using \.&lt;br /&gt;&lt;br /&gt;replace(/\./g, '') will replace all  occurrences . with an empty ('') string.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-8251969011937825159?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/8251969011937825159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/04/javascript-string-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8251969011937825159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8251969011937825159'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/04/javascript-string-functions.html' title='Javascript string functions'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-5369745419323819132</id><published>2008-03-12T03:37:00.000-07:00</published><updated>2008-06-12T03:40:35.144-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>Unicode and hosted PHP</title><content type='html'>To make apache to work with unicode you must add into .htaccess the following:&lt;br /&gt;&lt;p&gt;php_value default_charset utf-8&lt;br /&gt;AddDefaultCharset utf-8&lt;br /&gt;&lt;/p&gt;&lt;p&gt;.htaaccess geve you the ability to change PHP settings without changing  php.ini&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-5369745419323819132?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/5369745419323819132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/03/unicode-and-hosted-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5369745419323819132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5369745419323819132'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/03/unicode-and-hosted-php.html' title='Unicode and hosted PHP'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-6066862456427813230</id><published>2008-02-26T07:45:00.000-08:00</published><updated>2008-05-26T07:50:48.692-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>How to get the whole url on the page in PHP</title><content type='html'>Here is a usefull function for getting current url:&lt;br /&gt;&lt;br /&gt;function GetCurrentURL() {&lt;br /&gt; $url = '';&lt;br /&gt;&lt;br /&gt; if ($_SERVER["HTTPS"] == "on") &lt;br /&gt; {&lt;br /&gt;  $url .= "https://";&lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt;  $url .= "http://";&lt;br /&gt; }&lt;br /&gt; if ($_SERVER["SERVER_PORT"] != "80") {&lt;br /&gt;  $url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];&lt;br /&gt; } else {&lt;br /&gt;  $url .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];&lt;br /&gt; }&lt;br /&gt; return $url;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-6066862456427813230?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/6066862456427813230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/02/how-to-get-whole-url-on-page-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6066862456427813230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6066862456427813230'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/02/how-to-get-whole-url-on-page-in-php.html' title='How to get the whole url on the page in PHP'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7677973990743426328</id><published>2008-02-24T09:45:00.000-08:00</published><updated>2008-02-24T09:50:06.721-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Get UrlRewritingNet to work with IIS 7.0</title><content type='html'>There is a well known problem using url rewriting functionality with UrlRewritingNet and IIS 7. The problem can be solved by setting the pipeline mode of the application pool to be in classic mode. Looking forward for the next version :).&lt;br /&gt;Actually the url rewriting functionality can be achieved much easier with IIS 7.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7677973990743426328?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7677973990743426328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/02/get-urlrewritingnet-to-work-with-iis-70.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7677973990743426328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7677973990743426328'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/02/get-urlrewritingnet-to-work-with-iis-70.html' title='Get UrlRewritingNet to work with IIS 7.0'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1050228159127213184</id><published>2008-02-13T04:58:00.000-08:00</published><updated>2008-02-13T06:03:07.434-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>AJAX: Timeout problem by asyncronous postback</title><content type='html'>The most common cause of this problem is the time of asyncronous response. It occur when the response takes more than 90 seconds. First of all be sure that there is no client script in the update panel. Use &lt;br /&gt;&lt;br /&gt;ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "tmp", "&amp;lt;script type='text/javascript'&amp;gt;&amp;lt;/script&amp;gt;", False)&lt;br /&gt;&lt;br /&gt;to register such scripts during loading page.&lt;br /&gt;&lt;br /&gt;If the reason is long calculations on the srever you can change the asyncronous timeout in the ScriptManager tag.&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:ScriptManager ID="ScriptManager1" AsyncPostBackTimeOut="3600" runat="server" /&amp;gt;&lt;br /&gt;&lt;br /&gt;This makes the response to be valid an hour.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1050228159127213184?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1050228159127213184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/02/ajax-timeout-problem-by-asyncronous.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1050228159127213184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1050228159127213184'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/02/ajax-timeout-problem-by-asyncronous.html' title='AJAX: Timeout problem by asyncronous postback'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-321902916143878845</id><published>2008-02-09T15:19:00.000-08:00</published><updated>2008-02-09T15:26:52.505-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VBA'/><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><title type='text'>How to sum values in Excel only from visible cells</title><content type='html'>There is a good article in microsoft support site for this problem and the example works fine.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/150363"&gt;How to use a VBA Macro to Sum Only Visible Cells&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;see also how to &lt;a href="http://w3ka.blogspot.com/2008/02/creating-user-defined-function-in-excel.html"&gt;&lt;span style="font-size:100%;"&gt;create user defined functions (UDF)&lt;/span&gt;&lt;br /&gt;&lt;/a&gt; in Excel&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-321902916143878845?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/321902916143878845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/02/how-to-sum-values-in-excel-only-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/321902916143878845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/321902916143878845'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/02/how-to-sum-values-in-excel-only-from.html' title='How to sum values in Excel only from visible cells'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-3286027011957581095</id><published>2008-02-09T15:06:00.000-08:00</published><updated>2008-02-09T15:18:56.046-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VBA'/><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><title type='text'>Creating User Defined Function in Excel (UDF)</title><content type='html'>You have to use VBA for making User Defined Function in Excel (UDF). &lt;br /&gt;Click on Developers tab in the ribbon (Excel 2007) then click on Visual Basic or use Alt+F11.&lt;br /&gt;Then insert a new module by Insert-&gt;Module and write your function there.&lt;br /&gt;The functions will be inlcuded Insert Function dialog box in "User Defined" category.&lt;br /&gt;&lt;br /&gt;To use the functions in another excel documents you must save them in your own add-in by saving the file as add-in file .xla or .xlam for Excel 2007. Then load the add-in by Start-&gt;Excel Options-&gt;Add-ins-&gt;Go.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-3286027011957581095?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/3286027011957581095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/02/creating-user-defined-function-in-excel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3286027011957581095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3286027011957581095'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/02/creating-user-defined-function-in-excel.html' title='Creating User Defined Function in Excel (UDF)'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-123879434790871754</id><published>2008-02-09T14:57:00.000-08:00</published><updated>2008-02-09T15:05:31.227-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VBA'/><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><title type='text'>How to enable VBA on Excel 2007 (Microsoft Office 2007)</title><content type='html'>The developer's functions of excel and VBA are disabled by default. They can be unlocked using Start-&gt;Excel Options window. Check "Show developers tab in the Ribbon" in Popular section. After clicking OK the developers tab is shown at the last place in the ribbon.&lt;br /&gt;Another important thing is the saving xls documetns with recorded macros or inlcuded VBA scripts. You must save the file by Save As dialog box as an Excel Macro-Enabled Workbook with extension .xlsm .&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-123879434790871754?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/123879434790871754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/02/how-to-enable-vba-on-excel-2007.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/123879434790871754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/123879434790871754'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/02/how-to-enable-vba-on-excel-2007.html' title='How to enable VBA on Excel 2007 (Microsoft Office 2007)'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-8199475383431277710</id><published>2008-02-02T03:37:00.000-08:00</published><updated>2008-02-02T03:51:18.211-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Error rendering a custom control</title><content type='html'>Maybe this is a little MS Visual Studio bug. It is connected to the control registering in the page in case of using a control defined in App_Code folder, not in another assembly. The exception thrown while opening design view of the page is:&lt;br /&gt;&lt;br /&gt;Error Rendering Control - [control] An unhandled exception has occurred. There was an error parsing the theme. The assembly attribute cannot be an empty string.&lt;br /&gt;&lt;br /&gt;So the VS environment doesn't recognize the control defined in the App_Code. Therefore the control regitration must inlcude the assembly name - "App_Code"&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Register TagPrefix="my" Namespace="MyControls" assembly="App_Code" %&amp;gt;&lt;br /&gt;&lt;br /&gt;or &lt;br /&gt;&lt;br /&gt;&amp;lt;add tagPrefix="my" namespace="MyControls" assembly="App_Code" /&amp;gt; &lt;br /&gt;in web.config - pages/controls section&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-8199475383431277710?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/8199475383431277710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/02/error-rendering-custom-control.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8199475383431277710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8199475383431277710'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/02/error-rendering-custom-control.html' title='Error rendering a custom control'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-8431349461895132365</id><published>2008-01-20T12:08:00.000-08:00</published><updated>2008-01-20T12:20:31.322-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server Express permissions</title><content type='html'>Fix for exceptions like these:&lt;br /&gt;"CREATE DATABASE permission denied in database 'master'",&lt;br /&gt;"EXECUTE permission denied on object "&lt;br /&gt;"SELECT permission denied on object"&lt;br /&gt;&lt;br /&gt;Asp.NET uses the NETWORK SERVICE account (for Windows Server 2003) and ASPNET user for Windows XP. If we use windows authetincation for using sql express we need to add these users as sql server logins:&lt;br /&gt;SQL Server manager -&gt; Security -&gt; Logins -&gt; add "NT AUTHORITY\NETWORK SERVICE" or ASPNET&lt;br /&gt;Then click on the properties menu of the login and make the login dbcreator. This will fix the first of the exceptions above. Then with User Mapping setting we can add permissions explicitly to the desired database -&gt; dbowner gives all needed permission.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-8431349461895132365?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/8431349461895132365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/01/sql-server-express-permissions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8431349461895132365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8431349461895132365'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/01/sql-server-express-permissions.html' title='SQL Server Express permissions'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-3305961723192097824</id><published>2008-01-18T08:18:00.000-08:00</published><updated>2008-01-18T08:28:38.385-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How to get Profile instance out of asp.net page,</title><content type='html'>The way of getting Profile instance from a page context is Profile.GetProfile(). But how to do this when you need to get it from App_Code for instance. Here is the way:&lt;br /&gt;&lt;br /&gt;MembershipUser mUser = Membership.GetUser(UserId); &lt;br /&gt;ProfileCommon prof = (ProfileCommon)System.Web.Profile.ProfileBase.Create(mUser.UserName);&lt;br /&gt;&lt;br /&gt;the object "prof" has all profile fields as in a page.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-3305961723192097824?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/3305961723192097824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/01/how-to-get-profile-instance-out-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3305961723192097824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3305961723192097824'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/01/how-to-get-profile-instance-out-of.html' title='How to get Profile instance out of asp.net page,'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-2585001554985498346</id><published>2008-01-13T04:41:00.000-08:00</published><updated>2008-01-13T04:50:58.373-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How to set page/script timeout on an asp.net page</title><content type='html'>The solution is pretty simple. Use Server.ScriptTimeout to set the timeout for the script in a page. The value is measured in seconds.&lt;br /&gt;&lt;br /&gt;Server.ScriptTimeout = 3600&lt;br /&gt;&lt;br /&gt;Use this in Page_Load event. The example makes the timeout to be an hour.&lt;br /&gt;&lt;br /&gt;NOTE: using compilation debug="true" will ignore script timeout and it won't work. Make sure the debug value is false on the release version of web.config&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-2585001554985498346?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/2585001554985498346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/01/how-to-set-pagescript-timeout-on-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2585001554985498346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2585001554985498346'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/01/how-to-set-pagescript-timeout-on-aspnet.html' title='How to set page/script timeout on an asp.net page'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-291018166024888942</id><published>2008-01-04T13:30:00.000-08:00</published><updated>2008-01-04T13:46:12.881-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>FormsAuthentication.Authenticate vs Membership.ValidateUser</title><content type='html'>FormsAuthentication.Authenticate can be used with clear passwods to check user authentication:&lt;br /&gt;if(FormsAuthentication.Authenticate(Username.Text, Password.Text))&lt;br /&gt;{&lt;br /&gt;   FormsAuthentication.RedirectFromLoginPage(Username.Text, false);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This doesn't work if the password format is not clear. Asp.NET membership provider offers you Clear, MD5 or SHA1 represented passwords.&lt;br /&gt;In case of using MD5 or SHA1 (specified in web.config, SHA1 is default for hashed passwords) the checking for user credentials should be done by Membership.ValidateUser which delivers the provider model for user authentication.&lt;br /&gt;&lt;br /&gt;if( Membership.ValidateUser(curentUserName, pwd)){&lt;br /&gt;   FormsAuthentication.RedirectFromLoginPage(Username.Text, chkPersistent.Cheked);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The other things of authentication process can be left to the Asp.Net provider.&lt;br /&gt;&lt;br /&gt;See also for web.config: authentication and authorization, machine key generation, password format, password salt ...&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-291018166024888942?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/291018166024888942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/01/formsauthenticationauthenticate-vs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/291018166024888942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/291018166024888942'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/01/formsauthenticationauthenticate-vs.html' title='FormsAuthentication.Authenticate vs Membership.ValidateUser'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1704114513457535632</id><published>2008-01-02T23:38:00.000-08:00</published><updated>2008-01-02T23:44:17.003-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to use SQL Express database for more than one application</title><content type='html'>Somethimes we need to use one database for more than one application, web, desktop or service.&lt;br /&gt;The only thing to do is to get rid of the generation of a new user instance by the connection string in web.config. Assure that User Instance=False in the connection string and try again.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1704114513457535632?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1704114513457535632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2008/01/how-to-use-sql-express-database-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1704114513457535632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1704114513457535632'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2008/01/how-to-use-sql-express-database-for.html' title='How to use SQL Express database for more than one application'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-770919962674707972</id><published>2007-12-17T01:18:00.000-08:00</published><updated>2007-12-17T01:34:19.781-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Javascript: How to cancel leaving page without saving</title><content type='html'>Preparing the javascript:&lt;br /&gt;string jscript = "var needToSave= false;" +&lt;br /&gt;                 "window.onbeforeunload = confirmExit;" +&lt;br /&gt;                    "function confirmExit(){" +&lt;br /&gt;                        "if (needToSave){" +&lt;br /&gt;                            "return 'Are you sure you want to leave the page without saving?';" +&lt;br /&gt;                        "}" +&lt;br /&gt;                    "}";&lt;br /&gt;&lt;br /&gt;Registering the script - safe for ajax:&lt;br /&gt;&lt;br /&gt;ScriptManager smgr = ScriptManager.GetCurrent(Page);&lt;br /&gt;ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "&lt;script type='text/javascript'&gt;" + jscript + " &lt;/script&gt;", false);&lt;br /&gt;&lt;br /&gt;On every field that changes the data and requires saving put: &lt;br /&gt;control.Attributes.Add("onkeydown","javascript: needToSave=true;")&lt;br /&gt;&lt;br /&gt;on the button that make save postback add:&lt;br /&gt;control.Attributes.Add("onclick","javascript: needToSave=false;")&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-770919962674707972?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/770919962674707972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/12/javascript-how-to-cancel-leaving-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/770919962674707972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/770919962674707972'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/12/javascript-how-to-cancel-leaving-page.html' title='Javascript: How to cancel leaving page without saving'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-2555512105230794985</id><published>2007-12-11T10:10:00.000-08:00</published><updated>2007-12-11T10:20:17.922-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>Page Cannot Be Found Issue on IIS 6 on Windows 2003</title><content type='html'>Also:&lt;br /&gt;HTTP 404 - File not found&lt;br /&gt;&lt;br /&gt;First of all be sure that the default document list contains the page you are requesting (IIS -&gt; Server Node -&gt; Site node -&gt; right mose click -&gt; Properties -&gt; Documents&lt;br /&gt;Also set the necessary permission to the web folder (NETWORK SERVICE must have read/write rights)&lt;br /&gt;Check if the asp.net status is allowed (IIS -&gt; Server Node -&gt; Web Service Extensions -&gt; Asp.net must be allowed). This can be done during the installation of IIS.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-2555512105230794985?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/2555512105230794985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/12/page-cannot-be-found-issue-on-iis-6-on.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2555512105230794985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2555512105230794985'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/12/page-cannot-be-found-issue-on-iis-6-on.html' title='Page Cannot Be Found Issue on IIS 6 on Windows 2003'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-503111683927350453</id><published>2007-12-06T13:29:00.000-08:00</published><updated>2007-12-06T13:44:13.654-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ASP.NET Export content to Excel files.</title><content type='html'>The most common problem during exporting page content to an excel file is the following exception: RegisterForEventValidation can only be called during Render();&lt;br /&gt;The only thing you need to do is to set enableEventValidation ="false" in web.config (affects all your pages) or in the head page line.&lt;br /&gt;&lt;br /&gt;If you want to render a control into an excel file (using HTML representation) the VerifyRenderingInServerForm() method must be overridden. &lt;br /&gt;&lt;br /&gt;public override void VerifyRenderingInServerForm(Control control){}&lt;br /&gt;&lt;br /&gt;This confirms that an HtmlForm control is already rendered. &lt;br /&gt;&lt;br /&gt;... and the example - rendering existing gridview control into a xls file:&lt;br /&gt;        Response.Clear();&lt;br /&gt;        Response.AddHeader("content-disposition", "attachment;filename=file.xls");&lt;br /&gt;        Response.Charset = "";&lt;br /&gt;        Response.Cache.SetCacheability(HttpCacheability.NoCache);&lt;br /&gt;        Response.ContentType = "application/vnd.xls";&lt;br /&gt;        System.IO.StringWriter stringWrite = new System.IO.StringWriter(); ;&lt;br /&gt;        System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);&lt;br /&gt;        htmlWrite.Write("text text");&lt;br /&gt;        htmlWrite.WriteBreak();        &lt;br /&gt;        GridView1.RenderControl(htmlWrite);       &lt;br /&gt;        Response.Write(stringWrite.ToString());&lt;br /&gt;        Response.End();&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-503111683927350453?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/503111683927350453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/12/aspnet-export-content-to-excel-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/503111683927350453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/503111683927350453'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/12/aspnet-export-content-to-excel-files.html' title='ASP.NET Export content to Excel files.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-3522828307142562688</id><published>2007-11-06T00:55:00.000-08:00</published><updated>2007-11-06T01:01:14.692-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>How to recover Mozilla Firefox Bookmarks</title><content type='html'>Very strange problem. Sometimes firefox' bookmarks dissapear.  May be this is connected with NTFS problems (sometimes solved by chkdsk c: /f). But the best way to recover the bookmarks is to get them again from the last firefox archive. They are in&lt;br /&gt;&lt;br /&gt;C:\Documents and Settings\[username]\Application Data\Mozilla\Firefox\Profiles\pypbblhs.default\bookmarkbackups&lt;br /&gt;&lt;br /&gt;and the last archive must be ranamed and put into&lt;br /&gt;&lt;br /&gt;C:\Documents and Settings\[username]\Application Data\Mozilla\Firefox\Profiles\pypbblhs.default&lt;br /&gt;&lt;br /&gt;This solved my problem :)&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-3522828307142562688?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/3522828307142562688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/11/how-to-recover-mozilla-firefox.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3522828307142562688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3522828307142562688'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/11/how-to-recover-mozilla-firefox.html' title='How to recover Mozilla Firefox Bookmarks'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-5345614342596076884</id><published>2007-10-28T11:04:00.000-07:00</published><updated>2007-10-28T11:27:54.914-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Problems with using SQL Server instance by Windows remote desktop</title><content type='html'>&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-size:130%;"&gt;'Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.'&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:130%;"  &gt;This problem occurs when the user uses remote desktop and logs into the system for the first time. If the user logs in at first locally and then uses remote desktop the problem doesn't occur.&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:130%;"  &gt;Microsoft describe the problem in the article&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;a style="font-family: verdana;" href="http://support.microsoft.com/?id=896613"&gt;http://support.microsoft.com/?id=896613&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:130%;"  &gt;It is enough to request them to send you a link for the fix (windows update) and wait a few hours. The fix cannot be downloaded directly because of need of additional testing. But it works fine for me.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-5345614342596076884?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/5345614342596076884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/10/problems-with-using-sql-server-instance.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5345614342596076884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5345614342596076884'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/10/problems-with-using-sql-server-instance.html' title='Problems with using SQL Server instance by Windows remote desktop'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-8631944312300078829</id><published>2007-10-24T23:37:00.000-07:00</published><updated>2007-11-26T00:50:58.444-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><title type='text'>A tip for avoiding null values in aggregate functions in sql</title><content type='html'>Sometimes the aggreagete functions in SQL returns null value - when the data doesn't meet  selection criteria defined in the query.&lt;br /&gt;We can return 0 instead NULL with (ISNULL (column, 0)).&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;SELECT     &lt;br /&gt;(ISNULL (SUM (salary), 0)) As Total&lt;br /&gt;FROM         Salaries&lt;br /&gt;WHERE&lt;br /&gt;UserId=@UserId&lt;br /&gt;&lt;br /&gt;Using such statement avoids checking for null values in the code.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-8631944312300078829?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/8631944312300078829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/10/tip-for-avoiding-null-values-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8631944312300078829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8631944312300078829'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/10/tip-for-avoiding-null-values-in.html' title='A tip for avoiding null values in aggregate functions in sql'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-5018385258307339899</id><published>2007-10-24T01:25:00.000-07:00</published><updated>2007-11-12T00:31:41.081-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>How to hibernate Windows.</title><content type='html'>What is Hibernate? This is a process of copying all RAM content to the hard disk and possibility to continue your work from the last state after shutting down the system.&lt;br /&gt;The required things are:&lt;br /&gt;1. Your motherboard must support this Function&lt;br /&gt;2. Hard disk space at least your RAM size.&lt;br /&gt;3. Enabled Hibernation in Windows&lt;br /&gt;(Display Properties -&gt; Screen Saver -&gt; Monitor Power -&gt; Hibernate -&gt; Enable Hibernation check box)&lt;br /&gt;&lt;br /&gt;Button "Hibernation" is shown after clicking Shut Down. If you dont have this button, you can show it by pointing "Stand By" button on the shutdown dialog box and hold Shift button. :-) I dont know why? It seems the newer versions of XP doesn't show Hibernate button.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-5018385258307339899?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/5018385258307339899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/11/how-to-hibernate-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5018385258307339899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5018385258307339899'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/11/how-to-hibernate-windows.html' title='How to hibernate Windows.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-2216210369912273980</id><published>2007-10-23T01:44:00.000-07:00</published><updated>2007-10-23T01:58:48.295-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>ASP.NET How to access the EmptyDataTemplate controls from OnRowCommand in GridView</title><content type='html'>The way of getting access to the controls in EmptyDataTemplate is similar to the way of accessing controls in the same data row in the gridview.&lt;br /&gt;&lt;br /&gt;For example - inserting value in the empty gridview:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)&lt;br /&gt;{&lt;br /&gt; if (e.CommandName == "Insert") {&lt;br /&gt;  TextBox txt  =&lt;br /&gt;    (((Control)e.CommandSource).NamingContainer).FindControl("txtTest") as TextBox;&lt;br /&gt;&lt;br /&gt;    //do insert action&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Another way to do this is by getting EmptyDataTemplate table and its controls:&lt;br /&gt;&lt;pre&gt;if (e.CommandName == "Insert")&lt;br /&gt;&lt;pre class="coloredcode"&gt;{&lt;br /&gt;   Table table = (Table)GridView1.Controls[0];&lt;br /&gt;   TextBox txtTest= (TextBox)table.Rows[0].FindControl("txtTest");&lt;br /&gt;&lt;br /&gt;   //do insert actions&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-2216210369912273980?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/2216210369912273980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/10/aspnet-how-to-access-emptydatatemplate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2216210369912273980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2216210369912273980'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/10/aspnet-how-to-access-emptydatatemplate.html' title='ASP.NET How to access the EmptyDataTemplate controls from OnRowCommand in GridView'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-6825276764875519205</id><published>2007-10-22T02:04:00.000-07:00</published><updated>2007-10-23T02:13:12.149-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>ASP.NET How to set and get key values for every gridrow in a gridview.</title><content type='html'>Setting primary key values during data binding:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;gvUsersInRoles.DataSource=taUsersInRoles.GetData();&lt;br /&gt;gvUsersInRoles.DataKeyNames = new string[] { "UserId", "RoleId" };&lt;br /&gt;gvUsersInRoles.DataBind();    &lt;br /&gt;&lt;/pre&gt;This example uses composite  primary key for showing more complicated usage.&lt;br /&gt;&lt;br /&gt;Getting primary key values during performing row command (command, insert, delete, update):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Guid uid = new Guid(gvUsersInRoles.DataKeys[e.RowIndex]["UserId"].ToString());&lt;br /&gt;int pid = int.Parse(gvUsersInRoles.DataKeys[e.RowIndex]["RoleId"].ToString());&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-6825276764875519205?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/6825276764875519205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/10/aspnet-how-to-set-and-get-key-values.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6825276764875519205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/6825276764875519205'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/10/aspnet-how-to-set-and-get-key-values.html' title='ASP.NET How to set and get key values for every gridrow in a gridview.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-8527290622497638766</id><published>2007-10-19T12:36:00.000-07:00</published><updated>2007-11-26T00:52:07.444-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><title type='text'>Getting the  the newly created primary key after sql insert  operation</title><content type='html'>INSERT INTO Table(COL1) VALUES('213')&lt;br /&gt;&lt;br /&gt;SELECT @@IDENTITY&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;Return SCOPE_IDENTITY()&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;Return &lt;a name="remarksToggle"&gt;IDENT_CURRENT('TableName')&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="remarksToggle"&gt;&lt;/a&gt;&lt;br /&gt;SCOPE_IDENTITY and @@IDENTITY return the last identity values that are generated in any table in the current session.&lt;br /&gt;&lt;br /&gt;SCOPE_IDENTITY returns values inserted only within the current scope.&lt;br /&gt;&lt;br /&gt;@@IDENTITY is not limited to a specific scope. It returns the last identity value after performing all scopes (including triggers).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="remarksToggle"&gt;          IDENT_CURRENT returns the last identity value generated for a specific table in any session and any scope. In othe words it &lt;/a&gt;&lt;a name="sectionToggle2"&gt;teturns the last value inserted into 'Tablename'&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-8527290622497638766?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/8527290622497638766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/10/getting-the-newly-created-primary-key.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8527290622497638766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8527290622497638766'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/10/getting-the-newly-created-primary-key.html' title='Getting the  the newly created primary key after sql insert  operation'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-5476994894179378148</id><published>2007-10-18T06:16:00.000-07:00</published><updated>2007-10-18T06:23:22.547-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Using ASP.NET SQL Server Registration Tool (aspnet_regsql.exe) with SQL Express 2005 databases</title><content type='html'>The aspnet_regsql can be found in&lt;br /&gt;&lt;drive&gt;[HDD Drive]:\WINDOWS\Microsoft.NET\Framework\v2.0.50727&lt;br /&gt;&lt;br /&gt;The command used for adding asp.net 2.0 membership stuff is&lt;br /&gt;&lt;br /&gt;aspnet_regsql -A all&lt;br /&gt; -C "Data Source=.\EXPRESS;Integrated Security=True;User Instance=True"&lt;br /&gt; -d "&lt;absolute&gt;[database path]"&lt;br /&gt;&lt;br /&gt;&lt;/absolute&gt;&lt;/drive&gt;&lt;p&gt;&lt;b&gt;-d&lt;/b&gt; &lt;span class="parameter"&gt;&lt;database&gt; - specifies the database by actual database path&lt;br /&gt;&lt;/database&gt;&lt;/span&gt;&lt;/p&gt;&lt;b&gt;-A&lt;/b&gt; &lt;span class="parameter"&gt;all|m|r|p|c|w - &lt;/span&gt;&lt;br /&gt;&lt;p&gt;Adds support for one or more ASP.NET application services. Service identifiers can be specified together or separately. The following identifiers are used for ASP.NET application services:&lt;/p&gt; &lt;p&gt;&lt;b&gt;all&lt;/b&gt; - All services, including common tables and stored procedures shared by the services&lt;/p&gt; &lt;p&gt;&lt;b&gt;m&lt;/b&gt; - Membership&lt;/p&gt; &lt;p&gt;&lt;b&gt;r&lt;/b&gt; - Role Manager&lt;/p&gt; &lt;p&gt;&lt;b&gt;p&lt;/b&gt; - Profile&lt;/p&gt; &lt;p&gt;&lt;b&gt;c&lt;/b&gt; - Web Parts Personalization&lt;/p&gt; &lt;p&gt;&lt;b&gt;w&lt;/b&gt; - Web Events&lt;/p&gt;&lt;br /&gt;-C - Specifies the connection string to the computer running SQL Server where the database will be installed, or is already installed. This option is not necessary if you specify only the server (&lt;b&gt;-S&lt;/b&gt;) and login (&lt;b&gt;-U&lt;/b&gt; and &lt;b&gt;-P&lt;/b&gt;, or &lt;b&gt;-E&lt;/b&gt;) information.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-5476994894179378148?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/5476994894179378148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/10/using-aspnet-sql-server-registration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5476994894179378148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5476994894179378148'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/10/using-aspnet-sql-server-registration.html' title='Using ASP.NET SQL Server Registration Tool (aspnet_regsql.exe) with SQL Express 2005 databases'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-8014036678721925148</id><published>2007-10-16T13:59:00.000-07:00</published><updated>2007-10-16T14:29:13.868-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Web server'/><title type='text'>How to set up SMTP Virtual Server with IIS</title><content type='html'>Exception: Mailbox unavailable. The server response was: 5.7.1&lt;br /&gt;&lt;br /&gt;Check the following settings in IIS&lt;br /&gt;&lt;br /&gt;IIS -&gt; Default SMTP Server -&gt; Properties -&gt; Access&lt;br /&gt;1. Authentication -&gt; Anonymous access -&gt; Checked&lt;br /&gt;2. Connection control -&gt; Only the list below -&gt; Add current web server ip&lt;br /&gt;Relay restrictions &gt; Relay &gt; - Only the list below -&gt; Add current web server ip&lt;br /&gt;&lt;br /&gt;Also add localhost ip here 127.0.0.1 . If DNS lookup doesnt work you can add alias for 127.0.0.1 in your&lt;br /&gt;C:\WINDOWS\system32\drivers\etc\hosts file.&lt;br /&gt;&lt;br /&gt;Also it is necessary to have these lines in web.config&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;#60;&amp;#115;&amp;#121;&amp;#115;&amp;#116;&amp;#101;&amp;#109;&amp;#46;&amp;#110;&amp;#101;&amp;#116;&amp;#62;&lt;br /&gt;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#60;&amp;#109;&amp;#97;&amp;#105;&amp;#108;&amp;#115;&amp;#101;&amp;#116;&amp;#116;&amp;#105;&amp;#110;&amp;#103;&amp;#115;&amp;#62;&lt;br /&gt;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#60;&amp;#115;&amp;#109;&amp;#116;&amp;#112;&amp;#32;&amp;#100;&amp;#101;&amp;#108;&amp;#105;&amp;#118;&amp;#101;&amp;#114;&amp;#121;&amp;#109;&amp;#101;&amp;#116;&amp;#104;&amp;#111;&amp;#100;&amp;#61;&amp;#34;&amp;#110;&amp;#101;&amp;#116;&amp;#119;&amp;#111;&amp;#114;&amp;#107;&amp;#34;&amp;#32;&amp;#102;&amp;#114;&amp;#111;&amp;#109;&amp;#61;&amp;#34;&amp;#117;&amp;#115;&amp;#101;&amp;#114;&amp;#64;&amp;#100;&amp;#111;&amp;#109;&amp;#97;&amp;#105;&amp;#110;&amp;#46;&amp;#99;&amp;#111;&amp;#109;&amp;#34;&amp;#62;&lt;br /&gt;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#60;&amp;#110;&amp;#101;&amp;#116;&amp;#119;&amp;#111;&amp;#114;&amp;#107;&amp;#32;&amp;#104;&amp;#111;&amp;#115;&amp;#116;&amp;#61;&amp;#34;&amp;#108;&amp;#111;&amp;#99;&amp;#97;&amp;#108;&amp;#104;&amp;#111;&amp;#115;&amp;#116;&amp;#34;&amp;#32;&amp;#112;&amp;#111;&amp;#114;&amp;#116;&amp;#61;&amp;#34;&amp;#50;&amp;#53;&amp;#34;&amp;#32;&amp;#100;&amp;#101;&amp;#102;&amp;#97;&amp;#117;&amp;#108;&amp;#116;&amp;#99;&amp;#114;&amp;#101;&amp;#100;&amp;#101;&amp;#110;&amp;#116;&amp;#105;&amp;#97;&amp;#108;&amp;#115;&amp;#61;&amp;#34;&amp;#116;&amp;#114;&amp;#117;&amp;#101;&amp;#34;&amp;#62;&lt;br /&gt;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#60;&amp;#47;&amp;#110;&amp;#101;&amp;#116;&amp;#119;&amp;#111;&amp;#114;&amp;#107;&amp;#62;&lt;br /&gt;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#60;&amp;#47;&amp;#115;&amp;#109;&amp;#116;&amp;#112;&amp;#62;&lt;br /&gt;&amp;#32;&amp;#32;&amp;#32;&amp;#60;&amp;#47;&amp;#109;&amp;#97;&amp;#105;&amp;#108;&amp;#115;&amp;#101;&amp;#116;&amp;#116;&amp;#105;&amp;#110;&amp;#103;&amp;#115;&amp;#62;&lt;br /&gt;&amp;#60;&amp;#47;&amp;#115;&amp;#121;&amp;#115;&amp;#116;&amp;#101;&amp;#109;&amp;#46;&amp;#110;&amp;#101;&amp;#116;&amp;#62;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-8014036678721925148?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/8014036678721925148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/10/how-to-set-up-smtp-virtual-server-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8014036678721925148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8014036678721925148'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/10/how-to-set-up-smtp-virtual-server-with.html' title='How to set up SMTP Virtual Server with IIS'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-3653588834187021016</id><published>2007-10-16T06:49:00.000-07:00</published><updated>2007-10-16T06:53:38.240-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How to validate dates in ASP.NET</title><content type='html'>The simpliest way is by using range validator control and define date bounds&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;#60;&amp;#97;&amp;#115;&amp;#112;&amp;#58;&amp;#116;&amp;#101;&amp;#120;&amp;#116;&amp;#98;&amp;#111;&amp;#120;&amp;#32;&amp;#105;&amp;#100;&amp;#61;&amp;#34;&amp;#116;&amp;#101;&amp;#120;&amp;#116;&amp;#98;&amp;#111;&amp;#120;&amp;#49;&amp;#34;&amp;#32;&amp;#114;&amp;#117;&amp;#110;&amp;#97;&amp;#116;&amp;#61;&amp;#34;&amp;#115;&amp;#101;&amp;#114;&amp;#118;&amp;#101;&amp;#114;&amp;#34;&amp;#62;&lt;br /&gt;&amp;#60;&amp;#47;&amp;#97;&amp;#115;&amp;#112;&amp;#58;&amp;#116;&amp;#101;&amp;#120;&amp;#116;&amp;#98;&amp;#111;&amp;#120;&amp;#62;&lt;br /&gt;&amp;#60;&amp;#97;&amp;#115;&amp;#112;&amp;#58;&amp;#114;&amp;#97;&amp;#110;&amp;#103;&amp;#101;&amp;#118;&amp;#97;&amp;#108;&amp;#105;&amp;#100;&amp;#97;&amp;#116;&amp;#111;&amp;#114;&amp;#32;&amp;#105;&amp;#100;&amp;#61;&amp;#34;&amp;#118;&amp;#97;&amp;#108;&amp;#82;&amp;#97;&amp;#110;&amp;#103;&amp;#101;&amp;#34;&amp;#32;&amp;#114;&amp;#117;&amp;#110;&amp;#97;&amp;#116;&amp;#61;&amp;#34;&amp;#115;&amp;#101;&amp;#114;&amp;#118;&amp;#101;&amp;#114;&amp;#34;&amp;#32;&amp;#99;&amp;#111;&amp;#110;&amp;#116;&amp;#114;&amp;#111;&amp;#108;&amp;#116;&amp;#111;&amp;#118;&amp;#97;&amp;#108;&amp;#105;&amp;#100;&amp;#97;&amp;#116;&amp;#101;&amp;#61;&amp;#34;&amp;#116;&amp;#101;&amp;#120;&amp;#116;&amp;#98;&amp;#111;&amp;#120;&amp;#49;&amp;#34;&amp;#32;&lt;br /&gt;&amp;#109;&amp;#97;&amp;#120;&amp;#105;&amp;#109;&amp;#117;&amp;#109;&amp;#118;&amp;#97;&amp;#108;&amp;#117;&amp;#101;&amp;#61;&amp;#34;&amp;#51;&amp;#49;&amp;#47;&amp;#49;&amp;#50;&amp;#47;&amp;#50;&amp;#48;&amp;#49;&amp;#48;&amp;#34;&amp;#32;&lt;br /&gt;&amp;#109;&amp;#105;&amp;#110;&amp;#105;&amp;#109;&amp;#117;&amp;#109;&amp;#118;&amp;#97;&amp;#108;&amp;#117;&amp;#101;&amp;#61;&amp;#34;&amp;#49;&amp;#47;&amp;#49;&amp;#47;&amp;#50;&amp;#48;&amp;#48;&amp;#48;&amp;#34;&amp;#32;&amp;#116;&amp;#121;&amp;#112;&amp;#101;&amp;#61;&amp;#34;&amp;#68;&amp;#97;&amp;#116;&amp;#101;&amp;#34;&amp;#32;&lt;br /&gt;&amp;#101;&amp;#114;&amp;#114;&amp;#111;&amp;#114;&amp;#109;&amp;#101;&amp;#115;&amp;#115;&amp;#97;&amp;#103;&amp;#101;&amp;#61;&amp;#34;&amp;#42;&amp;#34;&amp;#32;&amp;#100;&amp;#105;&amp;#115;&amp;#112;&amp;#108;&amp;#97;&amp;#121;&amp;#61;&amp;#34;&amp;#100;&amp;#121;&amp;#110;&amp;#97;&amp;#109;&amp;#105;&amp;#99;&amp;#34;&amp;#62;&lt;br /&gt;&amp;#42;&lt;br /&gt;&amp;#60;&amp;#47;&amp;#97;&amp;#115;&amp;#112;&amp;#58;&amp;#114;&amp;#97;&amp;#110;&amp;#103;&amp;#101;&amp;#118;&amp;#97;&amp;#108;&amp;#105;&amp;#100;&amp;#97;&amp;#116;&amp;#111;&amp;#114;&amp;#62;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-3653588834187021016?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/3653588834187021016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/10/how-to-validate-dates-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3653588834187021016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3653588834187021016'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/10/how-to-validate-dates-in-aspnet.html' title='How to validate dates in ASP.NET'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1235357592626792784</id><published>2007-10-15T13:46:00.000-07:00</published><updated>2007-10-15T14:08:07.344-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Some facts about Sessions in ASP.NET</title><content type='html'>The kind of objects that can be stored in a session variable depends on which mode is used:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;InProc Mode&lt;/span&gt;- objects stored in session state are actually live objects, and so you can store whatever object you have created.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;State Server or SQL Server mode&lt;/span&gt;, objects in the session state will be serialized and deserialized when a request is processed. So make sure your objects are serializable and their classes must be marked as so. If not, the session state will not be saved successfully.&lt;br /&gt;&lt;br /&gt;To enable sessions in the asp.net site you need to&lt;br /&gt;include a pages attribute in web.config:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;#60;&amp;#112;&amp;#97;&amp;#103;&amp;#101;&amp;#115;&amp;#32;&amp;#101;&amp;#110;&amp;#97;&amp;#98;&amp;#108;&amp;#101;&amp;#115;&amp;#101;&amp;#115;&amp;#115;&amp;#105;&amp;#111;&amp;#110;&amp;#115;&amp;#116;&amp;#97;&amp;#116;&amp;#101;&amp;#61;&amp;#34;&amp;#116;&amp;#114;&amp;#117;&amp;#101;&amp;#34;&amp;#62;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;or enable SessionState in the Page directive in your page :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;%@ Page enableSessionState = "true" %&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Also, the System.Web.SessionStateModule should exist in your&lt;br /&gt;httpModules section in the application configuration.&lt;br /&gt;&lt;br /&gt;&amp;#60;&amp;#104;&amp;#116;&amp;#116;&amp;#112;&amp;#77;&amp;#111;&amp;#100;&amp;#117;&amp;#108;&amp;#101;&amp;#115;&amp;#62;&lt;br /&gt;&amp;#9;&amp;#9;&amp;#60;&amp;#97;&amp;#100;&amp;#100;&amp;#32;&amp;#116;&amp;#121;&amp;#112;&amp;#101;&amp;#61;&amp;#34;&amp;#83;&amp;#121;&amp;#115;&amp;#116;&amp;#101;&amp;#109;&amp;#46;&amp;#87;&amp;#101;&amp;#98;&amp;#46;&amp;#83;&amp;#101;&amp;#115;&amp;#115;&amp;#105;&amp;#111;&amp;#110;&amp;#83;&amp;#116;&amp;#97;&amp;#116;&amp;#101;&amp;#46;&amp;#83;&amp;#101;&amp;#115;&amp;#115;&amp;#105;&amp;#111;&amp;#110;&amp;#83;&amp;#116;&amp;#97;&amp;#116;&amp;#101;&amp;#77;&amp;#111;&amp;#100;&amp;#117;&amp;#108;&amp;#101;&amp;#34;&amp;#32;&amp;#110;&amp;#97;&amp;#109;&amp;#101;&amp;#61;&amp;#34;&amp;#83;&amp;#101;&amp;#115;&amp;#115;&amp;#105;&amp;#111;&amp;#110;&amp;#34;&amp;#32;&amp;#47;&amp;#62;&amp;#9;&amp;#9;&lt;br /&gt;&amp;#32;&amp;#32;&amp;#32;&amp;#32;&amp;#60;&amp;#47;&amp;#104;&amp;#116;&amp;#116;&amp;#112;&amp;#77;&amp;#111;&amp;#100;&amp;#117;&amp;#108;&amp;#101;&amp;#115;&amp;#62;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1235357592626792784?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1235357592626792784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/10/some-facts-about-sessions-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1235357592626792784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1235357592626792784'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/10/some-facts-about-sessions-in-aspnet.html' title='Some facts about Sessions in ASP.NET'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-326989282593857605</id><published>2007-10-15T12:40:00.000-07:00</published><updated>2007-10-15T12:56:19.491-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Page attributes in ASP.NET for  extending System.Web.UI.Page</title><content type='html'>PageBaseType – Takes a string value defining the base type that will be used for the bage. The default is System.Web.UI.Page. The value gets overridden by the value in the inherits attribute in the standalone file.&lt;br /&gt;&lt;br /&gt;userControlbaseType – specifies the base type for controls to be used when the page is standalone.&lt;br /&gt;&lt;br /&gt;After implementing classes that extend System.Web.UI.Page or System.Web.UI.UserControl their type can be determined for all pages in the site by their page attributes in web.config. Another way to define the type of the base class is by explicitly defined property CodeFileBaseClass=... in the Page or Control tag (first row in the page).&lt;br /&gt;&lt;br /&gt;The using of Page properties (fields) or custom methods by user control is possible by converting Page field to the base page type:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;CType(Me.Page, PageBase).Property&lt;br /&gt;CType(Me.Page, PageBase).Method()&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-326989282593857605?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/326989282593857605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/10/page-attributes-in-aspnet-for-extending.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/326989282593857605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/326989282593857605'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/10/page-attributes-in-aspnet-for-extending.html' title='Page attributes in ASP.NET for  extending System.Web.UI.Page'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1478747000113330836</id><published>2007-10-11T09:19:00.000-07:00</published><updated>2007-11-26T00:52:50.872-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL std'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Add/remove columns, changing default values in a SQL Server 2005 table</title><content type='html'>&lt;pre&gt;Add new column in a table with checking for existence.&lt;br /&gt;IF NOT EXISTS(SELECT * FROM syscolumns WHERE id=object_id('ColumnName') and name='TableName')&lt;br /&gt; ALTER TABLE TableName ADD ColumnName bit not null default 0&lt;br /&gt;&lt;br /&gt;Changing default values in a SQL Server 2005 table&lt;br /&gt;ALTER TABLE [Table]  ADD CONSTRAINT&lt;br /&gt;    ConstrName  DEFAULT 0 FOR ColumnName&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1478747000113330836?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1478747000113330836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/10/changing-default-values-in-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1478747000113330836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1478747000113330836'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/10/changing-default-values-in-sql-server.html' title='Add/remove columns, changing default values in a SQL Server 2005 table'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1883392032161414687</id><published>2007-09-24T03:00:00.000-07:00</published><updated>2007-11-26T00:50:41.854-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>DropDownList in GridView</title><content type='html'>It is necessary to convert bound field to a template field, then set your DropDownList up. In the example it is bound  to  an ObjectDataSource.  It is possible to use statement like (SelectedValue=&lt;%# Bind("Field") %&gt;), but this way is good only for read-only gridview.&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;Any postback can throw an exception connected to the Bind/Eval way of binding  -&lt;br /&gt;&lt;span style="font-style: italic;"&gt;'Databinding methods such as Eval(), XPath(), and Bind() can only be used in the                         context of a databound control'&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The better way is by using customized code during processing the ItemUpdating event:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;asp:TemplateField HeaderText="Header text"&amp;gt;&lt;br /&gt;  &amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;    &amp;lt;asp:DropDownList ID="ddlItem"&lt;br /&gt;        runat="server" OnDataBound="ddlItems_DataBound"&lt;br /&gt;        DataSourceID="ObjectDataSource1"    AppendDataBoundItems="false"&lt;br /&gt;        DataTextField="Name" DataValueField="Id" &amp;gt;&lt;br /&gt;    &amp;lt;/asp:DropDownList&amp;gt;&lt;br /&gt;  &amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;/asp:TemplateField&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;protected void ddlItems_DataBound(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;  DropDownList ddl = (DropDownList)sender;&lt;br /&gt;  GridViewRow gvr = (GridViewRow)ddl.NamingContainer;&lt;br /&gt;  if (gvr.DataItem != null)&lt;br /&gt;  {&lt;br /&gt;      string id = ((DataRowView)gvr.DataItem)["Id"].ToString();&lt;br /&gt;      ddl.ClearSelection();&lt;br /&gt;      ListItem li = ddl.Items.FindByValue(id);&lt;br /&gt;      if (li != null) li.Selected = true;&lt;br /&gt;  }     &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It is important to use cast of sender, not direct calling to the GridView1 control. Every GridViewRow is actually DetailsView object.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;protected void GridView1_RowUpdating&lt;br /&gt; (object sender, GridViewUpdateEventArgs e)&lt;br /&gt;{     &lt;br /&gt; DropDownList ddl =&lt;br /&gt;   (DropDownList)(((GridView)sender).Rows[e.RowIndex].FindControl("ddlItems"));&lt;br /&gt; e.NewValues["Id"] = ddl.SelectedValue;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1883392032161414687?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1883392032161414687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/09/dropdownlist-in-gridview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1883392032161414687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1883392032161414687'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/09/dropdownlist-in-gridview.html' title='DropDownList in GridView'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7088245396689530683</id><published>2007-09-23T05:57:00.000-07:00</published><updated>2007-09-23T06:42:17.671-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Confirmation dialog to a GridView delete option</title><content type='html'>Actually it is not possible to attach client confirmation to the delete command filed. But it is pretty easy to do this by template field. The only think you have to do is to set command name to be "Delete"  (CommandName="Delete"). GridView event handlers are responsible for the other things of delete process.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;asp:TemplateField&amp;gt;  &lt;br /&gt;         &amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;         &amp;lt;asp:LinkButton ID="delete1"&lt;br /&gt;  runat="server"&lt;br /&gt;  OnClientClick=&lt;br /&gt;  "return confirm('Are you sure you want to delete this record?');"&lt;br /&gt;         CommandName="Delete"&amp;gt;Delete&lt;br /&gt;         &amp;lt;/asp:LinkButton&amp;gt;&lt;br /&gt;         &amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;/asp:TemplateField&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7088245396689530683?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7088245396689530683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/09/confirmation-dialog-to-gridview-delete.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7088245396689530683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7088245396689530683'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/09/confirmation-dialog-to-gridview-delete.html' title='Confirmation dialog to a GridView delete option'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-5665579984247022951</id><published>2007-09-21T12:08:00.000-07:00</published><updated>2007-09-21T13:07:36.868-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Passing data between two pages with Cross-page Postback and Server.Transfer</title><content type='html'>The ASP.NET control, that cause postback, post back to the page for processing. That page can be current page or another page. Every control that cause postback can be configured to post to a different page - this postback is called cross postback and is often used for getting information from the pages in the multi page form, especially convenient for creating wizards.&lt;br /&gt;&lt;br /&gt;&amp;#60;&amp;#97;&amp;#115;&amp;#112;&amp;#58;&amp;#66;&amp;#117;&amp;#116;&amp;#116;&amp;#111;&amp;#110;&amp;#32;&lt;br /&gt;&amp;#32;&amp;#32;&amp;#73;&amp;#68;&amp;#61;&amp;#34;&amp;#66;&amp;#117;&amp;#116;&amp;#116;&amp;#111;&amp;#110;&amp;#49;&amp;#34;&amp;#32;&lt;br /&gt;&amp;#32;&amp;#32;&amp;#80;&amp;#111;&amp;#115;&amp;#116;&amp;#66;&amp;#97;&amp;#99;&amp;#107;&amp;#85;&amp;#114;&amp;#108;&amp;#61;&amp;#34;&amp;#126;&amp;#47;&amp;#84;&amp;#97;&amp;#114;&amp;#103;&amp;#101;&amp;#116;&amp;#80;&amp;#97;&amp;#103;&amp;#101;&amp;#46;&amp;#97;&amp;#115;&amp;#112;&amp;#120;&amp;#34;&lt;br /&gt;&amp;#32;&amp;#32;&amp;#114;&amp;#117;&amp;#110;&amp;#97;&amp;#116;&amp;#61;&amp;#34;&amp;#115;&amp;#101;&amp;#114;&amp;#118;&amp;#101;&amp;#114;&amp;#34;&lt;br /&gt;&amp;#32;&amp;#32;&amp;#84;&amp;#101;&amp;#120;&amp;#116;&amp;#61;&amp;#34;&amp;#83;&amp;#117;&amp;#98;&amp;#109;&amp;#105;&amp;#116;&amp;#34;&amp;#32;&amp;#47;&amp;#62;&lt;br /&gt;&lt;br /&gt;Cross-page post back is similar to Server.Transfer method, but there are some imporrtant differences. Server.Transfer conserves the post data between pages and also it keeps the url. And also it has a documented bug with getting url parameters from the source page. The Server.Transfer method is a server-based operation whereas cross-page postback is a client-based transfer. The main aim of the Server.Transfre method is to reduce client request to the server which makes it faster than Response.Redirect().&lt;br /&gt;Anyway the cross-page postaback can throw the user on another page but with possibility to get the post data.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;if (Page.PreviousPage != null)&lt;br /&gt; { &lt;br /&gt;  TextBox SourceTextBox =(TextBox)Page.PreviousPage.FindControl("TextBox1"); &lt;br /&gt;  if (SourceTextBox != null)  {  Label1.Text = SourceTextBox.Text;  &lt;br /&gt; }&lt;br /&gt;} &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;there is also possibility to get public properties from the source page with decalring the source:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;%@ PreviousPageType VirtualPath="~/SourcePage.aspx" %&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;getting the whole source page:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;SourcePage_aspx sourcePage;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;sourcePage = (SourcePage_aspx) PreviousPage;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Label1.Text = sourcePage.CurrentCity;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With PreviousPage.IsCrossPagePostBack we can determine whether the page was invoked from a cross-page posting.&lt;br /&gt;&lt;br /&gt;Resources:&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms178139.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms178139.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.developer.com/net/asp/article.php/3299641"&gt;http://www.developer.com/net/asp/article.php/3299641&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/useritems/CrossPagePosting.asp"&gt;http://www.codeproject.com/useritems/CrossPagePosting.asp&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-5665579984247022951?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/5665579984247022951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/09/passing-data-between-two-pages-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5665579984247022951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5665579984247022951'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/09/passing-data-between-two-pages-with.html' title='Passing data between two pages with Cross-page Postback and Server.Transfer'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-2242969468200691150</id><published>2007-09-19T12:36:00.000-07:00</published><updated>2007-09-19T12:53:29.826-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Script Callbacks in ASP.NET</title><content type='html'>&lt;span style="font-family:Verdana, Arial, Helvetica;font-size:-1;"&gt;I am sure that every web developers hates page refresh. And everyone chases the way to make its page more interactive without postback. The best way is client side scripting, but it is not enough to generate all page activity. Javascript based technologies like callbacks and AJAX are at the bottom of the effcicient developer's code. &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica;font-size:-1;"&gt;Here are some good posts for callback technology in ASP.NET 2.0.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica;font-size:-1;"&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/04/08/cuttingedge/"&gt;http://msdn.microsoft.com/msdnmag/issues/04/08/cuttingedge/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.developer.com/net/asp/article.php/3485991"&gt;http://www.developer.com/net/asp/article.php/3485991&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mredkj.com/vbnet/scriptCallback.html"&gt;&lt;br /&gt;http://www.mredkj.com/vbnet/scriptCallback.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;At the core, ASP.NET script callbacks consist of some client-side JavaScript code needed for asynchronous communication to the server. The first requirement for using the callbacks is that some server-side code awaits client calls. The client-side callback intermediary manages the call while the user continues to see the old page and interact with it. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana, Arial, Helvetica;font-size:-1;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-2242969468200691150?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/2242969468200691150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/09/script-callbacks-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2242969468200691150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2242969468200691150'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/09/script-callbacks-in-aspnet.html' title='Script Callbacks in ASP.NET'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1909484574962990288</id><published>2007-09-18T11:04:00.000-07:00</published><updated>2007-11-26T00:43:05.389-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Getting fixed number of rows with SQL Select query</title><content type='html'>&lt;span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 0);font-family:Courier New;font-size:10;"  &gt;The syntax for SQL Server:&lt;br /&gt;SELECT TOP 10 id, name email&lt;br /&gt;FROM  person&lt;br /&gt;&lt;br /&gt;The syntax for MySQL:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 0);font-family:Courier New;font-size:10;"  &gt;SELECT id, name email&lt;br /&gt;FROM  person&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 0);font-family:Courier New;font-size:10;"  &gt;LIMIT 10&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 0);font-family:Courier New;font-size:10;"  &gt;&lt;br /&gt;These examples get the first (top) 10 rows in the query.&lt;br /&gt;&lt;br /&gt;I will describe also the paging technology of the asp.net.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1909484574962990288?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1909484574962990288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/09/getting-fixed-number-of-rows-with-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1909484574962990288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1909484574962990288'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/09/getting-fixed-number-of-rows-with-sql.html' title='Getting fixed number of rows with SQL Select query'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-3017143536967213791</id><published>2007-09-17T15:52:00.000-07:00</published><updated>2008-09-23T01:30:30.729-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Using DataTable (DataView) Filter expressions, Sorting</title><content type='html'>In some cases it is necessary to be made some calculations or data filtering and sorting of local data - already received from a database.  These things can be made with the DataTable or DataView classes in a way similar to SQL Select queries.&lt;br /&gt;When we have a filled DataTable we can easy retrieve only the rows we need with DataView.RowFilter. This property gets or sets the expression used to filter which rows are viewed in the DataView (often used for DataSourse in data components).&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;DataTable dt= ......... //filling the data table&lt;br /&gt;DataView dv= dt.DefaultView;&lt;br /&gt;dv.RowFilter="AreaId="+searchId+" AND SubAreaName LIKE 's*'; //getting all records for searched area whic name starts with 's'&lt;br /&gt;dv.Sort="Name desc, number asc"; //sorting data &lt;br /&gt;&lt;br /&gt;dv.RowFilter = "Name LIKE 's*'"      // values that start with "s"'&lt;br /&gt;dv.RowFilter = "Name LIKE '%s%'"     // values that contain 's'&lt;br /&gt;dv.RowFilter = "Name NOT LIKE 's*'"  // values that don't start with 's'&lt;br /&gt;dv.RowFilter = "Name &lt;&gt; 'MyName'"  // values different than 'MyName'&lt;br /&gt;dv.RowFilter = "Name IN ('MyName','MySecondName')"  // value equal to 'MyName' or 'MySecondName'&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If the pattern string in a LIKE statement contains special characters like * % [ ], they must be escaped in brackets [ ] in this way [*], [%], [[] or []].&lt;br /&gt;&lt;br /&gt;RowFilter is an expression string that can be evaluated to true or false, and uses the syntax described in the &lt;a class="" href="http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx"&gt;DataColumn.Expression&lt;/a&gt; documentation.&lt;br /&gt;&lt;br /&gt;It is very useful to use also aggregate functions for calculation. For example&lt;br /&gt;&lt;pre class="code" id="ctl00_LibFrame_ctl29other" space="preserve"  style="font-family:courier new;"&gt;&lt;span style="font-size:100%;"&gt;dt.Columns("ItemCount").Expression = "Count(ItemID)"&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="code" id="ctl00_LibFrame_ctl29other" space="preserve"  style="font-family:courier new;"&gt;&lt;span style="font-size:100%;"&gt;dt.Columns("ItemCount").Expression = "FirstName = 'John'"   &lt;/span&gt;&lt;/pre&gt;&lt;pre class="code" id="ctl00_LibFrame_ctl29other" space="preserve"  style="font-family:courier new;"&gt;&lt;span style="font-size:100%;"&gt;dt.Columns("ItemCount").Expression = "Date &lt; #1/31/82#" &lt;/span&gt;&lt;/pre&gt;&lt;pre class="code" id="ctl00_LibFrame_ctl29other" space="preserve"  style="font-family:courier new;"&gt;&lt;span style="font-size:100%;"&gt;dt.Columns("ItemCount").Expression = (LastName = 'Smith' OR LastName = 'Jones') AND FirstName = 'John' &lt;/span&gt;&lt;/pre&gt;&lt;pre class="code" id="ctl00_LibFrame_ctl29other" space="preserve"&gt;&lt;br /&gt;Here is the MSDN reference for the filter expressions:&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.expression%28VS.71%29.aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.expression(VS.71).aspx&lt;/a&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-3017143536967213791?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/3017143536967213791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/09/using-datatable-dataview-filter.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3017143536967213791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/3017143536967213791'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/09/using-datatable-dataview-filter.html' title='Using DataTable (DataView) Filter expressions, Sorting'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-9179064627096013081</id><published>2007-09-14T02:36:00.000-07:00</published><updated>2007-09-16T16:31:14.570-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server Express Edition attaching and using problems</title><content type='html'>&lt;span style="font-style: italic;"&gt;"Cannot open user default database. Login failed.&lt;br /&gt;Login failed for user ......"&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;This problem occurs very often while the developer uses Visual Studio and testing in a browser at the same time. The reason is the already opened connection to the database in the VS environment. For example every time when the developer edit DataSet connected to current database this connection stays opened. The solve this problem the connection to the db has to be closed by the right mouse button -&gt; Close Connection in the Server Explorer tab.&lt;br /&gt;&lt;br /&gt;Another problem with attaching database and using its connection is:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"An attempt to attach an auto-named database for file ..... failed. A database with the same name exists, or specified file cannot be Opened, or it is located on UNC share."&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; 1 . The first thing that has to be done is to try to attach the database manually with Microsoft  SQL Server Management Studio.&lt;br /&gt;&lt;br /&gt;2. The data folder permissions have to be set to "Modify" for ASPNET account and NETWORK SERVICE for windows server 2003&lt;br /&gt;&lt;br /&gt;3. Make ASPNET user a member of SQLServer2005MSSQLUser$server$SQLExpress group&lt;br /&gt;&lt;br /&gt;4. Add new Login to the SQL Express server for ASPNET (NETWORK SEVICE) user&lt;br /&gt;&lt;br /&gt;5. In the connection string &lt;span class="v11"&gt;&lt;span id="lblDescription" class="v11"&gt;User Instance=True has to be checked. It works only if SQL Server uses Windows Authentication mode.&lt;br /&gt;Changing the authetication mode can be done by SQL Server Management Studio with right mouse click on the computer name and Properties -&gt; Security.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="v11"&gt;&lt;span id="lblDescription" class="v11"&gt;When Integrated Security=SSPI in the connection string is used make sure you are using &lt;impersonate="true"&gt; in system.web sections of the web.config and also make sure that a windows account for the "Anonymous User" is selected in the access section in IIS.&lt;br /&gt;&lt;br /&gt;6. Also the sql settings in &lt;/impersonate="true"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="v11"&gt;&lt;span id="lblDescription" class="v11"&gt;c:\Documents and Settings\&lt;&lt;username&gt;username&gt;\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\ can be deleted and the sql service restarted.&lt;br /&gt;&lt;br /&gt;&lt;/username&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="v11"&gt;&lt;span id="lblDescription" class="v11"&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-9179064627096013081?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/9179064627096013081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/09/sql-server-express-edition-attaching.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/9179064627096013081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/9179064627096013081'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/09/sql-server-express-edition-attaching.html' title='SQL Server Express Edition attaching and using problems'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-5035751085053941618</id><published>2007-09-12T06:54:00.000-07:00</published><updated>2007-09-12T07:24:31.330-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ASP.NET Request Validation has detected a potentially dangerous client input value</title><content type='html'>This exception occurs when the server meet content containing un-encoded HTML. This is action for preventing script atacks, for example &amp;lt;script&amp;gt; alert("blabla")&amp;lt;/script&amp;gt; can be executed. In this way other harmful code can be executed. The request validation feature of ASP.NET doesn't allow this to be done.&lt;br /&gt;  To disable request validation on a page you must set the &lt;code&gt;validateRequest&lt;/code&gt; attribute of the     Page directive to&lt;span style="font-family:monospace;"&gt; false. &lt;/span&gt;The developer has to ensure that the content is properly encoded.&lt;br /&gt;One more way to disable it is by web.config. You have to set&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;lt;pages validaterequest="false"&amp;gt;&lt;br /&gt;&amp;lt;/pages&amp;gt;&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;The HTML content can be encoded/decoded using the Server.HtmlEncode(string)/Server.HtmlDecode(string) functions.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-5035751085053941618?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/5035751085053941618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/09/aspnet-request-validation-has-detected.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5035751085053941618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5035751085053941618'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/09/aspnet-request-validation-has-detected.html' title='ASP.NET Request Validation has detected a potentially dangerous client input value'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-2362843465477686876</id><published>2007-08-28T13:17:00.000-07:00</published><updated>2007-08-28T13:57:07.067-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><title type='text'>How To: Enable Microsoft ASP.NET Ajax Extension V1.0 on an existing site</title><content type='html'>The fastest way to add ajax fuctionality to your site -&lt;br /&gt;&lt;a href="http://codebetter.com/blogs/jay.kimble/archive/2007/01/26/How-To_3A00_-Enable-Microsoft-ASP.NET-Ajax-Extension-V1.0-_2800_and-Jan.-2007-CTP_2900_-on-an-existing-site-.aspx"&gt;Here&lt;/a&gt; is a good explanation of the process of enabling ajax in an asp.net page.&lt;br /&gt;There is also integeration of CTP on an existing site.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-2362843465477686876?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/2362843465477686876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/08/how-to-enable-microsoft-aspnet-ajax.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2362843465477686876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/2362843465477686876'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/08/how-to-enable-microsoft-aspnet-ajax.html' title='How To: Enable Microsoft ASP.NET Ajax Extension V1.0 on an existing site'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1161854491834833089</id><published>2007-08-28T09:19:00.000-07:00</published><updated>2007-08-28T09:36:25.480-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to delete row in a DataTable with C# or VB.NET</title><content type='html'>When you use a DataRow.Delete() method the row is not actually deleted. It is only marked to be deleted after calling DataTable.AcceptChanges(). It is not good idea to remove row with DataTable.Rows.Remove or RemoveAt methods. They forces row removing and causes by iterating the following exception:&lt;br /&gt;'Collection was modified; enumeration operation may not execute'&lt;br /&gt; One more thing to be sure that the iterating will be performed succesfully is to iterate through returned by DataTable.Select() rows (not DataTable.Rows).&lt;br /&gt;&lt;br /&gt;For Each row As DataRow In dt.Select()&lt;br /&gt; If (bool_statement) Then&lt;br /&gt;  row.Deleted()&lt;br /&gt; Enf IF&lt;br /&gt;Next &lt;br /&gt;&lt;br /&gt;dt.AcceptChanges&lt;br /&gt;&lt;br /&gt;If adapter is used changes can be commited by Update method. All rows with DataRow.RowState of 'Deleted' will be deleted.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1161854491834833089?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1161854491834833089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/08/how-to-delete-row-in-datatable-with-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1161854491834833089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1161854491834833089'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/08/how-to-delete-row-in-datatable-with-c.html' title='How to delete row in a DataTable with C# or VB.NET'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7880946826894900966</id><published>2007-08-22T00:59:00.000-07:00</published><updated>2007-08-22T13:09:58.904-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to use SQL SERVER 2005 with SQL EXPRESS at the same time.</title><content type='html'>Error message received by Visual Studio 2005:&lt;br /&gt;"Connections to sql server files (*.mdf) require sql server express 2005 to function properly"&lt;br /&gt;I had installed Visual Studio 2005 and SQL Server 2005 Developer Edition when I received it. To solve the porblem I installed other instance of SQL Server - Express Edition. But to get VS to work with it I had to change its instance name in the VS options. Tools -&gt; Options - &gt; Database Tools -&gt; Data Connections. Now I can work with the two sql server instances - Developer Edition and Express Edition.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To change an existing instance of Microsoft SQL Server 2005 to a different edition of SQL Server 2005, you must run SQL Server 2005 Setup from the command prompt and include the SKUUPGRADE=1 parameter.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7880946826894900966?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7880946826894900966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/08/how-to-use-sql-server-2005-with-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7880946826894900966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7880946826894900966'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/08/how-to-use-sql-server-2005-with-sql.html' title='How to use SQL SERVER 2005 with SQL EXPRESS at the same time.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-5496126789564801588</id><published>2007-08-21T03:53:00.000-07:00</published><updated>2007-09-21T03:57:44.953-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Checking for existing Javascript variable</title><content type='html'>Somethemes it is necessary to know if the variable is already defined. For example when postback methods which register client script block are used.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;function isSet( v )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    return( typeof( v ) != 'undefined' );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-5496126789564801588?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/5496126789564801588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/08/checking-for-existing-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5496126789564801588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/5496126789564801588'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/08/checking-for-existing-javascript.html' title='Checking for existing Javascript variable'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-8890455724726823798</id><published>2007-08-21T02:13:00.001-07:00</published><updated>2007-08-21T02:28:17.790-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web server'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Default Web Site on IIS doesn't work until changing the default port.</title><content type='html'>It is a very strange problem that occurs sometimes. &lt;br /&gt;"IS Unexpected error 0x8ffe2740"&lt;br /&gt;Today I have just found the reason - Skype is using the default port 80 for alterantive connection.&lt;br /&gt;Resolve that by:&lt;br /&gt;Skype File, Options, Advanced, Connection&lt;br /&gt;Uncheck "Use Port 80 as an alternatives for incoming connections" and restart default website or IIS&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-8890455724726823798?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/8890455724726823798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/08/default-web-site-on-iis-doesnt-work.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8890455724726823798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/8890455724726823798'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/08/default-web-site-on-iis-doesnt-work.html' title='Default Web Site on IIS doesn&apos;t work until changing the default port.'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-215593542904068262</id><published>2007-08-20T23:03:00.000-07:00</published><updated>2007-08-20T23:14:20.132-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to get random number or generate random password with VB.NET or C#</title><content type='html'>The simplest way to get random number is to get instance of the Random class and use the "Next" method.&lt;br /&gt;Dim rand As Random=new Random()&lt;br /&gt;rand.Next() gives you a random nonnegative number&lt;br /&gt;rand.Next(23) gives you a random nonnegative number less than integer value (23 for the example)&lt;br /&gt;rand.Next(23, 89) gives you a random nonnegative number in the specified range&lt;br /&gt;&lt;br /&gt;With this class you can generate also double values and bytes. &lt;br /&gt;&lt;br /&gt;Here is an way for generating random password using guid.&lt;br /&gt;So simple, so effective.&lt;br /&gt;&lt;br /&gt;    Public Function GetRandomPassword(ByVal length As Integer) As String&lt;br /&gt;        Dim rand As String = System.Guid.NewGuid().ToString()&lt;br /&gt;        rand = rand.Replace("-", String.Empty)&lt;br /&gt;&lt;br /&gt;        If length &lt;= 0 OrElse length &gt; rand.Length Then&lt;br /&gt;            Throw New ArgumentException("Length must be between 1 and " &amp;  rand.Length)&lt;br /&gt;        End If&lt;br /&gt;&lt;br /&gt;        Return rand.Substring(0, length)&lt;br /&gt;    End Function&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-215593542904068262?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/215593542904068262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/08/how-to-get-random-number-or-generate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/215593542904068262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/215593542904068262'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/08/how-to-get-random-number-or-generate.html' title='How to get random number or generate random password with VB.NET or C#'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-1156454179600948029</id><published>2007-08-06T02:36:00.000-07:00</published><updated>2008-12-03T04:21:49.170-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Fire Default button on enter on an Asp.NET page</title><content type='html'>I found two ways to get this to work. By Default the first button in the form is the default button. When you push Enter an fire event of this button occur. Current solution is enough to get Login control on asp.net form to work. Here is the code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Dim ctl As Control = Login1.FindControl("LoginLinkButton")&lt;br /&gt;        If Not (ctl Is Nothing) Then&lt;br /&gt;            Login1.Attributes.Add("onKeyPress", "javascript:if (event.keyCode == 13) {__doPostBack('" + ctl.UniqueID + "',''); return false;}")&lt;br /&gt;        End If&lt;br /&gt;&lt;br /&gt;Fix: return false will break the firing of other buttons. Just to ensure right behaviour.&lt;br /&gt;&lt;br /&gt;It works fine for all browsers.&lt;br /&gt;There is one more way to do this but unfortinately it doesn't work with firefox.&lt;br /&gt;&lt;br /&gt;        Login1.Attributes.Add("onkeypress", String.Format("javascript:return WebForm_FireDefaultButton(event, '{0}')", ctl.ClientID))&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-1156454179600948029?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/1156454179600948029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/08/fire-default-button-on-enter-on-aspnet.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1156454179600948029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/1156454179600948029'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/08/fire-default-button-on-enter-on-aspnet.html' title='Fire Default button on enter on an Asp.NET page'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4128767709785759609.post-7517577629911237237</id><published>2007-08-02T08:56:00.001-07:00</published><updated>2008-02-16T04:20:31.905-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Web server'/><title type='text'>How to install PHP on IIS</title><content type='html'>&lt;span style="font-weight:bold;"&gt;PHP installation on IIS 7.0&lt;/span&gt; (Windows VISTA)&lt;br /&gt;I will not explain how to do it, just see this good article:&lt;br /&gt;&lt;a href="http://blondr.blogspot.com/2006/11/set-up-iis-7-w-mysql-and-php-5.html"&gt;http://blondr.blogspot.com/2006/11/set-up-iis-7-w-mysql-and-php-5.html&lt;/a&gt;&lt;br /&gt;It includes also the settings for MySQL and php session' permission. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;PHP installation on IIS 5.1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1) add to path c:\PHP&lt;br /&gt;2) rename php.ini-recomended to php.ini&lt;br /&gt;&lt;br /&gt;doc_root = c:\inetpub\wwwroot // for IIS/PWS&lt;br /&gt;doc_root = c:\apache\htdocs // for Apache&lt;br /&gt;extension_dir = "c:\php\ext"&lt;br /&gt;cgi.force_redirect = 0&lt;br /&gt;set browscap to c:\windows\system32\inetsrv\browscap.ini&lt;br /&gt;&lt;br /&gt;If you want to use the CGI binary, do the following:&lt;br /&gt;&lt;br /&gt;* Under 'Home Directory', 'Virtual Directory', or 'Directory', do the following:&lt;br /&gt;* Change the Execute Permissions to 'Scripts only'&lt;br /&gt;* Click on the 'Configuration' button, and choose the Application Mappings tab. Click Add and set the Executable path to the appropriate CGI file. An example PHP 5 value is: C:\php\php-cgi.exe Supply .php as the extension. Leave 'Method exclusions' blank, and check the 'Script engine' checkbox. Now, click OK a few times.&lt;br /&gt;*&lt;br /&gt;&lt;br /&gt;Set up the appropriate security. (This is done in Internet Service Manager), and if your NT Server uses NTFS file system, add execute rights for I_USR_ to the directory that contains php.exe / php-cgi.exe.&lt;br /&gt;&lt;br /&gt;To use the ISAPI module, do the following:&lt;br /&gt;&lt;br /&gt;* If you don't want to perform HTTP Authentication using PHP, you can (and should) skip this step. Under ISAPI Filters, add a new ISAPI filter. Use PHP as the filter name, and supply a path to the php4isapi.dll / php5isapi.dll.&lt;br /&gt;* Under 'Home Directory', 'Virtual Directory', or 'Directory', do the following:&lt;br /&gt;* Change the Execute Permissions to 'Scripts only'&lt;br /&gt;* Click on the 'Configuration' button, and choose the Application Mappings tab. Click Add and set the Executable path to the appropriate ISAPI DLL. An example PHP 5 value is: C:\php\php5isapi.dll Supply .php as the extension. Leave 'Method exclusions' blank, and check the 'Script engine' checkbox. Now, click OK a few times.&lt;br /&gt;* Stop IIS completely (NET STOP iisadmin)&lt;br /&gt;* Start IIS again (NET START w3svc)&lt;br /&gt;3) add user rights to php directory (IIS user - modify, IUSR_MASNINENAME - read)&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-0846488394782889";
/* 468x60, created 7/8/08 */
google_ad_slot = "9096757012";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4128767709785759609-7517577629911237237?l=w3ka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://w3ka.blogspot.com/feeds/7517577629911237237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://w3ka.blogspot.com/2007/08/how-to-install-php-on-iis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7517577629911237237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4128767709785759609/posts/default/7517577629911237237'/><link rel='alternate' type='text/html' href='http://w3ka.blogspot.com/2007/08/how-to-install-php-on-iis.html' title='How to install PHP on IIS'/><author><name>Plamen Kasabov</name><uri>http://www.blogger.com/profile/01894448905932275574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
