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

<channel>
	<title>programming Archives - MalaysiaSky</title>
	<atom:link href="https://www.malaysiasky.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.malaysiasky.com/category/programming/</link>
	<description>Travel, Coffee, Code</description>
	<lastBuildDate>Thu, 09 Apr 2020 13:49:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.5</generator>

<image>
	<url>https://www.malaysiasky.com/wp-content/uploads/2018/06/favicon.png</url>
	<title>programming Archives - MalaysiaSky</title>
	<link>https://www.malaysiasky.com/category/programming/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Angularjs Dropdown Autocomplete not render</title>
		<link>https://www.malaysiasky.com/angularjs-dropdown-not-rendered-when-data-change/</link>
					<comments>https://www.malaysiasky.com/angularjs-dropdown-not-rendered-when-data-change/#respond</comments>
		
		<dc:creator><![CDATA[tuanshah]]></dc:creator>
		<pubDate>Sat, 14 Mar 2020 14:46:52 +0000</pubDate>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[angular]]></category>
		<guid isPermaLink="false">https://www.malaysiasky.com/?p=1578</guid>

					<description><![CDATA[<p>For AngularJS, we are using md autocomplete  to generate and render our dropdown. The height of dropdown determine automatically during our first load. But if the data is change when we re-select other option(like&#46;&#46;&#46;</p>
<p>The post <a href="https://www.malaysiasky.com/angularjs-dropdown-not-rendered-when-data-change/">Angularjs Dropdown Autocomplete not render</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="aligncenter wp-image-1580 size-full" src="https://www.malaysiasky.com/wp-content/uploads/2020/03/angularjs.png" alt="angularjs" width="225" height="225" srcset="https://www.malaysiasky.com/wp-content/uploads/2020/03/angularjs.png 225w, https://www.malaysiasky.com/wp-content/uploads/2020/03/angularjs-150x150.png 150w, https://www.malaysiasky.com/wp-content/uploads/2020/03/angularjs-160x160.png 160w" sizes="(max-width: 225px) 100vw, 225px" /></p>
<p>For AngularJS, we are using md autocomplete  to generate and render our dropdown. The height of dropdown determine automatically during our first load. But if the data is change when we re-select other option(like data change when using ajax). Sometimes it might be not render completely and you will get height=0</p>
<p>This kind of bug is hunting during our debugging and finally we got solution for this. Way to fix it is we need to tell browser to regenerate that page, or update the size of that dropdown.</p>
<p>Just put this one line of code where action needed.</p>
<p><code>angular.element(window).triggerHandler('resize');</code></p>
<p>&nbsp;</p>
<p>Good Luck. Hopefully this snippet to render autocomplete dropdown in angularjs will help.</p>
<p>For more angularjs complete documentation, please <a href="https://docs.angularjs.org/api/ng/function/angular.element" target="_blank" rel="noopener noreferrer">find here</a></p>
<p>Here some <a href="https://www.malaysiasky.com/category/programming/" target="_blank" rel="noopener noreferrer">post related</a> might be you interested</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://www.malaysiasky.com/angularjs-dropdown-not-rendered-when-data-change/">Angularjs Dropdown Autocomplete not render</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.malaysiasky.com/angularjs-dropdown-not-rendered-when-data-change/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C# Login Form with Active Directory AD</title>
		<link>https://www.malaysiasky.com/csharp-login-with-active-directory-ad/</link>
					<comments>https://www.malaysiasky.com/csharp-login-with-active-directory-ad/#comments</comments>
		
		<dc:creator><![CDATA[tuanshah]]></dc:creator>
		<pubDate>Thu, 22 Dec 2016 04:13:01 +0000</pubDate>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[.net]]></category>
		<guid isPermaLink="false">http://www.malaysiasky.com/?p=722</guid>

					<description><![CDATA[<p>This tutorial will cover how to make login form with Microsoft Active Directory (AD) in simple step with CSharp (C#). As this is common and usual practice for most system nowadays, maybe its will&#46;&#46;&#46;</p>
<p>The post <a href="https://www.malaysiasky.com/csharp-login-with-active-directory-ad/">C# Login Form with Active Directory AD</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This tutorial will cover how to make login form with <a href="https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/active-directory-domain-services" target="_blank" rel="noopener noreferrer">Microsoft Active Directory (AD)</a> in simple step with CSharp (C#). As this is common and usual practice for most system nowadays, maybe its will helping you a bit. Its very simple and straight forward to use Active Directory with login form with .net C#</p>
<div id="attachment_1415" style="width: 510px" class="wp-caption aligncenter"><img decoding="async" aria-describedby="caption-attachment-1415" class="size-full wp-image-1415" src="https://www.malaysiasky.com/wp-content/uploads/2016/12/logo-active-directory.png" alt="Microsoft Active Directory Logo" width="500" height="250" srcset="https://www.malaysiasky.com/wp-content/uploads/2016/12/logo-active-directory.png 500w, https://www.malaysiasky.com/wp-content/uploads/2016/12/logo-active-directory-300x150.png 300w" sizes="(max-width: 500px) 100vw, 500px" /><p id="caption-attachment-1415" class="wp-caption-text">Microsoft Active Directory Logo</p></div>
<p>First, we need this System.DirectoryServices in our code. This is compulsory to make us connect with AD. Call the library System.DirectoryServices</p>
<p><span style="background-color: #e9ebec; color: #222222;">using System.DirectoryServices;</span></p>
<p>In submit form code, we send username and password to Active Directory AD function to retrieve and pair user credential either valid or not</p>
<p><code>[HttpPost]<br />
public ActionResult Login(LoginModel login, string returnUrl)<br />
{<br />
string uname = HttpUtility.HtmlEncode( login.UserName);<br />
login.Password = HttpUtility.HtmlEncode(login.Password);<br />
try<br />
{<br />
string flag = GetActiveDirectoryData(uname, login.Password);<br />
if (flag != null)<br />
{<br />
//code<br />
}else{<br />
//code<br />
}<br />
}<br />
catch (Exception ex)<br />
{<br />
ViewBag.errorMsg = ex.Message;<br />
return View();<br />
}<br />
}<br />
}<br />
</code></p>
<p>This are important part, our Active Directory (AD) service are call from here. Make sure path to LDAP are correct or forever non working. If not sure can contact your sysadmin or awesome server guy for correct path</p>
<p><code>private static string GetActiveDirectoryData(string UserID, string Password)<br />
{<br />
try<br />
{<br />
DirectoryEntry DEntry = new DirectoryEntry("LDAP://path.com", UserID.Trim(), Password);<br />
DirectorySearcher DSearch = new DirectorySearcher(DEntry);<br />
DSearch.Filter = string.Format("(sAMAccountName={0})", UserID.Trim());<br />
SearchResult SResult = DSearch.FindOne();<br />
DirectoryEntry _DEntry = new DirectoryEntry();<br />
try<br />
{<br />
_DEntry.Path = SResult.Path;<br />
}<br />
catch (Exception ex)<br />
{<br />
_DEntry.Close();<br />
_DEntry.Dispose();<br />
throw new Exception(ex);<br />
}<br />
_DEntry.AuthenticationType = AuthenticationTypes.Secure;<br />
_DEntry.Username = string.Format("Domain\\{0}", UserID.Trim());<br />
_DEntry.Password = Password;<br />
string ErrorMsg = "";<br />
string Result = "";<br />
try<br />
{<br />
Result = _DEntry.Username.Replace("Domain\\", "");<br />
}<br />
catch (Exception ex)<br />
{<br />
ErrorMsg = ex.Message;<br />
}<br />
_DEntry.Close();<br />
_DEntry.Dispose();<br />
DEntry.Close();<br />
if (!string.IsNullOrEmpty(ErrorMsg))<br />
{<br />
throw new Exception(ErrorMsg);<br />
}<br />
else<br />
{<br />
return Result;<br />
}</code></p>
<p>}<br />
catch (Exception ex)<br />
{<br />
throw new Exception(&#8220;Username/Password entered is incorrect.&#8221;);<br />
}<br />
}</p>
<p>Thats it. Thats All. Happy coding and i hope this snippet can give you rough idea how to connect your login form with Active Directory (AD) with login form or whatever you want to integrate.</p>
<p>Here also few related <a href="https://www.malaysiasky.com/category/programming/" target="_blank" rel="noopener noreferrer">post that you maybe want to check</a></p>
<p>The post <a href="https://www.malaysiasky.com/csharp-login-with-active-directory-ad/">C# Login Form with Active Directory AD</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.malaysiasky.com/csharp-login-with-active-directory-ad/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>IIS Windows Globalization Permission Denied</title>
		<link>https://www.malaysiasky.com/iis-windows-globalization-permission-denied/</link>
					<comments>https://www.malaysiasky.com/iis-windows-globalization-permission-denied/#respond</comments>
		
		<dc:creator><![CDATA[tuanshah]]></dc:creator>
		<pubDate>Thu, 08 Sep 2016 07:13:37 +0000</pubDate>
				<category><![CDATA[life]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[programm]]></category>
		<guid isPermaLink="false">http://www.malaysiasky.com/?p=422</guid>

					<description><![CDATA[<p>If you facing issue like this, Access to the path &#8216;C:\Windows\Globalization\xx.nlp&#8217; is denied, there are few to check. No worried, most probably is not your code but more to iis and security permission related.&#46;&#46;&#46;</p>
<p>The post <a href="https://www.malaysiasky.com/iis-windows-globalization-permission-denied/">IIS Windows Globalization Permission Denied</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you facing issue like this, Access to the path &#8216;C:\Windows\Globalization\xx.nlp&#8217; is denied, there are few to check. No worried, most probably is not your code but more to iis and security permission related. This post will cover less or more regarding IIS windows globalization permission denied</p>
<h4>Check security for iis_usr. Probably less permission allowed.</h4>
<ul>
<li>Right Click on App Folder &gt; Select Properties</li>
<li>Go to Security Tab</li>
<li>Click Edit &gt; click Add.</li>
<li>Click Location</li>
<li>Select your pc name, usually first item.</li>
<li>Press Ok, then press advance and then Find Now.</li>
<li>Select IIS_ISURS /Authenticated Users.</li>
<li>Click OK</li>
<li>Assign full control for new user</li>
<li>Click OK</li>
</ul>
<h4>Re-install asp.net regiis -i</h4>
<ul>
<li>Open command prompt (cmd)</li>
<li>Type: cd C:\Windows\Microsoft.NET\Framework\v4.0.30319</li>
<li>Type: aspnet_regiis -i</li>
<li>Wait till installation done</li>
</ul>
<h4>Check iis setup</h4>
<ul>
<li>Click start &gt; Control Panel &gt; Programs &gt; Turn Windows Feature On And Off &gt; Internet Information Services</li>
<li>Thick as per below image</li>
</ul>
<p>&nbsp;</p>
<div id="attachment_432" style="width: 510px" class="wp-caption aligncenter"><img decoding="async" aria-describedby="caption-attachment-432" class="wp-image-432 size-full" src="http://www.malaysiasky.com/wp-content/uploads/2016/09/iis.png" alt="iis" width="500" height="365" srcset="https://www.malaysiasky.com/wp-content/uploads/2016/09/iis.png 500w, https://www.malaysiasky.com/wp-content/uploads/2016/09/iis-300x219.png 300w" sizes="(max-width: 500px) 100vw, 500px" /><p id="caption-attachment-432" class="wp-caption-text">thick these checkbox</p></div>
<div id="attachment_433" style="width: 510px" class="wp-caption aligncenter"><img decoding="async" aria-describedby="caption-attachment-433" class="wp-image-433 size-full" src="http://www.malaysiasky.com/wp-content/uploads/2016/09/iis2.png" alt="iis2" width="500" height="362" srcset="https://www.malaysiasky.com/wp-content/uploads/2016/09/iis2.png 500w, https://www.malaysiasky.com/wp-content/uploads/2016/09/iis2-300x217.png 300w" sizes="(max-width: 500px) 100vw, 500px" /><p id="caption-attachment-433" class="wp-caption-text">thick these checkbox cont..</p></div>
<div id="attachment_434" style="width: 510px" class="wp-caption aligncenter"><img decoding="async" aria-describedby="caption-attachment-434" class="wp-image-434 size-full" src="http://www.malaysiasky.com/wp-content/uploads/2016/09/iis3.png" alt="iis3" width="500" height="504" srcset="https://www.malaysiasky.com/wp-content/uploads/2016/09/iis3.png 500w, https://www.malaysiasky.com/wp-content/uploads/2016/09/iis3-150x150.png 150w, https://www.malaysiasky.com/wp-content/uploads/2016/09/iis3-298x300.png 298w" sizes="(max-width: 500px) 100vw, 500px" /><p id="caption-attachment-434" class="wp-caption-text">thick these checkbox cont&#8230;&#8230;</p></div>
<p>&nbsp;</p>
<h4>Still Having Problem?</h4>
<p>Open IIS &gt; Application Pools &gt; <em>Your Pool Name</em> &gt; Advance Setting</p>
<p>&nbsp;</p>
<div id="attachment_805" style="width: 459px" class="wp-caption aligncenter"><img decoding="async" aria-describedby="caption-attachment-805" class="wp-image-805 size-full" src="https://www.malaysiasky.com/wp-content/uploads/2016/09/iis-pool-setting.png" alt="In General , Change Enable 32-Bit Application to True" width="449" height="552" srcset="https://www.malaysiasky.com/wp-content/uploads/2016/09/iis-pool-setting.png 449w, https://www.malaysiasky.com/wp-content/uploads/2016/09/iis-pool-setting-244x300.png 244w" sizes="(max-width: 449px) 100vw, 449px" /><p id="caption-attachment-805" class="wp-caption-text">In General , Change Enable 32-Bit Application to True</p></div>
<p>&nbsp;</p>
<div id="attachment_806" style="width: 462px" class="wp-caption aligncenter"><img decoding="async" aria-describedby="caption-attachment-806" class="wp-image-806 size-full" src="https://www.malaysiasky.com/wp-content/uploads/2016/09/iis-pool.png" alt="Set Identity in Process Model to LocalSystem" width="452" height="554" srcset="https://www.malaysiasky.com/wp-content/uploads/2016/09/iis-pool.png 452w, https://www.malaysiasky.com/wp-content/uploads/2016/09/iis-pool-245x300.png 245w" sizes="(max-width: 452px) 100vw, 452px" /><p id="caption-attachment-806" class="wp-caption-text">Set Identity in Process Model to LocalSystem</p></div>
<p>Hopefully, this post regarding issue with IIS windows globalization permission denied will help to solve the problem</p>
<p>Here are <a href="https://www.malaysiasky.com/category/programming/" target="_blank" rel="noopener noreferrer">few related post you might be interesting</a></p>
<p>The post <a href="https://www.malaysiasky.com/iis-windows-globalization-permission-denied/">IIS Windows Globalization Permission Denied</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.malaysiasky.com/iis-windows-globalization-permission-denied/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Sitefinity Create New Field with Module Builder</title>
		<link>https://www.malaysiasky.com/sitefinity-create-new-field-with-module-builder/</link>
					<comments>https://www.malaysiasky.com/sitefinity-create-new-field-with-module-builder/#respond</comments>
		
		<dc:creator><![CDATA[tuanshah]]></dc:creator>
		<pubDate>Sat, 03 Sep 2016 15:01:20 +0000</pubDate>
				<category><![CDATA[life]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[module builder]]></category>
		<category><![CDATA[sitefinity]]></category>
		<category><![CDATA[telerik]]></category>
		<guid isPermaLink="false">http://www.malaysiasky.com/?p=407</guid>

					<description><![CDATA[<p>Issue When i create new field using module builder with Sitefinity CMS, the sync server become restart when sync data is triggered. What I do Method 1 Create field in publishing server using module builder&#46;&#46;&#46;</p>
<p>The post <a href="https://www.malaysiasky.com/sitefinity-create-new-field-with-module-builder/">Sitefinity Create New Field with Module Builder</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h4>Issue</h4>
<p>When i create new field using module builder with <a href="https://www.progress.com/sitefinity-cms" target="_blank" rel="noopener noreferrer">Sitefinity CMS</a>, the sync server become restart when sync data is triggered.</p>
<h4>What I do</h4>
<h6>Method 1</h6>
<ol>
<li>Create field in publishing server using module builder</li>
<li>Create another field in sync server using the same step and naming</li>
</ol>
<h6>Method 2</h6>
<ol>
<li>Copy all config from publishing and deploy at sync server, issue still happened when try to sync data.</li>
</ol>
<h4>Its time to ask and get help from Telerik Expert</h4>
<p>They come out using these method to fix the issue.</p>
<ol>
<li>Delete new field in sync server</li>
<li>Export new field setting and config at publishing server. Its to make sure all id created in publishing server are same when import into sync server</li>
<li>Import back the configuration to sync server</li>
<li>No more restart occur when sync triggered.</li>
</ol>
<h4>What really happened</h4>
<p>Error was triggered because when sync happened, it read both new field in publishing and sync server which are happend different <em>id</em>. Thats why its read as new data method when sync. I hope this post regarding creating new field with sitefinity cms module builder will help someone who facing same problem with me.</p>
<div id="attachment_1364" style="width: 510px" class="wp-caption aligncenter"><img decoding="async" aria-describedby="caption-attachment-1364" class="size-full wp-image-1364" src="https://www.malaysiasky.com/wp-content/uploads/2016/09/sitefinitycms-e1567758411980.jpg" alt="sitefinity cms" width="500" height="281" /><p id="caption-attachment-1364" class="wp-caption-text">sitefinity cms img from official progress site</p></div>
<p>There also few <a href="https://www.malaysiasky.com/category/programming/" target="_blank" rel="noopener noreferrer">programming post that might interested you here</a></p>
<p>The post <a href="https://www.malaysiasky.com/sitefinity-create-new-field-with-module-builder/">Sitefinity Create New Field with Module Builder</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.malaysiasky.com/sitefinity-create-new-field-with-module-builder/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Security Programming in .Net</title>
		<link>https://www.malaysiasky.com/security-programming-in-net/</link>
					<comments>https://www.malaysiasky.com/security-programming-in-net/#respond</comments>
		
		<dc:creator><![CDATA[tuanshah]]></dc:creator>
		<pubDate>Mon, 09 May 2016 07:43:39 +0000</pubDate>
				<category><![CDATA[life]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[secure programming]]></category>
		<category><![CDATA[security programming]]></category>
		<guid isPermaLink="false">http://www.malaysiasky.com/?p=325</guid>

					<description><![CDATA[<p>These are few tips how to add security programming in  .net app on code level. Asp.net Version Disclosure &#60;system.web&#62; &#60;httpRuntime  enableVersionHeader="false" /&#62; &#60;/system.web&#62; Set Cookie to HttpOnly &#60;system.web&#62; &#60;httpCookies httpOnlyCookies="true"/&#62; &#60;/system.web&#62; Set Custom Error&#46;&#46;&#46;</p>
<p>The post <a href="https://www.malaysiasky.com/security-programming-in-net/">Security Programming in .Net</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div id="attachment_1372" style="width: 510px" class="wp-caption aligncenter"><img decoding="async" aria-describedby="caption-attachment-1372" class="wp-image-1372 size-full" src="https://www.malaysiasky.com/wp-content/uploads/2016/05/security-key.jpg" alt="security programming in .net" width="500" height="308" srcset="https://www.malaysiasky.com/wp-content/uploads/2016/05/security-key.jpg 500w, https://www.malaysiasky.com/wp-content/uploads/2016/05/security-key-300x185.jpg 300w" sizes="(max-width: 500px) 100vw, 500px" /><p id="caption-attachment-1372" class="wp-caption-text">security image taken from zend.com</p></div>
<p>These are few tips how to add security programming in  .net app on code level.</p>
<p><strong>Asp.net Version Disclosure</strong></p>
<pre>&lt;system.web&gt;
&lt;httpRuntime  enableVersionHeader="<strong>false</strong>" /&gt;
&lt;/system.web&gt;
</pre>
<p><strong>Set Cookie to HttpOnly</strong></p>
<pre>&lt;system.web&gt;
&lt;httpCookies httpOnlyCookies="<strong>true</strong>"/&gt;
&lt;/system.web&gt;
</pre>
<p><strong>Set Custom Error</strong></p>
<pre>&lt;system.web&gt;
&lt;customErrors mode="On" defaultRedirect="<strong>~/Controller/ErrorPage</strong>"&gt;&lt;/customErrors&gt;
&lt;/system.web&gt;
</pre>
<p><strong>Custom Error Disabled</strong></p>
<pre>&lt;system.web&gt;
&lt;customErrors mode="<strong>RemoteOnly</strong>"&gt;
&lt;/system.web&gt;</pre>
<p><strong>Leaving Tracing Enabled in Web-Based Applications</strong></p>
<pre>&lt;system.web&gt; 
&lt;trace enabled="<strong>false</strong>" localOnly="<strong>true</strong>"&gt;
&lt;/system.web&gt;</pre>
<p><strong>Disabled Debugging</strong></p>
<pre>&lt;system.web&gt; 
&lt;compilation debug="<strong>false</strong>"&gt;
&lt;/system.web&gt;
</pre>
<p><strong>Disabled Cookieless Session States</strong></p>
<pre>&lt;system.web&gt; 
&lt;sessionState cookieless="<strong>UseCookies</strong>"&gt; 
&lt;/system.web&gt;</pre>
<p><strong>Input Validation : </strong> A set of controls that verify the properties of all input data matches what is expected by the application including types, lengths, ranges, acceptable character sets and does not include known hazardous characters.</p>
<p>If any potentially hazardous characters must be allowed as input, be sure that you implement additional controls like output encoding, secure task specific APIs and accounting for the utilization of that data throughout the application . Examples of common hazardous characters include: &lt; &gt; &#8221; &#8216; % ( ) &amp; + \ \&#8217; \&#8221;</p>
<p><strong>Output Encoding</strong></p>
<ol>
<li>Encode all characters unless they are known to be safe for the intended interpreter</li>
<li>Contextually sanitize all output of un-trusted data to queries for SQL, XML, and LDAP</li>
<li>Sanitize all output of un-trusted data to operating system commands</li>
</ol>
<p><strong>Error Handling and Logging</strong></p>
<ol>
<li>Do not disclose sensitive information in error responses, including system details, session identifiers or account information</li>
<li>Use error handlers that do not display debugging or stack trace information</li>
<li>Implement generic error messages and use custom error pages</li>
</ol>
<p><strong>Database Security</strong></p>
<ol>
<li>Use strongly typed parameterized queries</li>
<li>Utilize input validation and output encoding and be sure to address meta characters. If these fail, do not run the database command</li>
<li>Ensure that variables are strongly typed</li>
</ol>
<p><strong>HTML Entity Encode</strong>: The process of replacing certain ASCII characters with their HTML entity equivalents. For example, encoding would replace the less than character &#8220;&lt;&#8221; with the HTML equivalent &#8220;&lt;&#8220;. HTML entities are &#8216;inert&#8217; in most interpreters, especially browsers, which can mitigate certain client side attacks.</p>
<p><strong>Prevent ClickJacking</strong><br />
<strong>More Info:</strong></p>
<p><a href="https://www.owasp.org/index.php/OWASP_Secure_Coding_Practices_-_Quick_Reference_Guide">https://www.owasp.org/index.php/OWASP_Secure_Coding_Practices_-_Quick_Reference_Guide</a></p>
<p><a href="https://www.owasp.org/index.php/Secure_Coding_Cheat_Sheet">https://www.owasp.org/index.php/Secure_Coding_Cheat_Sheet</a></p>
<p>Hopefully these few tips can be apply to improve security in  programming especially in .net</p>
<p>Here also few <a href="https://www.malaysiasky.com/category/programming/" target="_blank" rel="noopener noreferrer">post regarding programming that you might interested</a></p>
<p>The post <a href="https://www.malaysiasky.com/security-programming-in-net/">Security Programming in .Net</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.malaysiasky.com/security-programming-in-net/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Jquery Validation Required Multiple Condition</title>
		<link>https://www.malaysiasky.com/jquery-validation-required-multiple-condition/</link>
					<comments>https://www.malaysiasky.com/jquery-validation-required-multiple-condition/#respond</comments>
		
		<dc:creator><![CDATA[tuanshah]]></dc:creator>
		<pubDate>Sun, 17 Apr 2016 03:57:32 +0000</pubDate>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery validation]]></category>
		<category><![CDATA[multiple required]]></category>
		<guid isPermaLink="false">http://www.malaysiasky.com/?p=272</guid>

					<description><![CDATA[<p>This is snippet for how to set rules if you have few condition for error message. Example when user select value1, required is true but when user select value2, required is false &#160; Set&#46;&#46;&#46;</p>
<p>The post <a href="https://www.malaysiasky.com/jquery-validation-required-multiple-condition/">Jquery Validation Required Multiple Condition</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is snippet for how to set rules if you have few condition for error message. Example when user select value1, required is true but when user select value2, required is false</p>
<p>&nbsp;</p>
<p><strong>Set condition</strong></p>
<pre> phone: {
   required: function (element) {
     if($("selector").val() == 'value') {
     return true;
     }
     else {
     return false;
     }
 },
 minlength: 6
 },
</pre>
<p>&nbsp;</p>
<p><strong>Set error message</strong></p>
<pre> phone: {
  required: "phone number is required",
  minlength: "please key in atleast 6 digit"
 }
</pre>
<p>Here also few related <a href="https://www.malaysiasky.com/category/programming/" target="_blank" rel="noopener noreferrer">post that might interested you</a></p>
<p>The post <a href="https://www.malaysiasky.com/jquery-validation-required-multiple-condition/">Jquery Validation Required Multiple Condition</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.malaysiasky.com/jquery-validation-required-multiple-condition/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Jquery Validation File Upload</title>
		<link>https://www.malaysiasky.com/jquery-validation-file-upload/</link>
					<comments>https://www.malaysiasky.com/jquery-validation-file-upload/#respond</comments>
		
		<dc:creator><![CDATA[tuanshah]]></dc:creator>
		<pubDate>Tue, 05 Apr 2016 07:41:32 +0000</pubDate>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[checking file upload]]></category>
		<category><![CDATA[file upload require false]]></category>
		<category><![CDATA[jquery validation file upload]]></category>
		<guid isPermaLink="false">http://www.malaysiasky.com/?p=171</guid>

					<description><![CDATA[<p>Code snippet below are for jquery validation file upload which file is not required, but when file is chosen, we need to check extension and size jQuery.validator.addMethod("accept", function (value, element, param) { return value.match(new RegExp("."&#46;&#46;&#46;</p>
<p>The post <a href="https://www.malaysiasky.com/jquery-validation-file-upload/">Jquery Validation File Upload</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Code snippet below are for jquery validation file upload which file is not required, but when file is chosen, we need to check extension and size</p>
<pre>jQuery.validator.addMethod("accept", function (value, element, param) 
{
   return value.match(new RegExp("." + param + "$"));
});

  $("input[type=file]").on("blur", function () {
        $("input[type=file]").each(function () {
         if ($(this).val() != '') {
             $(this).rules("add", {
              filesize: "1000000"
              accept: "png|jpe?g|doc|xls|ppt|docx|xlsx|pptx|pdf|tif|gif|bmp",
              required: false,
              messages: {
                    accept: "extension not allowed",
                    filesize: "file is too big"
                            
                        }
                    });
                }
            });
        });

        $("input[type=file]").valid(); //to trigger message automatically
</pre>
<p>The post <a href="https://www.malaysiasky.com/jquery-validation-file-upload/">Jquery Validation File Upload</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.malaysiasky.com/jquery-validation-file-upload/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Read, Write and Append File Amazon AWS S3</title>
		<link>https://www.malaysiasky.com/read-write-append-file-aws-s3/</link>
					<comments>https://www.malaysiasky.com/read-write-append-file-aws-s3/#comments</comments>
		
		<dc:creator><![CDATA[tuanshah]]></dc:creator>
		<pubDate>Thu, 31 Mar 2016 07:20:01 +0000</pubDate>
				<category><![CDATA[life]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Amazon AWS S3]]></category>
		<category><![CDATA[append file in AWS S3]]></category>
		<category><![CDATA[C# write file in AWS S3]]></category>
		<category><![CDATA[create file in Amazon AWS S3]]></category>
		<category><![CDATA[read file in Amazon AWS S3]]></category>
		<category><![CDATA[write file in Amazon AWS S3]]></category>
		<guid isPermaLink="false">http://www.malaysiasky.com/?p=148</guid>

					<description><![CDATA[<p>&#160; The problem are we need to append text and contain in the file directly. As AWS S3 does not support these function yet, not like local System.IO append file, so i came out&#46;&#46;&#46;</p>
<p>The post <a href="https://www.malaysiasky.com/read-write-append-file-aws-s3/">Read, Write and Append File Amazon AWS S3</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div id="attachment_213" style="width: 510px" class="wp-caption aligncenter"><img decoding="async" aria-describedby="caption-attachment-213" class="wp-image-213 size-full" src="https://www.malaysiasky.com/wp-content/uploads/2016/03/AmazonWebservices_Logo.svg_-e1567758918492.png" alt="Amazon Web Services Logo" width="500" height="200" /><p id="caption-attachment-213" class="wp-caption-text">Amazon Web Services Logo</p></div>
<p>&nbsp;</p>
<p>The problem are we need to append text and contain in the file directly. As AWS S3 does not support these function yet, not like local System.IO append file, so i came out this solution. Im using these more for logging purpose so thats why i need to read, write and append file in Amazon AWS S3 directly so all my logging keep increase directly in AWS S3 bucket.</p>
<p>First step is read the file, if not exist yet, create the file, create content and save in AWS S3</p>
<p>if file already exist, read the file(not download), get the response, append with new content, and save it back to AWS S3. Which it will replace with the latest.</p>
<p>So, these are snippet how to append file in Amazon S3 Bucket. Hoping will help you and actually is for my future reference.</p>
<p><strong>Create File</strong><br />
To create file, we use <span style="text-decoration: underline;">PutObjectRequest().</span> Here code snippet</p>
<pre>var client = new AmazonS3Client("accessKeyId", "secretKey", "regionEndpoint");
S3FileInfo s3fileinfo = new Amazon.S3.IO.S3FileInfo(client, bucketName, fileName);

  PutObjectRequest request = new PutObjectRequest();
  request.BucketName ="your-bucket-name";
  request.Key= "your-file-name";
  request.ContentType = "text/plain";
  request.ContentBody = "hello world";
  client.PutObject(request);</pre>
<p>&nbsp;</p>
<p><strong>Read File</strong><br />
To read file, we use <span style="text-decoration: underline;">GetObjectRequest.</span> Here code snippet</p>
<pre>GetObjectRequest xrequest = new GetObjectRequest
 {
 BucketName = "your-bucket-name",
 Key = "your-file-name"
 };

 GetObjectResponse response = client.GetObject(xrequest);
 Stream responseStream = response.ResponseStream;
 StreamReader reader = new StreamReader(responseStream);
  {
   responseBody = reader.ReadToEnd() + Environment.NewLine ;
   client.PutObject(request);
  }
</pre>
<p>&nbsp;</p>
<p><strong>Write and Append File</strong><br />
To write and append, we read the file, get the response and <span style="text-decoration: underline;">concat</span> all string include new string. Here code snippet</p>
<pre>request.ContentBody = string.Concat(responseBody, "new line of hello world");
client.PutObject(request);</pre>
<p>&nbsp;</p>
<p><strong>Full Code Snippet</strong></p>
<p>&nbsp;</p>
<pre>PutObjectRequest request = new PutObjectRequest();

request.BucketName = "your-bucket-name";
request.Key= "your-file-name";
request.ContentType = "text/plain";

var client = new AmazonS3Client("accessKeyId", "secretKey", "regionEndpoint");

S3FileInfo s3fileinfo = new Amazon.S3.IO.S3FileInfo(client, bucketName, fileName);
if (s3fileinfo.Exists) // checking if file exist
 {
 string responseBody = "";
  {
   GetObjectRequest xrequest = new GetObjectRequest
     {
       BucketName = bucketName,
       Key = fileName
     };

    GetObjectResponse response = client.GetObject(xrequest);
    Stream responseStream = response.ResponseStream;
    StreamReader reader = new StreamReader(responseStream);
     {
     responseBody = reader.ReadToEnd() + Environment.NewLine ;

     request.ContentBody = string.Concat(responseBody, "new line of hello world");
     client.PutObject(request); 
     }
  }
 }
 else
 {
 request.ContentBody = "new content";
 client.PutObject(request);
 }</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I&#8217;m refer these two amazing url and tutorial during my coding for this so i able to coming out with the code. Hopefully this code snippet can help to solve problem in how to read, write or append file in AWS S3 directly</p>
<p><a href="http://docs.ceph.com/docs/hammer/radosgw/s3/csharp/" target="_blank" rel="noopener noreferrer">http://docs.ceph.com/</a></p>
<blockquote class="wp-embedded-content" data-secret="NNMKqvHi00"><p><a href="https://dotnetcodr.com/2015/01/19/using-amazon-s3-with-the-aws-net-api-part-6-s3-in-big-data-ii/">Using Amazon S3 with the AWS.NET API Part 6: S3 in Big Data&nbsp;II</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Using Amazon S3 with the AWS.NET API Part 6: S3 in Big Data&nbsp;II&#8221; &#8212; Exercises in .NET with Andras Nemes" src="https://dotnetcodr.com/2015/01/19/using-amazon-s3-with-the-aws-net-api-part-6-s3-in-big-data-ii/embed/#?secret=VI6vssL32J#?secret=NNMKqvHi00" data-secret="NNMKqvHi00" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>There also some <a href="https://www.malaysiasky.com/category/programming/" target="_blank" rel="noopener noreferrer">programming post that you might be interested</a></p>
<p>The post <a href="https://www.malaysiasky.com/read-write-append-file-aws-s3/">Read, Write and Append File Amazon AWS S3</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.malaysiasky.com/read-write-append-file-aws-s3/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>Moving Pacman in Pure CSS3</title>
		<link>https://www.malaysiasky.com/moving-pacman-in-pure-css3/</link>
					<comments>https://www.malaysiasky.com/moving-pacman-in-pure-css3/#respond</comments>
		
		<dc:creator><![CDATA[tuanshah]]></dc:creator>
		<pubDate>Tue, 23 Feb 2016 07:43:30 +0000</pubDate>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[pacman]]></category>
		<guid isPermaLink="false">http://www.malaysiasky.com/?p=106</guid>

					<description><![CDATA[<p>Below example are moving pacman created with fully pure in css3 and HTML5. ﻿ So far this pacman write with two vendor prefix Mozilla and webkit. So please open with these two browser only.&#46;&#46;&#46;</p>
<p>The post <a href="https://www.malaysiasky.com/moving-pacman-in-pure-css3/">Moving Pacman in Pure CSS3</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Below example are moving pacman created with fully pure in css3 and HTML5.</p>
<p><iframe loading="lazy" src="https://www.malaysiasky.com/project/pacman.html" width="1000" height="200"><span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start">﻿</span></iframe></p>
<p>So far this pacman write with two vendor prefix <a href="https://www.mozilla.org/en-US/" target="_blank" rel="noopener noreferrer">Mozilla</a> and <a href="https://webkit.org/" target="_blank" rel="noopener noreferrer">webkit</a>. So please open with these two browser only. You can add other prefix by yourself.</p>
<h4>HTML</h4>
<blockquote><p>&lt;body&gt;<br />
&lt;div class=&#8221;pacman&#8221;&gt;<br />
&lt;div class=&#8221;mouthUp&#8221;&gt;<br />
&lt;div class=&#8221;eye&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&#8221;mouthDown&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>&lt;div class=&#8221;food&#8221;&gt;<br />
&lt;div class=&#8221;dot1&#8243;&gt;&lt;/div&gt;<br />
&lt;div class=&#8221;dot2&#8243;&gt;&lt;/div&gt;<br />
&lt;div class=&#8221;dot3&#8243;&gt;&lt;/div&gt;<br />
&lt;div class=&#8221;dot4&#8243;&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;</p></blockquote>
<p>&nbsp;</p>
<h4>CSS</h4>
<blockquote><p>&lt;style&gt;<br />
.food{<br />
top:50px;<br />
left:100px;<br />
width: 700px;<br />
height:30px;<br />
position:absolute;<br />
}<br />
.dot1, .dot2, .dot3, .dot4{<br />
background: #000 ;<br />
width:30px;<br />
height:30px;<br />
border-radius:20px;<br />
margin:0 70px 0 33px;<br />
display: inline-block;</p>
<p>}</p>
<p>.dot1{<br />
-moz-animation: habisFood 9s infinite;<br />
-webkit-animation: habisFood 9s infinite;<br />
}</p>
<p>.dot2{<br />
-moz-animation: habisFood2 9s infinite;<br />
-webkit-animation: habisFood2 9s infinite;<br />
}<br />
.dot3{<br />
-moz-animation: habisFood3 9s infinite;<br />
-webkit-animation: habisFood3 9s infinite;</p>
<p>}<br />
.dot4{<br />
-moz-animation: habisFood4 9s infinite;<br />
-webkit-animation: habisFood4 9s infinite;<br />
}</p>
<p>.pacman{<br />
position: absolute;<br />
width: 0px;<br />
height: 0px;<br />
border-right: 60px solid transparent;<br />
border-top: 60px solid red;<br />
border-left: 60px solid red;<br />
border-bottom: 60px solid red;<br />
border-top-left-radius: 60px;<br />
border-top-right-radius: 60px;<br />
border-bottom-left-radius: 60px;<br />
border-bottom-right-radius: 60px;<br />
-moz-animation: startEat 9s infinite;<br />
-webkit-animation: startEat 9s infinite;<br />
}</p>
<p>.mouthUp{<br />
position: absolute;<br />
left:-60px;<br />
top:-60px;<br />
width: 0px;<br />
height: 0px;<br />
border-right: 60px solid red;<br />
border-top: 60px solid transparent;<br />
border-left: 60px solid transparent;<br />
border-bottom: 60px solid transparent;<br />
border-top-right-radius: 60px;<br />
border-bottom-right-radius: 60px;<br />
-moz-transform:rotateZ(-90deg);<br />
-moz-animation: UpMouth 1s infinite;<br />
-webkit-transform:rotateZ(-90deg);<br />
-webkit-animation: UpMouth 1s infinite;<br />
}</p>
<p>.mouthDown{<br />
position: absolute;<br />
left:-60px;<br />
top:-60px;<br />
width: 0px;<br />
height: 0px;<br />
border-right: 60px solid red;<br />
border-top: 60px solid transparent;<br />
border-left: 60px solid transparent;<br />
border-bottom: 60px solid transparent;<br />
border-top-right-radius: 60px;<br />
border-bottom-right-radius: 60px;<br />
-moz-transform:rotateZ(84deg);<br />
-moz-animation: DownMouth 1s infinite;<br />
-webkit-transform:rotateZ(84deg);<br />
-webkit-animation: DownMouth 1s infinite;<br />
}</p>
<p>.eye{<br />
background: #FFF;<br />
width:10px;<br />
height:10px;<br />
position: absolute;<br />
top:-10px;<br />
left:34px;<br />
border-radius:3px;<br />
}<br />
@-moz-keyframes UpMouth{<br />
to{<br />
-moz-transform:rotateZ(-45deg);<br />
-webkit-transform:rotateZ(-45deg);<br />
}<br />
}</p>
<p>@-moz-keyframes DownMouth{<br />
to{<br />
-moz-transform: rotateZ(45deg);<br />
}<br />
}</p>
<p>@-webkit-keyframes DownMouth{<br />
to{<br />
-webkit-transform: rotateZ(45deg);<br />
}<br />
}</p>
<p>@-moz-keyframes startEat{<br />
from{<br />
left: 0px;<br />
}<br />
to{<br />
left: 700px;<br />
}<br />
}</p>
<p>@-webkit-keyframes startEat{<br />
from{<br />
left: 0px;<br />
}<br />
to{<br />
left: 700px;<br />
}<br />
}</p>
<p>@-moz-keyframes habisFood{<br />
0%{<br />
opacity: 1;<br />
}<br />
7%{<br />
opacity:0;<br />
}<br />
90%{<br />
opacity:0;<br />
}<br />
}</p>
<p>@-webkit-keyframes habisFood{<br />
0%{<br />
opacity: 1;<br />
}<br />
7%{<br />
opacity:0;<br />
}<br />
90%{<br />
opacity:0;<br />
}<br />
}<br />
@-moz-keyframes habisFood2{<br />
0%{<br />
opacity: 1;<br />
}<br />
15%{<br />
opacity: 1;<br />
}<br />
25%{<br />
opacity:0;<br />
}<br />
90%{<br />
opacity:0;<br />
}<br />
}</p>
<p>@-webkit-keyframes habisFood2{<br />
0%{<br />
opacity: 1;<br />
}<br />
15%{<br />
opacity: 1;<br />
}<br />
25%{<br />
opacity:0;<br />
}<br />
90%{<br />
opacity:0;<br />
}<br />
}<br />
@-moz-keyframes habisFood3{<br />
0%{<br />
opacity: 1;<br />
}<br />
15%{<br />
opacity: 1;<br />
}<br />
28%{<br />
opacity:1;<br />
}<br />
32%{<br />
opacity:0;<br />
}<br />
90%{<br />
opacity:0;<br />
}<br />
}</p>
<p>@-webkit-keyframes habisFood3{<br />
0%{<br />
opacity: 1;<br />
}<br />
15%{<br />
opacity: 1;<br />
}<br />
28%{<br />
opacity:1;<br />
}<br />
32%{<br />
opacity:0;<br />
}<br />
90%{<br />
opacity:0;<br />
}<br />
}</p>
<p>@-moz-keyframes habisFood4{<br />
0%{<br />
opacity: 1;<br />
}<br />
15%{<br />
opacity: 1;<br />
}<br />
38%{<br />
opacity:1;<br />
}<br />
40%{<br />
opacity:0;<br />
}<br />
90%{<br />
opacity:0;<br />
}<br />
}</p>
<p>@-webkit-keyframes habisFood4{<br />
0%{<br />
opacity: 1;<br />
}<br />
15%{<br />
opacity: 1;<br />
}<br />
38%{<br />
opacity:1;<br />
}<br />
40%{<br />
opacity:0;<br />
}<br />
90%{<br />
opacity:0;<br />
}<br />
}<br />
&lt;/style&gt;</p></blockquote>
<p>Hopefully this snippet code on how to create moving pacman using pure CSS3 and HTML5 only can help you</p>
<p>Here also <a href="https://www.malaysiasky.com/category/programming/" target="_blank" rel="noopener noreferrer">few other relate post</a> that might interested you</p>
<p>The post <a href="https://www.malaysiasky.com/moving-pacman-in-pure-css3/">Moving Pacman in Pure CSS3</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.malaysiasky.com/moving-pacman-in-pure-css3/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to change placeholder color with css</title>
		<link>https://www.malaysiasky.com/how-to-change-placeholder-color-with-css/</link>
					<comments>https://www.malaysiasky.com/how-to-change-placeholder-color-with-css/#respond</comments>
		
		<dc:creator><![CDATA[tuanshah]]></dc:creator>
		<pubDate>Thu, 07 Jan 2016 08:34:00 +0000</pubDate>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[placeholder]]></category>
		<guid isPermaLink="false"></guid>

					<description><![CDATA[<p>By default, if you put placeholder, the color is grey, but can we change it to our desire color? yes we can. Since this is HTML5 attribute , so vendor prefix still required at&#46;&#46;&#46;</p>
<p>The post <a href="https://www.malaysiasky.com/how-to-change-placeholder-color-with-css/">How to change placeholder color with css</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>By default, if you put placeholder, the color is grey, but can we change it to our desire color?<br />
yes we can.<br />
Since this is HTML5 attribute , so vendor prefix still required at this time<br />
example.</p>
<p><code>&lt;input type="text" placeholder="placeholder default input"&gt;<br />
</code></p>
<p>what we get is like this</p>
<div style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" /></a></div>
<p><img decoding="async" class="alignnone size-full wp-image-20" src="http://malaysiasky.com/malaysiasky/wp-content/uploads/2016/01/placeholder-default-1.png" alt="placeholder-default" width="299" height="200" /></p>
<p>So, how we gonna do change placehodler color? how we can change it to our desire color?</p>
<p>here are the CSS</p>
<p><code>::-webkit-input-placeholder {<br />
color: green;<br />
}<br />
:-moz-placeholder { /* Firefox 18- */<br />
color: green;<br />
}<br />
::-moz-placeholder {  /* Firefox 19+ */<br />
color: green;<br />
}<br />
:-ms-input-placeholder {<br />
color: green;<br />
}</code></p>
<p>so it will change into something like this<br />
<img decoding="async" class="alignnone size-full wp-image-21" src="http://malaysiasky.com/malaysiasky/wp-content/uploads/2016/01/placeholder-green-1.png" alt="placeholder-green" width="299" height="200" /></p>
<div style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" /></a></div>
<p>cool right? but wait, another placeholder need different color. yes still can.<br />
first, create the html with ID/Class</p>
<p><code>&lt;input type="text" id="input_rare" placeholder="placeholder input rare"&gt; </code></p>
<h6>CSS:</h6>
<p><code>#input_rare::-webkit-input-placeholder {<br />
color: red;<br />
}<br />
#input_rare:-moz-placeholder { /* Firefox 18- */<br />
color: red;<br />
}<br />
#input_rare::-moz-placeholder {  /* Firefox 19+ */<br />
color: red;<br />
}<br />
#input_rare:-ms-input-placeholder {<br />
color: red;<br />
}</code></p>
<p>the you will get placeholder with this color<br />
<img decoding="async" class="alignnone size-full wp-image-23" src="http://malaysiasky.com/malaysiasky/wp-content/uploads/2016/01/placeholder-red.png" alt="placeholder-red" width="299" height="200" /></p>
<div style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" /></a></div>
<p>and now, we are done. lets see the html and css involved.</p>
<p><script src="https://gist.github.com/tuanshah/1f517f8b9a94843abcec.js"></script></p>
<h6><code>Output:</code></h6>
<div style="clear: both; text-align: center;"></div>
<div style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" /></a></div>
<p><img decoding="async" class="alignnone size-full wp-image-24" src="http://malaysiasky.com/malaysiasky/wp-content/uploads/2016/01/placeholder-full-1.png" alt="placeholder-full" width="299" height="199" /></p>
<p>The post <a href="https://www.malaysiasky.com/how-to-change-placeholder-color-with-css/">How to change placeholder color with css</a> appeared first on <a href="https://www.malaysiasky.com">MalaysiaSky</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.malaysiasky.com/how-to-change-placeholder-color-with-css/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 43/355 objects using Disk
Page Caching using Disk: Enhanced 
Content Delivery Network via N/A
Lazy Loading (feed)
Minified using Disk
Database Caching 6/34 queries in 0.013 seconds using Disk

Served from: www.malaysiasky.com @ 2026-06-17 21:22:18 by W3 Total Cache
-->