<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Muktadiur&#039;s Blog</title>
	<atom:link href="http://muktadiur.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://muktadiur.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sat, 18 Sep 2010 05:03:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='muktadiur.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Muktadiur&#039;s Blog</title>
		<link>http://muktadiur.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://muktadiur.wordpress.com/osd.xml" title="Muktadiur&#039;s Blog" />
	<atom:link rel='hub' href='http://muktadiur.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Change MAC Address on Ubuntu</title>
		<link>http://muktadiur.wordpress.com/2010/08/22/change-mac-address-on-ubuntu/</link>
		<comments>http://muktadiur.wordpress.com/2010/08/22/change-mac-address-on-ubuntu/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 04:59:49 +0000</pubDate>
		<dc:creator>muktadiur</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://muktadiur.wordpress.com/?p=112</guid>
		<description><![CDATA[As my IP provider restricts the number of network cards that can access the net so on ubuntu i needed to change the MAC address of my network card. It&#8217;s pretty easy, just two lines of command on terminal. ifconfig eth0 down hw ether 01:02:03:04:05:06 ifconfig eth0 up 1st command down the network and change [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=112&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As my IP provider restricts the number of network cards that can access the net so on ubuntu i needed to change the MAC address of my network card. It&#8217;s pretty easy, just two lines of command on terminal.</p>
<p>ifconfig eth0 down hw ether 01:02:03:04:05:06<br />
ifconfig eth0 up                                                   </p>
<p>1st command down the network and change the MAC to 01:02:03:04:05:06 and 2nd command again up the network</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muktadiur.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muktadiur.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muktadiur.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muktadiur.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muktadiur.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muktadiur.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muktadiur.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muktadiur.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muktadiur.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muktadiur.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muktadiur.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muktadiur.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muktadiur.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muktadiur.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=112&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muktadiur.wordpress.com/2010/08/22/change-mac-address-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52fae0c4737193ec9b645597ec106e3a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajib</media:title>
		</media:content>
	</item>
		<item>
		<title>Monthly Presentation : Introduction to iPhone SDK</title>
		<link>http://muktadiur.wordpress.com/2010/06/29/monthly-lecture-series-introduction-to-iphone-sdk/</link>
		<comments>http://muktadiur.wordpress.com/2010/06/29/monthly-lecture-series-introduction-to-iphone-sdk/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 16:33:30 +0000</pubDate>
		<dc:creator>muktadiur</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://muktadiur.wordpress.com/?p=151</guid>
		<description><![CDATA[As a part of monthly Presentation at MRSL, June 2010 i gave a presentation on Introduction to iPhone SDK. download<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=151&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As a part of monthly Presentation at MRSL, June 2010 i gave a presentation on Introduction to iPhone SDK. <a href='http://muktadiur.files.wordpress.com/2010/08/introduction-to-iphone-sdk.pptx'>download</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muktadiur.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muktadiur.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muktadiur.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muktadiur.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muktadiur.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muktadiur.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muktadiur.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muktadiur.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muktadiur.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muktadiur.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muktadiur.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muktadiur.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muktadiur.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muktadiur.wordpress.com/151/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=151&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muktadiur.wordpress.com/2010/06/29/monthly-lecture-series-introduction-to-iphone-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52fae0c4737193ec9b645597ec106e3a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajib</media:title>
		</media:content>
	</item>
		<item>
		<title>Monthly Presentation : Introduction to Cryptography</title>
		<link>http://muktadiur.wordpress.com/2010/05/29/monthly-lecture-series-introduction-to-cryptography/</link>
		<comments>http://muktadiur.wordpress.com/2010/05/29/monthly-lecture-series-introduction-to-cryptography/#comments</comments>
		<pubDate>Sat, 29 May 2010 16:19:00 +0000</pubDate>
		<dc:creator>muktadiur</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://muktadiur.wordpress.com/?p=135</guid>
		<description><![CDATA[As a part of monthly Presentation at MRSL, May 2010 i gave a presentation on Introduction to cryptography. download<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=135&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As a part of monthly Presentation at MRSL, May 2010 i gave a presentation on Introduction to cryptography. <a href='http://muktadiur.files.wordpress.com/2010/08/interoduction-to-cryptography.pptx'>download</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muktadiur.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muktadiur.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muktadiur.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muktadiur.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muktadiur.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muktadiur.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muktadiur.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muktadiur.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muktadiur.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muktadiur.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muktadiur.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muktadiur.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muktadiur.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muktadiur.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=135&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muktadiur.wordpress.com/2010/05/29/monthly-lecture-series-introduction-to-cryptography/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52fae0c4737193ec9b645597ec106e3a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajib</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom ASP.NET MVC Authorize Attribute</title>
		<link>http://muktadiur.wordpress.com/2010/04/20/custom-asp-net-mvc-authorize-attribute/</link>
		<comments>http://muktadiur.wordpress.com/2010/04/20/custom-asp-net-mvc-authorize-attribute/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 05:59:43 +0000</pubDate>
		<dc:creator>muktadiur</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">http://muktadiur.wordpress.com/?p=76</guid>
		<description><![CDATA[AuthorizeAttribute allows you to secure controller actions. The Authorize attribute lets you indicate that authorization is restricted to predefined roles or to individual users. This gives you a high degree of control over who is authorized to view any page on the site. public class UserController : Controller { [Authorize] public ActionResult Create() { return [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=76&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>AuthorizeAttribute allows you to secure controller actions. The Authorize attribute lets you indicate that authorization is restricted to predefined roles or to individual users. This gives you a high degree of control over who is authorized to view any page on the site.</p>
<pre>
public class UserController : Controller
{
    [Authorize]
    public ActionResult Create()
    {
        return View();
    }
</pre>
<p>}</p>
<p>what this code do? If an unauthorized user tries to access create methods then If the site is configured to use ASP.NET forms authentication, the 401 status code causes the browser to redirect the user to the login page.</p>
<pre>
public class UserController : Controller
{
    [Authorize(Roles = "Admin")]
    public ActionResult Create()
    {
        return View();
    }
</pre>
<p>}</p>
<p>Now the user who has admin role can only access to this methods. But what if i want to check this role from my user type enum?</p>
<pre>
[Serializable]
[Flags] //  When Enum mark with “Flags“ attribute it will work as bit field
public enum UserType
{
    Admin=1,
    PM= 2,
    Developer = 4
}
</pre>
<p>ok then lets write the custom Authorize Attribute.</p>
<pre>
public class CustomAuthorizeAttribute : AuthorizeAttribute
{
        public new UserType Roles;  // new keyword will hide base class Roles Property
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            if (httpContext == null)
            {
                throw new ArgumentNullException("httpContext");
            }
            IPrincipal user = httpContext.User;
            if (!user.Identity.IsAuthenticated)
            {
                return false;
            }

            UserType role = (UserType)Lib.Models.User.CurrentUser.UserType;
                                      // you could get User role or user type from session.

            if (Roles != 0 &amp;&amp; ((Roles &amp; role) != role))
            {
                 return false;
            }
            return true;
}
</pre>
<p>here i just override the AuthorizeCore methods of AuthorizeAttribute class. Now, you have to decorate your controller or action with this custom attribute and use bitwise operators to pass multiple roles.</p>
<pre>
[CustomAuthorize(Roles = UserType.Admin | UserType.PM)]
public ActionResult Create()
{
	return View();
}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muktadiur.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muktadiur.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muktadiur.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muktadiur.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muktadiur.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muktadiur.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muktadiur.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muktadiur.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muktadiur.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muktadiur.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muktadiur.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muktadiur.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muktadiur.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muktadiur.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=76&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muktadiur.wordpress.com/2010/04/20/custom-asp-net-mvc-authorize-attribute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52fae0c4737193ec9b645597ec106e3a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajib</media:title>
		</media:content>
	</item>
		<item>
		<title>Get All Tables With RowCount</title>
		<link>http://muktadiur.wordpress.com/2010/04/11/get-all-tables-with-rowcount/</link>
		<comments>http://muktadiur.wordpress.com/2010/04/11/get-all-tables-with-rowcount/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 15:23:17 +0000</pubDate>
		<dc:creator>muktadiur</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://muktadiur.wordpress.com/?p=43</guid>
		<description><![CDATA[Following query will return all table&#8217;s name with rowcount from a database. SELECT sysobjects.[name], Max(sysindexes.rows) AS Rows FROM sysobjects INNER JOIN sysindexes ON sysobjects.id = sysindexes.id WHERE sysobjects.xtype = 'U' group by sysobjects.[name]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=43&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Following query will return all table&#8217;s name with rowcount from a database.</p>
<pre>
SELECT sysobjects.[name],  Max(sysindexes.rows) AS Rows
FROM  sysobjects  INNER JOIN sysindexes ON
sysobjects.id = sysindexes.id WHERE sysobjects.xtype = 'U'
group by sysobjects.[name] </pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muktadiur.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muktadiur.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muktadiur.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muktadiur.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muktadiur.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muktadiur.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muktadiur.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muktadiur.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muktadiur.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muktadiur.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muktadiur.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muktadiur.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muktadiur.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muktadiur.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=43&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muktadiur.wordpress.com/2010/04/11/get-all-tables-with-rowcount/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52fae0c4737193ec9b645597ec106e3a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajib</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET MVC or Web Form</title>
		<link>http://muktadiur.wordpress.com/2010/04/11/asp-net-mvc-or-web-form/</link>
		<comments>http://muktadiur.wordpress.com/2010/04/11/asp-net-mvc-or-web-form/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 15:20:17 +0000</pubDate>
		<dc:creator>muktadiur</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">http://muktadiur.wordpress.com/2010/04/11/asp-net-mvc-or-web-form/</guid>
		<description><![CDATA[Web Forms may be better choice if your are building an intranet site with lots of data editing. ASP.NET MVC may be better choice if you are building a test driven Internet site where HTML, performance, and scalability are main concern. For more details download<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=42&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Web Forms may be better choice if your are building an intranet site with lots of data editing. </p>
<p>ASP.NET MVC may be better choice if you are building a test driven  Internet site where HTML, performance, and scalability are main concern.</p>
<p>For more details <a href="http://mashiurgroup.com/MRSL/Download/Aspdotnet.ppt">download</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muktadiur.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muktadiur.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muktadiur.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muktadiur.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muktadiur.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muktadiur.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muktadiur.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muktadiur.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muktadiur.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muktadiur.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muktadiur.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muktadiur.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muktadiur.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muktadiur.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=42&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muktadiur.wordpress.com/2010/04/11/asp-net-mvc-or-web-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52fae0c4737193ec9b645597ec106e3a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajib</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET MVC 2 DropDownlist Extensions for Enum</title>
		<link>http://muktadiur.wordpress.com/2010/04/10/asp-net-mvc-2-0-dropdownlist-extensions-methods-for-enum/</link>
		<comments>http://muktadiur.wordpress.com/2010/04/10/asp-net-mvc-2-0-dropdownlist-extensions-methods-for-enum/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 06:06:28 +0000</pubDate>
		<dc:creator>muktadiur</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">http://muktadiur.wordpress.com/?p=27</guid>
		<description><![CDATA[The ASP.NET MVC framework includes helper methods that provide an easy way to render HTML in a view. The DropDownList helper renders a drop-down list. &#60;%= Html.DropDownList("Products") %&#62; But the problem is MVC framework doesn&#8217;t provide any Helper method to work with Enum Type. So we need to extend Html Helper to work with Enum. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=27&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The ASP.NET MVC framework includes helper methods that provide an easy way to render HTML in a view. The DropDownList helper renders a drop-down list.</p>
<pre>&lt;%= Html.DropDownList("Products") %&gt;
</pre>
<p>
<br />
But the problem is MVC framework doesn&#8217;t provide any Helper method to work with Enum Type. So we need to extend Html Helper to work with Enum.</p>
<pre>public enum UserType
{
    Admin=1,
    PM= 2,
    Developer = 3
}</pre>
<p></p>
<pre>public static MvcHtmlString DropDownList(this HtmlHelper helper, string name, Type type)
{
    if (!type.IsEnum) throw new ArgumentException("Type is not an enum.");
    var enums = new List&lt;SelectListItem&gt;();
    foreach (int value in Enum.GetValues(type))
    {
         enums.Add(new SelectListItem { Value = value.ToString(), Text = Enum.GetName(type, value) });
    }
     return System.Web.Mvc.Html.SelectExtensions.DropDownList(helper, name, enums);
}</pre>
<p></p>
<p><strong>For Strongly Typed</strong></p>
<pre>public static MvcHtmlString DropDownListFor(this HtmlHelper htmlHelper, Expression&lt;Func&gt; expression,
            Type type, object htmlAttributes)
{
     if (!type.IsEnum) throw new ArgumentException("Type is not an enum.");
     var enums = new List&lt;SelectListItem&gt;();
     foreach (int value in Enum.GetValues(type))
     {
         enums.Add(new SelectListItem { Value = value.ToString(), Text = Enum.GetName(type, value) });
     }
     return System.Web.Mvc.Html.SelectExtensions.DropDownListFor(htmlHelper, expression,
         enums, htmlAttributes);

}
</pre>
<p></p>
<p>Now let&#8217;s use those methods on view.</p>
<pre>&lt;%= Html.DropDownList("UserType", typeof(UserType)) %&gt;
</pre>
<pre>&lt;%= Html.DropDownListFor(model=&gt;model.UserType, typeof(UserType), null) %&gt;  //for strongly typed
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muktadiur.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muktadiur.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muktadiur.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muktadiur.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muktadiur.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muktadiur.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muktadiur.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muktadiur.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muktadiur.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muktadiur.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muktadiur.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muktadiur.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muktadiur.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muktadiur.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=27&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muktadiur.wordpress.com/2010/04/10/asp-net-mvc-2-0-dropdownlist-extensions-methods-for-enum/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52fae0c4737193ec9b645597ec106e3a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajib</media:title>
		</media:content>
	</item>
		<item>
		<title>Get All Tables with Foreign Key status</title>
		<link>http://muktadiur.wordpress.com/2010/04/09/get-all-tables-name-from-a-database/</link>
		<comments>http://muktadiur.wordpress.com/2010/04/09/get-all-tables-name-from-a-database/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 07:42:22 +0000</pubDate>
		<dc:creator>muktadiur</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://muktadiur.wordpress.com/?p=23</guid>
		<description><![CDATA[When i was writing a Code Generator, i needed to get all the table with foreign key status from my database. Following query return that. select [Name], Case WHEN object_id IN (SELECT parent_object_id FROM sys.objects WHERE[type] ='F') THEN 1 ELSE 0 END HasFKey from sys.objects WHERE [type] in('U') order by [Name]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=23&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When i was writing a Code Generator, i needed to get all the table with foreign key status from my database. Following query return that.</p>
<pre>
select [Name], Case WHEN object_id IN (SELECT parent_object_id
FROM sys.objects WHERE[type] ='F') THEN 1 ELSE 0 END HasFKey from sys.objects
WHERE [type] in('U') order by [Name]</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muktadiur.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muktadiur.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muktadiur.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muktadiur.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muktadiur.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muktadiur.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muktadiur.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muktadiur.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muktadiur.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muktadiur.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muktadiur.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muktadiur.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muktadiur.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muktadiur.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=23&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muktadiur.wordpress.com/2010/04/09/get-all-tables-name-from-a-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52fae0c4737193ec9b645597ec106e3a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajib</media:title>
		</media:content>
	</item>
		<item>
		<title>Generate Pdf from URL</title>
		<link>http://muktadiur.wordpress.com/2010/04/04/generate-pdf-from-a-given-url/</link>
		<comments>http://muktadiur.wordpress.com/2010/04/04/generate-pdf-from-a-given-url/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 07:29:19 +0000</pubDate>
		<dc:creator>muktadiur</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://muktadiur.wordpress.com/?p=8</guid>
		<description><![CDATA[A few days ago I needed to write a class to generate pdf file from a given url and then save it to server. It was easy for me cause www.pdfmyurl.com does all the dirty stuff System.IO.Stream stream = System.Net.WebRequest.Create(string.Format(&#8220;http://pdfmyurl.com?url={0}&#8221;, &#8220;www.google.com&#8221;)).GetResponse().GetResponseStream(); Then you need to write this steam to server.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=8&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few days ago I  needed to write a class to generate pdf file from a given url and then save it to server. It was easy for me cause www.pdfmyurl.com does all the dirty stuff <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>System.IO.Stream stream = System.Net.WebRequest.Create(string.Format(&#8220;http://pdfmyurl.com?url={0}&#8221;, &#8220;www.google.com&#8221;)).GetResponse().GetResponseStream();</p>
<p>Then you need to write this steam to server.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muktadiur.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muktadiur.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muktadiur.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muktadiur.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muktadiur.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muktadiur.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muktadiur.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muktadiur.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muktadiur.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muktadiur.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muktadiur.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muktadiur.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muktadiur.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muktadiur.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muktadiur.wordpress.com&amp;blog=8408366&amp;post=8&amp;subd=muktadiur&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muktadiur.wordpress.com/2010/04/04/generate-pdf-from-a-given-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52fae0c4737193ec9b645597ec106e3a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajib</media:title>
		</media:content>
	</item>
	</channel>
</rss>
