<?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-9071023793074573342</id><updated>2012-02-19T11:43:05.368-08:00</updated><category term='Web Page design by coding'/><category term='Coding with table'/><category term='Showing entry of table using mygeneration'/><title type='text'>You can reach so far you can dream.</title><subtitle type='html'>This blog focuses on different web technologies including ASP.NET,C#, SQL Server, AJAX, Javascript,CSS, JQuery,lightbox,carousel and different e-commerce payment Application like paypal,google-checkout etc</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-6512289016950775258</id><published>2010-12-08T00:43:00.000-08:00</published><updated>2010-12-08T00:50:22.340-08:00</updated><title type='text'>how to configure DHCP in windows server 2003?</title><content type='html'>The &lt;b&gt;Dynamic Host Configuration Protocol&lt;/b&gt; (&lt;b&gt;DHCP&lt;/b&gt;) is an auto configuration protocol used on &lt;a href="http://en.wikipedia.org/wiki/IP_networks" title="IP networks" class="mw-redirect"&gt;IP networks&lt;/a&gt;.  Computers that are connected to IP networks must be configured before  they can communicate with other computers on the network. DHCP allows a  computer to be configured automatically, eliminating the need for  intervention by a network administrator. It also provides a central  database for keeping track of computers that have been connected to the  network. This prevents two computers from accidentally being configured  with the same &lt;a href="http://en.wikipedia.org/wiki/IP_address" title="IP address"&gt;IP address&lt;/a&gt;.&lt;br /&gt;Here is some links for configuring DHCP in the local network:&lt;br /&gt;1. &lt;a target="_blank" href="http://www.windowsreference.com/windows-server-2003/install-and-configure-dhcp-server-in-win-server-2003-step-by-step-guide/"&gt;http://www.windowsreference.com/windows-server-2003/install-and-configure-dhcp-server-in-win-server-2003-step-by-step-guide/&lt;/a&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;2. &lt;a target="_blank" href="http://www.windowsnetworking.com/articles_tutorials/DHCP_Server_Windows_2003.html"&gt;http://www.windowsnetworking.com/articles_tutorials/DHCP_Server_Windows_2003.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-6512289016950775258?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/6512289016950775258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/12/how-to-configure-dhcp-in-windows-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6512289016950775258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6512289016950775258'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/12/how-to-configure-dhcp-in-windows-server.html' title='how to configure DHCP in windows server 2003?'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-834267940931754034</id><published>2010-11-23T07:16:00.000-08:00</published><updated>2010-11-23T07:25:18.151-08:00</updated><title type='text'>How to get the path of AppData for an application?</title><content type='html'>Often in windows OS, a separate directory is created for an application for a user for saving user-specific information and user has the administrative right on that folder. Recently, I was working on a project with winxp platform. While client was testing the same software on win 7 , he found that the application failed to create the or modify a file in the system directory where the application was loaded. So, then the concept of Appdata came and I implemented the solution using the link provided by client.&lt;br /&gt;Here is the link &lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/946420/allow-access-permission-to-write-in-program-files-of-windows-7"&gt;http://stackoverflow.com/questions/946420/allow-access-permission-to-write-in-program-files-of-windows-7&lt;/a&gt;&lt;br /&gt;And here is my code for getting the AppData folder&lt;br /&gt;&lt;code&gt;&lt;br /&gt;XmlDocument xmldoc = new XmlDocument();&lt;br /&gt;&lt;b&gt;&lt;br /&gt;           string xmlfilepath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);&lt;/b&gt;&lt;br /&gt;           //loading the file&lt;br /&gt;           xmldoc.Load(xmlfilepath + "/" + "enstatics.xml");&lt;br /&gt;           //returning the xmldoc&lt;br /&gt;           return xmldoc;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-834267940931754034?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/834267940931754034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/11/how-to-get-path-of-appdata-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/834267940931754034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/834267940931754034'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/11/how-to-get-path-of-appdata-for.html' title='How to get the path of AppData for an application?'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-5469407488111765332</id><published>2010-11-23T07:09:00.000-08:00</published><updated>2010-11-23T07:14:47.660-08:00</updated><title type='text'>DNS setup in Ubuntu Linux</title><content type='html'>Recently, I assigned a project of setting mail server as network lab project for fourth year 1st term students. Anyway, no group came out with what I expected. Anyway, the first thing is here is needed is a successful DNS server.&lt;br /&gt;Here is a post I created for DNS setup in Ubuntu Linux with BIND software.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;DNS setup in ubuntu&lt;/span&gt;&lt;br /&gt;Here is the link &lt;a href="http://cseku.technopeople.net/setting-up-dns-linux.aspx"&gt;http://cseku.technopeople.net/setting-up-dns-linux.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-5469407488111765332?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/5469407488111765332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/11/dns-setup-in-ubuntu-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/5469407488111765332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/5469407488111765332'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/11/dns-setup-in-ubuntu-linux.html' title='DNS setup in Ubuntu Linux'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-624760072557088994</id><published>2010-11-23T06:22:00.000-08:00</published><updated>2010-12-09T14:57:10.110-08:00</updated><title type='text'>Working with xml file in C#</title><content type='html'>&lt;div style="text-align: justify;"&gt;Well, Currently I am working with a project called webcam desktop application which mainly captures snapshot and video from the webcam. Before, starting the project, I had very little concept about how to do that and before me, an experienced developer worked on it. Anyway, my task was to fix the bugs. Whenever, I started bug-fixing, I found that previous coder used Appsetting to store information, which polls some static information from the system and nothing customization saved at run time, can be restored in the next run of the system. So, I came to plan to save the information in the xml file. Here I am going to show several things like&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Creating xml file dynamically&lt;br /&gt;2. Modifying the xml file&lt;br /&gt;3. Reading from the xml file.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p style="font-weight: bold; color: rgb(0, 0, 153); text-align: left;"&gt;Creating XML file dynamically&lt;/p&gt;&lt;code&gt;//code for creating and saving default config&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    public void create_config_xml_file()&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        try {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //xml doc&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlDocument xmldoc = new XmlDocument();&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        &lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //xml declaration&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlDeclaration xmldeclaration = xmldoc.CreateXmlDeclaration("1.0", "utf-8", null);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //create root element&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlElement rootNode = xmldoc.CreateElement("myconfigdata");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            xmldoc.InsertBefore(xmldeclaration, xmldoc.DocumentElement);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            xmldoc.AppendChild(rootNode);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //adding more children to the root node&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        &lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //imageformatindex&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlElement ifiElement = xmldoc.CreateElement("imageformatindex");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            ifiElement.InnerText = "1";&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            rootNode.AppendChild(ifiElement);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //currentdirectory&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlElement currDirElement = xmldoc.CreateElement("currentdirectory");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            currDirElement.InnerText = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            rootNode.AppendChild(currDirElement);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //fileprefix&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlElement fpElement = xmldoc.CreateElement("fileprefix");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            fpElement.InnerText = "ISeeStand";&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            rootNode.AppendChild(fpElement);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //filesuffixid&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlElement fsElement = xmldoc.CreateElement("filesuffixid");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            fsElement.InnerText = "2";&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            rootNode.AppendChild(fsElement);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //sequential&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlElement seqElement = xmldoc.CreateElement("sequential");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            seqElement.InnerText = "0";&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            rootNode.AppendChild(seqElement);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //sequentialvid&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlElement seqVidElement = xmldoc.CreateElement("sequentialvid");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            seqVidElement.InnerText = "0";&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            rootNode.AppendChild(seqVidElement);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //videncoder&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlElement videncElement = xmldoc.CreateElement("videncoder");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            videncElement.InnerText = "WMVideo9 Encoder DMO";&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            rootNode.AppendChild(videncElement);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //framesize&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlElement fsizeElement = xmldoc.CreateElement("framesize");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            fsizeElement.InnerText = "800 x 600 @5.00 fps";&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            rootNode.AppendChild(fsizeElement);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //framerate&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            XmlElement frateElement = xmldoc.CreateElement("framerate");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            frateElement.InnerText = "5.00 fps";&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            rootNode.AppendChild(frateElement);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //getting appdata folder&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            string app_path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            //saving that document&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            xmldoc.Save(app_path+"/"+"enstatics.xml");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        catch (Exception exc) {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;            MessageBox.Show("Failed to create the xml configuration file."+exc.Message);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;From the above code, we can see how to use XMLDocument object and XmlNode for creating a XML file.&lt;br /&gt;&lt;p style="text-align: left;"&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;Modifying the XML file&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;The following code saves some info into the xml file accessing a particular XmlNode&lt;br /&gt;&lt;/p&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;   //saving the image format index to the xml file&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         try {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             XmlDocument xmldoc = MyStaticMgr.loadMyXMLDoc();&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             XmlNode formatIndexNode = xmldoc.GetElementsByTagName("imageformatindex")[0];&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             //setting the preferences to the xml node&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             formatIndexNode.InnerText = (ImageformatComboBox.SelectedIndex + 1).ToString();&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             //now saving the xml file&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             int result=MyStaticMgr.saveMyXMLDoc(xmldoc);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         catch (Exception exc) {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             MessageBox.Show("Failed to save the preferences"+exc.Message);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;p style="font-weight: bold; color: rgb(51, 51, 255); text-align: left;"&gt;Reading from XML file&lt;/p&gt;The following code will demonstrate how to access a particular node of the xml file for a particular information&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;//making a default choice&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             try {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;                 XmlDocument xmldoc = MyStaticMgr.loadMyXMLDoc();&lt;/code&gt;&lt;br /&gt;&lt;code&gt;                 XmlNode formatIndexNode = xmldoc.GetElementsByTagName("imageformatindex")[0];&lt;/code&gt;&lt;br /&gt;&lt;code&gt;                 int format_index = int.Parse(formatIndexNode.InnerText);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;                 //now setting that index to the combobox&lt;/code&gt;&lt;br /&gt;&lt;code&gt;                 ImageformatComboBox.SelectedIndex = format_index - 1;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             catch (Exception exc) {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;                 string messageBoxText = exc.Message;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;                 string caption = "Exception Occurred";&lt;/code&gt;&lt;br /&gt;&lt;code&gt;                 MessageBox.Show(messageBoxText, caption);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;From the above codes we found a particular section like this&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;XmlDocument xmldoc = MyStaticMgr.loadMyXMLDoc();&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;and&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;//now saving the xml file&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             int result=MyStaticMgr.saveMyXMLDoc(xmldoc);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;Actually, MyStaticMgr is a static class which handles the basic operation like opening an xml document and returning the document object or saving the xmldocument object. Here is the code&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System.Collections.Generic;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System.Linq;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System.Text;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System.Xml;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System.Windows.Forms;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;namespace ISeeStand&lt;/code&gt;&lt;br /&gt;&lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;code&gt; public static class MyStaticMgr&lt;/code&gt;&lt;br /&gt;&lt;code&gt; {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;     //code for loading the xml document&lt;/code&gt;&lt;br /&gt;&lt;code&gt;     public static XmlDocument loadMyXMLDoc()&lt;/code&gt;&lt;br /&gt;&lt;code&gt;     {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         XmlDocument xmldoc = new XmlDocument();&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         string xmlfilepath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         //loading the file&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         xmldoc.Load(xmlfilepath + "/" + "enstatics.xml");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         //returning the xmldoc&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         return xmldoc;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;  &lt;/code&gt;&lt;br /&gt;&lt;code&gt;     }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;     //code for saving to the xml file&lt;/code&gt;&lt;br /&gt;&lt;code&gt;     public static int saveMyXMLDoc(XmlDocument xmldoc)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;     {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         int saved = 0;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         try {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             string xmlfilepath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             //loading the file&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             xmldoc.Save(xmlfilepath + "/" + "enstatics.xml");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             //yes the file is saved&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             saved = 1;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         catch (Exception exc) {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             string messageBoxText = exc.Message;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             string caption = "Exception Occurred";&lt;/code&gt;&lt;br /&gt;&lt;code&gt;             MessageBox.Show(messageBoxText, caption);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;      &lt;/code&gt;&lt;br /&gt;&lt;code&gt;         //returning the result&lt;/code&gt;&lt;br /&gt;&lt;code&gt;         return saved;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;  &lt;/code&gt;&lt;br /&gt;&lt;code&gt;     }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;}&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-624760072557088994?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/624760072557088994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/11/working-with-xml-file-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/624760072557088994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/624760072557088994'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/11/working-with-xml-file-in-c.html' title='Working with xml file in C#'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-6547231138253772068</id><published>2010-08-29T09:16:00.000-07:00</published><updated>2010-08-29T10:59:26.791-07:00</updated><title type='text'>Handling event from Context Menu strip after a Right Click</title><content type='html'>Recently I deal with this problems for 1-1.5 hours. Anyway, lastly I figured it out how to perform this operations: Here are the steps. We need three controls for this&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Windows form&lt;/li&gt;&lt;br /&gt;&lt;li&gt;ListView Control&lt;/li&gt;&lt;br /&gt;&lt;li&gt;ContextMenu Strip&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Step-1:&lt;strong&gt;Loading listview items:&lt;/strong&gt;:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The following code loads the items to listview control.&lt;br /&gt;&lt;br /&gt; protected void load_courses()&lt;br /&gt;        { &lt;br /&gt;        &lt;br /&gt;            //code for loading the courses&lt;br /&gt;            try {&lt;br /&gt;                OleDbConnection conn = new OleDbConnection(StaticData.connection_string);&lt;br /&gt;                conn.Open();&lt;br /&gt;                string select_courses = "select * from Course";&lt;br /&gt;                OleDbDataAdapter oda = new OleDbDataAdapter(select_courses, conn);&lt;br /&gt;                DataTable dt = new DataTable();&lt;br /&gt;                oda.Fill(dt);&lt;br /&gt;&lt;br /&gt;                //databinding to the listview&lt;br /&gt;                TestlistView.Items.Clear();&lt;br /&gt;                for(int i=0;i &amp;lt dt.Rows.Count;i++)&lt;br /&gt;                {&lt;br /&gt;                    DataRow row = dt.Rows[i];&lt;br /&gt;                    ListViewItem lvi = new ListViewItem(row["CourseNo"].ToString());&lt;br /&gt;                    lvi.SubItems.Add(row["CourseID"].ToString());&lt;br /&gt;                    lvi.SubItems.Add(row["Credit"].ToString());&lt;br /&gt;                    TestlistView.Items.Add(lvi);&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;            &lt;br /&gt;            }&lt;br /&gt;            catch (Exception exc) { }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;    private void Form1_Load(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            //code for loading the courses&lt;br /&gt;            load_courses();&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Step-2:&lt;strong&gt;Handling the right click event on listview items:&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;private void TestlistView_MouseClick(object sender, MouseEventArgs e)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            if (e.Button == MouseButtons.Right)&lt;br /&gt;            {&lt;br /&gt;                Point pt = TestlistView.PointToScreen(e.Location);&lt;br /&gt;                contextMenuStrip1.Show(pt);   &lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Step-3:&lt;strong&gt;Handling context menu strip event&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;  private void contextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            if (e.ClickedItem.Text == "Upload")&lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show("Upload started for:" + TestlistView.SelectedItems[0].Text);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Thats how we can use right click event to show a context menu strip and handle menu strip click events.&lt;br /&gt;thanks. Masud(29-08-2010)&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-6547231138253772068?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/6547231138253772068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/08/handling-event-from-context-menu-strip.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6547231138253772068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6547231138253772068'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/08/handling-event-from-context-menu-strip.html' title='Handling event from Context Menu strip after a Right Click'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-1990631001838823775</id><published>2010-05-06T11:43:00.000-07:00</published><updated>2010-11-23T07:07:43.126-08:00</updated><title type='text'>Full functional LAN set up</title><content type='html'>For few days, I was trying to implement some important things to implement in the LAN of CSE Discipline, Khulna University. I was trying to develop a fully functional computer network. Such one network will contain the following entities:&lt;br /&gt;&lt;br /&gt;&lt;p style="font-weight: bold; color: rgb(51, 51, 255);"&gt;A Web server&lt;/p&gt;Here is the necessary help for that&lt;br /&gt;1. &lt;a href="http://blog.ifitcangowrong.com/windows/install-iis-60-on-windows-server-2003"&gt;http://blog.ifitcangowrong.com/windows/install-iis-60-on-windows-server-2003&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://technet.microsoft.com/en-us/library/aa998483%28EXCHG.65%29.aspx"&gt;http://technet.microsoft.com/en-us/library/aa998483%28EXCHG.65%29.aspx&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/750d3137-462c-491d-b6c7-5f370d7f26cd.mspx?mfr=true"&gt;http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/750d3137-462c-491d-b6c7-5f370d7f26cd.mspx?mfr=true&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="font-weight: bold; color: rgb(51, 51, 255);"&gt;A DNS Server&lt;/p&gt;Here is necessary help for that I think:&lt;br /&gt;1.&lt;a href="http://www.petri.co.il/install_and_configure_windows_2003_dns_server.htm" target="_blank"&gt;http://www.petri.co.il/install_and_configure_windows_2003_dns_server.htm&lt;/a&gt;&lt;br /&gt;2.&lt;a href="http://helpdeskgeek.com/networking/install-and-configure-dns-on-windows-server-2003/"&gt;http://helpdeskgeek.com/networking/install-and-configure-dns-on-windows-server-2003/&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://support.microsoft.com/kb/814591"&gt;http://support.microsoft.com/kb/814591&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="font-weight: bold; color: rgb(51, 51, 255);"&gt;An Email sever (POP and SMTP)&lt;/p&gt;1. &lt;a href="http://www.ilopia.com/Articles/WindowsServer2003/EmailServer.aspx"&gt;http://www.ilopia.com/Articles/WindowsServer2003/EmailServer.aspx&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.windowsreference.com/windows-server-2003/step-by-step-email-server-setup-in-windows-server-2003/"&gt;http://www.windowsreference.com/windows-server-2003/step-by-step-email-server-setup-in-windows-server-2003/&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://articles.techrepublic.com.com/5100-10878_11-5035180.html"&gt;http://articles.techrepublic.com.com/5100-10878_11-5035180.html&lt;/a&gt;&lt;br /&gt;4. &lt;a href="http://www.windowsnetworking.com/articles_tutorials/Windows_POP3_Service.html"&gt;http://www.windowsnetworking.com/articles_tutorials/Windows_POP3_Service.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-1990631001838823775?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/1990631001838823775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/05/full-functional-lan-set-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1990631001838823775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1990631001838823775'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/05/full-functional-lan-set-up.html' title='Full functional LAN set up'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-662004931298748977</id><published>2010-04-20T03:22:00.000-07:00</published><updated>2010-04-20T04:00:03.247-07:00</updated><title type='text'>Using image map and popupcontrol extender</title><content type='html'>In interactive map client provided me a jquery library which is called zoom map and he instructed to work according to that but I found some problem in work with multiple version of jquery. For example jquery-min-1.3.2 does not support the coexistence with jquery-1.4.2.js. Anyway, I am going to describe here, how to use image map and popupcontrolextender. To perform this we need to follow these steps:&lt;br /&gt;&lt;br /&gt;Step-1: We have to register the AjaxControlToolkit for using its control which we are calling here PopupControlExtender. &lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Step-2:&lt;br /&gt;Consider an image containing lots of hot spot and when there is a click on that hot spot certain popup-winow will show up. So, here is the code for image and map.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt img id="homeimg"  src="maps/map-bg-w-dots.jpg"  style="border-width:0px"  runat="server" alt="" usemap="#homemap" / &amp;gt&lt;br /&gt;&amp;lt map name="homemap" id="homemap"&amp;gt&lt;br /&gt;&amp;lt area id="hole1area" runat="server" target="_self"  onclick="showdetails(1)" shape="circle" style="cursnor:pointer" alt=""  coords="314,178,7"/&amp;gt&lt;br /&gt;&amp;lt area id="hole2area" runat="server" target="_self"  onclick="showdetails(2)" shape="circle" style="cursor:pointer" alt=""  coords="285,56,7"/&amp;gt&lt;br /&gt;&amp;lt /map&amp;gt    &lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Here, onclick="showdetails(1)" can be used to populate data from some xml file relevant to hole1area if needed. As for example I have done in&lt;br /&gt;&lt;a href='http://cpdemo.com/vistaverde/development.html' target='_blank'&gt; my map project &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step-3:&lt;br /&gt;Now we need the popup control extender that will generate a popup. So, here is the code below:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt asp:ScriptManager runat="server"&gt;&amp;lt /asp:ScriptManager&amp;gt&lt;br /&gt;&amp;lt cc1:PopupControlExtender runat="server" ID="MyPopupExtender1" OffsetX="550" OffsetY="300" PopupControlID="popupwindow1" TargetControlID="hole1area"&amp;gt&lt;br /&gt;    &amp;lt /cc1:PopupControlExtender&amp;gt&lt;br /&gt;&amp;lt cc1:PopupControlExtender runat="server" ID="MyPopupExtender2" OffsetX="550" OffsetY="300" PopupControlID="popupwindow2" TargetControlID="hole2area"&amp;gt&lt;br /&gt;    &amp;lt /cc1:PopupControlExtender&amp;gt&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt div id='popupwindow1'&amp;gt&lt;br /&gt;Description for hole1...............&lt;br /&gt;&amp;lt /div&amp;gt&lt;br /&gt;&amp;lt div id='popupwindow2'&amp;gt&lt;br /&gt;Description for hole2................&lt;br /&gt;&amp;lt /div&amp;gt&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Here, several thing to notice:&lt;br /&gt;TargetControlID= the control which will be clicked on.&lt;br /&gt;PopupControlID= the control which will be shown as popup.&lt;br /&gt;OffsetX= the X position where popup will be shown&lt;br /&gt;OffsetY= the Y position where popup will be shown.&lt;br /&gt;&lt;br /&gt;So, this is the simplest way to use image map and popupcontrolextender. And whenever I started working client become excited as I was not using his solution but finally I ended up with good solution and he was quite satisfied. So, this project was one of the challenging task to me.&lt;br /&gt;&lt;br /&gt;thanks. Masud.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-662004931298748977?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/662004931298748977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/04/using-image-map-and-popupcontrol.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/662004931298748977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/662004931298748977'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/04/using-image-map-and-popupcontrol.html' title='Using image map and popupcontrol extender'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-5611574967990110455</id><published>2010-04-20T02:25:00.000-07:00</published><updated>2010-12-09T14:53:53.052-08:00</updated><title type='text'>The challenging task in interactive map project</title><content type='html'>&lt;div style="text-align: justify;"&gt;Few days ago I a project successfully called Interactive Map project. The development URL of this project is:&lt;br /&gt;http://cpdemo.com/vistaverde/development.html&lt;br /&gt;From this project I got an outline professional work and fancy works. Anyway, I was satisfying client's requirements and at time I found client has made an easy requirements visually but technically it is a tough one which I didn't perform ever. Actually, the life software engineer is quite thrilling in that sense that it is full of challenges and that's why I could not leave this despite of being a university lecturer. Anyway, here the way I solved the problem.&lt;br /&gt;&lt;br /&gt;Requirement: to stop hiding the popup-window at click outside the popup window.&lt;br /&gt;Relevance description: I was using asp.net ajax control toolkit to make a popup-window after a mouse click on some hot spot on an image map. And default behavior of the popup window as designed by the toolkit developers was to be hidden at the mouse click outside the popup window. I tried a lots of ways but I could not stop the mouse click. I used e.stopPropagation(){for FF} and e.cancelBubble=true {for IE} but nothing works for me and lastly I found some tutorials and several combination of them works.&lt;br /&gt;&lt;br /&gt;Steps to solution:&lt;br /&gt;step-1: to override the default behavior of the toolkit we need to override the function. For example, I was using popupcontrolExtender control for making popup-window. Anyone can easily download source from this URL to see the behavior of the control as set by the developers:&lt;br /&gt;http://ajaxcontroltoolkit.codeplex.com/releases/view/16488#DownloadId=41941&lt;br /&gt;Here, I found that _onBodyClick: handler is managing the click on the body of html page and making the __VisiblePopup hidden. So I need to override this handler as I found. This whole modification will be contained inside a dll. &lt;span style="font-weight: bold;"&gt;So I created a dll project on Visual Studio called MypopupControl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step-2:&lt;br /&gt;To override this handler I created a javascript file that contains the overridden handler which looks like the following. It is named as 'myjsfile.js' in my solution.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;//starting of javascript code&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;try&lt;/code&gt;&lt;br /&gt;&lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;AjaxControlToolkit.myPopupControlBehavior= function(element)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;code&gt;   AjaxControlToolkit.myPopupControlBehavior.initializeBase(this,[element]);  &lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;br /&gt;&lt;code&gt;AjaxControlToolkit.myPopupControlBehavior.prototype =&lt;/code&gt;&lt;br /&gt;&lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;code&gt;_onBodyClick:function()&lt;/code&gt;&lt;br /&gt;&lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;code&gt;if(this._popupVisible)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;code&gt; return false;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;}&lt;/code&gt;&lt;br /&gt;&lt;code&gt;}&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;br /&gt;&lt;code&gt;AjaxControlToolkit.myPopupControlBehavior.inheritsFrom(AjaxControlToolkit.PopupControlBehavior);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;AjaxControlToolkit.myPopupControlBehavior.registerClass('AjaxControlToolkit.myPopupControlBehavior', AjaxControlToolkit.PopupControlBehavior);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;}catch(exc){}&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Here we can see that _onBodyClick handler is modified so that a visible popup wont be hidden by the mouse click on the body.&lt;br /&gt;&lt;br /&gt;Step-3:&lt;br /&gt;I also created a C# file called 'myPopupControlExtender.cs' that contains the following contents: Please note that myPopupControlExtender class inherits PopupControlExtender class of AjaxControlToolkit namespace that means it will have all the properties of PopupControlExtender class.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System.Collections.Generic;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System.Linq;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System.Text;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System.Web;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using System.Web.UI;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;using AjaxControlToolkit;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;[assembly: WebResource("MyPopupControl.myjsfile.js", "text/javascript")] //the custom/override javascript file is an embedded resource&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;namespace MyPopupControl&lt;/code&gt;&lt;br /&gt;&lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    [ClientScriptResource("AjaxControlToolkit.myPopupControlBehavior", "MyPopupControl.myjsfile.js")]&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    public class myPopupControlExtender : PopupControlExtender&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        &lt;/code&gt;&lt;br /&gt;&lt;code&gt;        &lt;/code&gt;&lt;br /&gt;&lt;code&gt;       &lt;/code&gt;&lt;br /&gt;&lt;code&gt;    }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;}&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Here, we can see that an assembly entry is used to embed the javascript file and it will be resided inside the C# dll we will be creating.&lt;br /&gt;&lt;br /&gt;Step-4: The mostly important step of this process is to declared the javascript file as the embedded resource and without this whole process wont be effective. So, to do this:&lt;br /&gt;Right click on js file&gt;Properties&gt; Build Action &gt;Embedded Resource&lt;br /&gt;&lt;br /&gt;Step-5: Now we need to just build the project and we will get a brand new dll called MyPopupControl which is containing the modified behavior of PopupControl and in my case I created new popupcontrolextender which was named as 'myPopupControlExtender' and as its inherits all the properties of popupcontrolExtender plus containing the modified behavior of _onBodyClick:function()...so that serves my purpose of the project.&lt;br /&gt;&lt;br /&gt;thanks. Masud.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-5611574967990110455?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/5611574967990110455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/04/challenging-task-in-interactive-map_20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/5611574967990110455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/5611574967990110455'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/04/challenging-task-in-interactive-map_20.html' title='The challenging task in interactive map project'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-1937463880401748022</id><published>2010-03-13T12:57:00.000-08:00</published><updated>2010-03-13T13:37:59.819-08:00</updated><title type='text'>Creating DB script with data from Sql sever 2005</title><content type='html'>Creating Database script with data is quite easy for deploying an application with existing data. Anyone can create such script following these steps as dictated by diagrams. This process will be helpful to the people not having SQL server Management Studio installed.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Window-1: Visual Studio: View&gt;Server Explorer&gt;Data Connections&gt;Select One Connection&gt;Publish to provider&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Window-2: Select a database &gt; Next&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Window-3: Script to file &gt; Next&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Window-4: Type of data to publish: &lt;span style="font-weight: bold; font-style: italic;"&gt;Schema and Data&lt;/span&gt; &gt;Next&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Window-5: Review Summary: &gt;Next&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Window-6: Database Publishing Progress &gt; Finish&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Window-7: Completed.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-1937463880401748022?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/1937463880401748022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/03/creating-db-script-with-data-from-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1937463880401748022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1937463880401748022'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/03/creating-db-script-with-data-from-sql.html' title='Creating DB script with data from Sql sever 2005'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-6610604267239924691</id><published>2010-02-06T10:07:00.000-08:00</published><updated>2010-02-06T10:14:04.848-08:00</updated><title type='text'>Exporting data from sql server table to excel file</title><content type='html'>Exporting data from sql server table to excel file requires two levels to query execution. They are given below.&lt;br /&gt;&lt;br /&gt;1. Enabling OPENROWSET  (executed by DBA)&lt;br /&gt;&lt;code style="font-size: 12px;"&gt;&lt;span style="color: blue;"&gt;EXEC &lt;/span&gt;&lt;span style="color: darkred;"&gt;sp_configure &lt;/span&gt;&lt;span style="color: red;"&gt;'show advanced options'&lt;/span&gt;&lt;span style="color: gray;"&gt;, &lt;/span&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: gray;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;GO&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;RECONFIGURE&lt;/span&gt;&lt;span style="color: gray;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;GO&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;EXEC &lt;/span&gt;&lt;span style="color: darkred;"&gt;sp_configure &lt;/span&gt;&lt;span style="color: red;"&gt;'Ad Hoc Distributed Queries'&lt;/span&gt;&lt;span style="color: gray;"&gt;, &lt;/span&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: gray;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;GO&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;RECONFIGURE&lt;/span&gt;&lt;span style="color: gray;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;GO&lt;br /&gt;&lt;br /&gt;2.&lt;/span&gt;&lt;/code&gt; This is second part by which actually data will be exported from sql table to excel file. Here is the query worked for me.&lt;br /&gt;&lt;br /&gt;INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0',&lt;br /&gt;'Excel 8.0;Database=E:\testing.xls;',&lt;br /&gt;'SELECT BusCatID,Description FROM [Sheet1$]')&lt;br /&gt;SELECT BusCatID,Description  FROM hooser_burger_db.dbo.BusinessCategory&lt;br /&gt;&lt;br /&gt;Before executing the query developer has to create an .xls file and he/she has to denote the header or column name of sql sever tables to be exported in the excel file. Then after running the query he can consume the data from the file.&lt;br /&gt;&lt;br /&gt;Masud (7-2-2010)&lt;br /&gt;&lt;br /&gt;&lt;code style="font-size: 12px;"&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-6610604267239924691?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/6610604267239924691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/02/exporting-data-from-sql-server-table-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6610604267239924691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6610604267239924691'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/02/exporting-data-from-sql-server-table-to.html' title='Exporting data from sql server table to excel file'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-6313378165306412042</id><published>2010-01-31T12:25:00.000-08:00</published><updated>2010-10-18T07:43:26.931-07:00</updated><title type='text'>Databinding with combobox in C# windows application</title><content type='html'>It is quite similar to the databinding with dropdown list in ASP.NET. Anyway, here is the code for databinding.&lt;br /&gt;# code for databinding with combobox&lt;br /&gt;&lt;code&gt;&lt;br /&gt;try {&lt;br /&gt;                SqlConnection conn = new SqlConnection();&lt;br /&gt;                conn.ConnectionString = Properties.Settings.Default["MyConnStr"].ToString();&lt;br /&gt;                conn.Open();&lt;br /&gt;&lt;br /&gt;                string select_cats="select * from BusinessCategory";&lt;br /&gt;                SqlDataAdapter sda=new SqlDataAdapter(select_cats,conn);&lt;br /&gt;                DataTable dt=new DataTable();&lt;br /&gt;                sda.Fill(dt);&lt;br /&gt;&lt;br /&gt;                //databinding to the combobox&lt;br /&gt;                TestcomboBox.DataSource = dt.DefaultView;&lt;br /&gt;                TestcomboBox.DisplayMember = "Description";&lt;br /&gt;                TestcomboBox.ValueMember = "BusCatID";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;           &lt;br /&gt;            }&lt;br /&gt;            catch (Exception exc) {&lt;br /&gt;&lt;br /&gt;                //MessageBox.Show(exc.Message);&lt;br /&gt;            }&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Here we see 'Description' is used here as text property and 'BusCatID' is used here as value property with combo box.        &lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-6313378165306412042?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/6313378165306412042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/01/databinding-with-combobox-in-c-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6313378165306412042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6313378165306412042'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/01/databinding-with-combobox-in-c-windows.html' title='Databinding with combobox in C# windows application'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-6536834953583640462</id><published>2010-01-31T01:19:00.000-08:00</published><updated>2010-10-18T07:45:35.630-07:00</updated><title type='text'>Creating paypal shopping cart</title><content type='html'>Before finishing the my project http://www.biznesmakler.pl  I found that client wants me to change payment procedure through paypal. He wants a way to perform payment by buyer to paypal without login to paypal account that means payment with credit card only. Apparently I found that there is no available way for payment without login to paypal account. Actually, if anyone has a paypal account he wont be able to make payment to paypal without login according to current strategy...that if paypal checks a credit card for once it has a record for that card and it will prompt for registration next time. As I was trying to integrate with paypal in express checkout and it needed login to paypal for account confirmation.&lt;br /&gt;&lt;br /&gt;Anyway, I thought there is no way to pay without login..but there is. And the only exclusive way to make payment is payment with shopping cart. And its quite east to integrate the site paypal shopping cart techniques. Lets summarize the way of paypal shopping cart integration.&lt;br /&gt;&lt;br /&gt;1. Login to paypal business account&lt;br /&gt;2. Click Merchant service tab&lt;br /&gt;3. Select  create New Button Link. After a process of creating button you will be provided with the button code with a button id.&lt;br /&gt;4. Now you can redirect your buyer for payment in this way. Here is the code.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;               //redirect to option 1 button&lt;br /&gt;                StringBuilder builder = new StringBuilder();&lt;br /&gt;                builder.Append(bizcart.scartPostURL);&lt;br /&gt;                builder.Append("&amp;amp;cmd=_s-xclick");&lt;br /&gt;                builder.Append("&amp;amp;hosted_button_id=" + bizcart.valuationOption1ButtonID);&lt;br /&gt;                paypal_redirect_url = builder.ToString();&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Here bizcart.valuationOption1ButtonID is the button id we have generated.&lt;br /&gt;Thats the way to work with paypal shopping cart.&lt;br /&gt;&lt;br /&gt;Masud. (31.1.2010)&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-6536834953583640462?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/6536834953583640462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/01/creating-paypal-shopping-cart.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6536834953583640462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6536834953583640462'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/01/creating-paypal-shopping-cart.html' title='Creating paypal shopping cart'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-5514478052309907190</id><published>2010-01-08T13:24:00.000-08:00</published><updated>2010-01-08T13:38:05.790-08:00</updated><title type='text'>Creating PDF using ASPpdf service</title><content type='html'>Here I will be discussing about creating pdf document using asppdf service. Here are some steps to be followed:&lt;br /&gt;1. downloading and installing asppdf&lt;br /&gt;2. Integration with application&lt;br /&gt;3. coding for creation the pdf document&lt;br /&gt;&lt;br /&gt;Mainly I prefer asppdf for creating PDF directly from a web URL. When I tried to use iTextSharp for converting a html or aspx page to PDF then it got stuck and my project exposed to risk of failing to satisfying some basic needs. However, here I am going to describe them in details&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. downloading and installing asppdf&lt;/span&gt;&lt;br /&gt;one can download a 30-days free trial from the following URL:&lt;br /&gt;http://asppdf.com/download.html&lt;br /&gt;and then will provide a key which should be used during installation. After installing you will get a .dll in Bin folder of the installation directory.This dll is the object to work with.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. Integration with application&lt;/span&gt;&lt;br /&gt;You can get the dll from such a path:E:\Program Files\Persits Software\AspPDF\Bin\&lt;br /&gt;Now you have to create a reference to that dll suing VS-200x&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. coding for creation the pdf document&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;using &lt;span style="font-weight: bold;"&gt;ASPPDFLib;&lt;/span&gt; //this is the required namespace of the dll&lt;br /&gt;&lt;br /&gt;    public string createAspPDF(string sourceURL, string destdirectory, string filename)&lt;br /&gt;    {&lt;br /&gt;        string created_pdf_url = string.Empty;&lt;br /&gt;        try {&lt;br /&gt;            HttpContext.Current.Session["access"] = "yes";&lt;br /&gt;            IPdfManager mymanager = new PdfManager();&lt;br /&gt;            IPdfDocument mydocument = mymanager.CreateDocument(System.Reflection.Missing.Value);&lt;br /&gt;            mydocument.ImportFromUrl(sourceURL, Missing.Value, Missing.Value, Missing.Value);&lt;br /&gt;            String myfilename = mydocument.Save(HttpContext.Current.Server.MapPath(destdirectory) + filename, true);&lt;br /&gt;            created_pdf_url = destdirectory + myfilename;&lt;br /&gt;        }&lt;br /&gt;        catch (Exception exc) {&lt;br /&gt;            return exc.Message;&lt;br /&gt;        }&lt;br /&gt;        return created_pdf_url;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;where, sourceURL="http://www.nochallenge.net/biznesmakler"&lt;br /&gt;destdirectory=destination directory in biznesmakler,&lt;br /&gt;filename=file name for the pdf file,&lt;br /&gt;created_pdf_url=the url of pdf file just created.&lt;br /&gt;&lt;br /&gt;So that is the way to deal with pdf directly from a web url.&lt;br /&gt;&lt;br /&gt;thx&lt;br /&gt;Masud (1-9-2009)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-5514478052309907190?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/5514478052309907190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2010/01/creating-pdf-using-asppdf-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/5514478052309907190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/5514478052309907190'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2010/01/creating-pdf-using-asppdf-service.html' title='Creating PDF using ASPpdf service'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-4606890548517499753</id><published>2009-12-26T05:27:00.000-08:00</published><updated>2009-12-26T05:41:53.377-08:00</updated><title type='text'>Creating PDF file using ASP.NET,C#</title><content type='html'>This is an interesting thing to accomplish creating PDF file in ASP.NET ,C#. Let me share with you the techniques of creating PDF. Here are the following steps.&lt;br /&gt;step-1: download the following itextsharp .dll from the &lt;a href="http://www.lowagie.com/iText"&gt;following link&lt;/a&gt;&lt;br /&gt;step-2: Add reference to the .dll in your project using Visual studio&lt;br /&gt;step-3: Now use the following code only to create a simple paragraph in .pdf file.&lt;br /&gt;  //creating pdf source code&lt;br /&gt;            try {&lt;br /&gt;                Document mydoc = new Document(PageSize.A4.Rotate());&lt;br /&gt;                PdfWriter.GetInstance(mydoc,new FileStream("masud.pdf",FileMode.Create));&lt;br /&gt;                mydoc.Open();&lt;br /&gt;                mydoc.Add(new Paragraph("This is the first paragraph written by me"));&lt;br /&gt;                mydoc.Close();&lt;br /&gt;                MessageBox.Show("PDF created successfully!");&lt;br /&gt;                &lt;br /&gt;            }&lt;br /&gt;            catch (Exception exc)&lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show("Failed to create PDF file"+exc.Message);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;This is how you can create PDF uisng some dll. So interesting!&lt;br /&gt;&lt;br /&gt;thanks. Masud (26-12-2009)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-4606890548517499753?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/4606890548517499753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/12/this-is-interesting-thing-to-accomplish.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/4606890548517499753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/4606890548517499753'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/12/this-is-interesting-thing-to-accomplish.html' title='Creating PDF file using ASP.NET,C#'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-6697010592133490698</id><published>2009-11-12T08:37:00.000-08:00</published><updated>2009-11-12T09:31:15.044-08:00</updated><title type='text'>Working With Google Checkout</title><content type='html'>Recently I have worked on shopping cart using Google checkout.This is quite easy to work with Google checkout rather than Paypal or others. However, I will be describing here in brief:&lt;br /&gt;&lt;br /&gt;Steps:&lt;br /&gt;1.Shopping cart account in Google&lt;br /&gt;2.Downloading GCheckout.dll and installing in VS.&lt;br /&gt;3.Working with GCheckout Button.&lt;br /&gt;&lt;br /&gt;Here I will be describing in details.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1.Shopping cart account in Google&lt;/strong&gt;&lt;br /&gt;Generally for this you will have to have a google account. And using this account you can create shopping cart account. So if you have account then do the following.&lt;br /&gt;a. log in to Google.&lt;br /&gt;b. visit https://sandbox.google.com/checkout/main&lt;br /&gt;c. Here you will find a control panel having 'Edit Payment Method'. Here you will put your credit card info to which customer will pay you. And also some other info you have to pay like country, city, shipping address etc.&lt;br /&gt;d. Then go to main panel and collect Merchant ID, Merchant Key which will be used in your website for accessing the shopping cart account. Generally&lt;br /&gt;these keys will be generated by Google.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.GCheckout.dll&lt;/strong&gt;&lt;br /&gt;a.You can make a Google search and download this dll. For Asp.net developer, there is a .NET version of GCheckout. You have to download that. After downloading this dll you have to &lt;b&gt;Add reference&lt;/b&gt; to this dll and in this way, the dll will be copied to website Bin directory.&lt;br /&gt;b. Add reference: Solution Explorer&gt;Website Name&gt;Add Reference&gt;browse the dll&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.Working With GCheckout Button&lt;/strong&gt;&lt;br /&gt;To work with GCheckout Button you have to do the following:&lt;br /&gt;&lt;br&gt;&lt;br /&gt;a.Toolbox&gt;Choose Item&gt;browse dll.&lt;br /&gt;This way  new controls (dll) will be shown up in toolbox (GCheckoutButton,GCheckoutDonateButton);&lt;br /&gt;b. Now drag and drop the control to the .aspx page and you will see automatically the following code will be generated.&lt;br /&gt;i. in directive section:&lt;br /&gt;&lt; %@ Register Assembly="GCheckout" Namespace="GCheckout.Checkout" TagPrefix="cc1" % / &gt;&lt;br /&gt;ii.in page body:&lt;br /&gt;&lt; cc1:GCheckoutButton ID="MyGCheckoutButton" runat="server"&lt;br /&gt;           onclick="MyGCheckoutButton_Click" / &gt;&lt;br /&gt;&lt;br /&gt;Here, we see that this button is clicked and handler is generated to handle the event.&lt;br /&gt;c. Web configuration section:&lt;br /&gt;You have to put the following configuration in app setting.&lt;br /&gt;&amp;lt appSettings &amp;gt&lt;br /&gt;    &amp;lt add key="GoogleMerchantID" value="XXXXXXXXXX" /&amp;gt&lt;br /&gt;    &amp;lt add key="GoogleMerchantKey" value="YYYYYYYYYY" /&amp;gt&lt;br /&gt;    &amp;lt add key="GoogleEnvironment" value="Sandbox" /&amp;gt&lt;br /&gt;  &amp;lt /appSettings&gt;&lt;br /&gt;&lt;br /&gt;The Merchant ID and Merchant Keys will have to be inserted in the above section to make the system works.&lt;br /&gt;&lt;br /&gt;d. Coding in the Button event handler function.&lt;br /&gt;You have to put the following code in the function:&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt; CheckoutShoppingCartRequest chkoutShoppingCartReq = MyGCheckoutButton.CreateRequest();&lt;br /&gt;            chkoutShoppingCartReq.AddItem("Business Plan: Plan No"+Session["PlanID"], "Business Plan Consultancy Fee", decimal.Parse(Session["PlanCost"].ToString()), 1);&lt;br /&gt;            GCheckoutResponse obtainedResponse = chkoutShoppingCartReq.Send();&lt;br /&gt;            Response.Redirect(obtainedResponse.RedirectUrl, true);&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Here obtainedResponse.RedirectUrl is the URL to which website will be redirected for payment.&lt;br /&gt;e.When you will be working in the Setting in Merchant Account you have to generally set the thank you page (for payment) as the redirect URL so that after successful payment, the user can be acknowledged that his/her payment is received successfully and he/she is free to go.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is the way..Google Checkout works.&lt;br /&gt;&lt;br /&gt;Thanks. Masud (13-11-2009)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-6697010592133490698?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/6697010592133490698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/11/working-with-google-checkout.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6697010592133490698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6697010592133490698'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/11/working-with-google-checkout.html' title='Working With Google Checkout'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-6334353740969666624</id><published>2009-09-17T03:18:00.000-07:00</published><updated>2010-10-18T07:40:16.609-07:00</updated><title type='text'>Some CSS tips I used</title><content type='html'>I was not that much recognized in CSS but nowadays I found that CSS has a great power to turn the website into an online space. Here is something I worked:&lt;br /&gt;&lt;br /&gt;1. padding&gt; padding used to shift the text from the original space it was supposed to stay.&lt;br /&gt;padding-left:10px;&lt;br /&gt;2. no wrap&gt;It removes line break inside the text&lt;br /&gt;&lt;br /&gt;&lt;span class="mytext"&gt;&lt;br /&gt;my value&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;view:&lt;br /&gt;   myvalue&lt;br /&gt;&lt;br /&gt;CSS File:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;.mytext&lt;br /&gt;{&lt;br /&gt;padding-left:10px;&lt;br /&gt;white-space:nowrap;&lt;br /&gt;} &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Often these two things are very useful.&lt;br /&gt;&lt;br /&gt;Masud (17-07-2009)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-6334353740969666624?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/6334353740969666624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/09/some-css-tips-i-used.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6334353740969666624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6334353740969666624'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/09/some-css-tips-i-used.html' title='Some CSS tips I used'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-9193985496317329152</id><published>2009-09-05T02:39:00.000-07:00</published><updated>2009-09-05T03:15:53.973-07:00</updated><title type='text'>A bunch of tricky problems and solution</title><content type='html'>This weekend I faced a bunch of tricky problems that I solved after working hard on it. Here is a little description for that: Actually I am being a bit informal in case of description. I will be just copy and paste the report I used in my business.&lt;br /&gt;&lt;br /&gt;1.a: &lt;span style="font-weight: bold;"&gt;Notorious problem for coping one whole page to other&lt;/span&gt;&lt;br /&gt;Once upon a time I designed some pages according to some provided pages like&lt;br /&gt;index.aspx buyabiz.aspx&lt;br /&gt;I designed new pages like indexc.aspx or buyabizc.aspx. and so far I was working on it....&lt;br /&gt;but the page name remain index.aspx....for it.which cause notorious problem to make ur head hung. It will give undefined errors. So we have to be careful.&lt;br /&gt;&lt;br /&gt;2. I learned to use &lt;span style="font-weight: bold;"&gt;as&lt;/span&gt; in stored procedure that reduces the query size. Let me explain with an example:&lt;br /&gt;&lt;br /&gt;select C.CityName, V.Voivodeship from City as C, VoivodeshipInfo as V where C.VoivodeshipID=V.VoivodeshipID order by C.CityName&lt;br /&gt;&lt;br /&gt;3. Use of &lt;span style="font-weight: bold;"&gt;nvarchar(50)&lt;/span&gt; will save only 50 chars from the input taken&lt;br /&gt;4.&lt;span style="font-weight: bold;"&gt; Negative balance showing:&lt;/span&gt;&lt;br /&gt;This is a very typical problem. When u try to format in currency in this way:&lt;br /&gt;string.Format("{0:C}",-25.50)..result is ($25.50)....:-)&lt;br /&gt;This is a killing me problem. I used the picture format notation to solve this problem. The format I used is:&lt;br /&gt;&lt;br /&gt;string.Format("{0:$#,#.00}",-25.50)..output is -$25.50 which I expected.&lt;br /&gt;&lt;br /&gt;5.&lt;span style="font-weight: bold;"&gt;Look at this:&lt;/span&gt;&lt;br /&gt;a.select DateTime, Name from Timetable as T where DateTime='2/9/2009': fails&lt;br /&gt;b.select DateTime, Name from Timetable as T where T.DateTime='2/9/2009':works&lt;br /&gt;&lt;br /&gt;here 5.a is incorrect but b will correct&lt;br /&gt;&lt;br /&gt;6.&lt;span style="font-weight: bold;"&gt;To edit a column from SQL server Mgmt studio&lt;/span&gt; :&lt;br /&gt;Table&gt;Columns&gt;Modify...&lt;br /&gt;&lt;br /&gt;The column must allow null and have a default binding value&lt;br /&gt;7. &lt;span style="font-weight: bold;"&gt;In CSS design:&lt;/span&gt;&lt;br /&gt;display:none ---hides the control&lt;br /&gt;&lt;br /&gt;lets look at it:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;#menunav ul li:hover #submenu&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;display:block;&lt;br /&gt;width:115px;&lt;br /&gt;height:100px;&lt;br /&gt;}&lt;br /&gt;This is the hover syntax in css. when mouse is hovered on submneu-title then the&lt;br /&gt;submenu is displayed and otherwise it is hidden.&lt;br /&gt;&lt;br /&gt;8. when to redirect using the syntax in LinkButton or Response object:&lt;br /&gt;&lt;br /&gt;Response.Redirect("www.cse.com"); won't work because it searches a page within ur website called www.cse.com.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;Response.Redirect("&lt;span style="font-weight: bold;"&gt;http://&lt;/span&gt;www.cse.com");&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-9193985496317329152?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/9193985496317329152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/09/bunch-of-tricky-problems-and-solution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/9193985496317329152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/9193985496317329152'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/09/bunch-of-tricky-problems-and-solution.html' title='A bunch of tricky problems and solution'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-1925632680157696209</id><published>2009-08-25T03:45:00.000-07:00</published><updated>2009-08-25T04:06:31.702-07:00</updated><title type='text'>Adding command to Item in DataList</title><content type='html'>This is much simple and I did it without tutorial from the context of command knowledge.Lets make an overview here. Here is the HTML code that adds a command to the link button which is a control of a DataList Item:&lt;br /&gt;&lt;br /&gt;1. HTML code&lt;br /&gt;&amp;lt asp:DataList &amp;gt&lt;br /&gt;&amp;lt ItemTemplate &amp;gt&lt;br /&gt;&amp;lt ItemTemplate &amp;gt     &lt;br /&gt;&amp;lt asp:LinkButton ID="hypTest" runat="server" CommandName="MySelect" &amp;gt&amp;lt strong &amp;gt&amp;lt %# DataBinder.Eval(Container.DataItem, "BusinessName") % &amp;gt&amp;lt /strong &amp;gt&amp;lt /asp:LinkButton &amp;gt&lt;br /&gt;&amp;lt br / &amp;gt&lt;br /&gt;&amp;lt asp:Label runat="server" Text='&amp;lt %# DataBinder.Eval(Container.DataItem, "ShortDescription") % &amp;gt' BorderStyle="None" Height="48px" Width="180px"  &amp;gt&amp;lt /asp:Label &amp;gt&lt;br /&gt;&amp;lt asp:Label ID="conidLabel" runat="server" Text='&amp;lt %# "contractordetails.aspx?conid=" + DataBinder.Eval(Container.DataItem, "contractorid") % &amp;gt' Visible="false"  &amp;gt&amp;lt /asp:Label &amp;gt&lt;br /&gt;&amp;lt asp:Label ID="contid" runat="server" Text='&amp;lt %#Eval("contractorid") % &amp;gt' Visible="false" &amp;gt&amp;lt /asp:Label &amp;gt&lt;br /&gt;&amp;lt br / &amp;gt&lt;br /&gt;&amp;lt /ItemTemplate &amp;gt&lt;br /&gt;&amp;lt /ItemTemplate &amp;gt&lt;br /&gt;&amp;lt /asp:DataList &amp;gt&lt;br /&gt;&lt;br /&gt;Here we can see that how a command is added to the link button for issuing command which we will use later.&lt;br /&gt;&lt;br /&gt;2. Programmer's Task:&lt;br /&gt;Here is the code what programmer will do. Actually here I have done a code for updating balance for a contractor for each client click.&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;            DataListItem myselectedItem = e.Item;&lt;br /&gt;            Label myLabel = myselectedItem.FindControl("conidLabel") as Label;&lt;br /&gt;            Label contid = myselectedItem.FindControl("contid") as Label;&lt;br /&gt;&lt;br /&gt;            &lt;br /&gt;            if (e.CommandName == "MySelect")&lt;br /&gt;            {&lt;br /&gt;                &lt;br /&gt;                /*click fee handling code:here*/&lt;br /&gt;                try&lt;br /&gt;                {&lt;br /&gt;                    &lt;br /&gt;                    int catid = int.Parse(Session["catid"].ToString());&lt;br /&gt;                    float clickfee = 0;&lt;br /&gt;&lt;br /&gt;                    /*getting click fee*/&lt;br /&gt;                    try {&lt;br /&gt;                        Category category = new Category();&lt;br /&gt;                        if (category.LoadByPrimaryKey(catid))&lt;br /&gt;                        {&lt;br /&gt;                            clickfee =float.Parse( category.ClickFee.ToString());&lt;br /&gt;                        }&lt;br /&gt;                        /*click fee obtained*/&lt;br /&gt;                        &lt;br /&gt;                    }&lt;br /&gt;                    catch (Exception exc) {&lt;br /&gt;                        StatusLabel.ForeColor = Color.Red;&lt;br /&gt;                        StatusLabel.Text = "Failed to retrieve click fee!";&lt;br /&gt;                    }&lt;br /&gt;                    &lt;br /&gt;                    /*subtracting from balance*/&lt;br /&gt;                    try {&lt;br /&gt;                        Contractor contractor = new Contractor();&lt;br /&gt;                        int contractorid = int.Parse(contid.Text);&lt;br /&gt;                        if (contractor.LoadByPrimaryKey(contractorid))&lt;br /&gt;                        {&lt;br /&gt;                            float currentBalance =float.Parse( contractor.PrepaidAmount.ToString());&lt;br /&gt;                            currentBalance = currentBalance - clickfee;&lt;br /&gt;                            contractor.PrepaidAmount = currentBalance;&lt;br /&gt;                            /*saving change*/&lt;br /&gt;                            contractor.Save();&lt;br /&gt;                        }&lt;br /&gt;                    &lt;br /&gt;                    }&lt;br /&gt;                    catch (Exception exc)&lt;br /&gt;                    {&lt;br /&gt;                        StatusLabel.ForeColor = Color.Red;&lt;br /&gt;                        StatusLabel.Text = "Failed to subtract click fee from balance!";&lt;br /&gt;                    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                }&lt;br /&gt;                catch (Exception exc) { }&lt;br /&gt;&lt;br /&gt;                /*Redirecting to the contractor details page*/&lt;br /&gt;                string redirect_url = myLabel.Text;&lt;br /&gt;                Response.Redirect(redirect_url);&lt;br /&gt;           &lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            //StatusLabel.Text = "done!";&lt;br /&gt;        }&lt;br /&gt;        catch (Exception exc)&lt;br /&gt;        {&lt;br /&gt;            StatusLabel.ForeColor = Color.Red;&lt;br /&gt;            StatusLabel.Text = exc.Message;&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;         &lt;br /&gt;Here we can see we can get the selected item using &lt;br /&gt;DataListItem myselectedItem=e.Item;&lt;br /&gt;whereas for getting the selected row from GridView we had to do a lot of work.&lt;br /&gt;However, Now we can access this item for further operation like getting some hidden value and use them for further operatiuons:&lt;br /&gt;&lt;br /&gt;         Label myLabel = myselectedItem.FindControl("conidLabel") as Label;&lt;br /&gt;         Label contid = myselectedItem.FindControl("contid") as Label;&lt;br /&gt;&lt;br /&gt;I think this will help.&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;Masud (25-08-2009)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-1925632680157696209?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/1925632680157696209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/08/adding-command-to-item-in-datalist.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1925632680157696209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1925632680157696209'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/08/adding-command-to-item-in-datalist.html' title='Adding command to Item in DataList'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-9187657826479501147</id><published>2009-08-15T08:47:00.000-07:00</published><updated>2009-08-15T08:56:55.951-07:00</updated><title type='text'>Selecting a item from Dropdownlist</title><content type='html'>This is an interesting thing I did few days ago while I was working in my office. Suppose the DDL(Dropdownlist) is containing some items. You wanna select one from the list programmatically at runtime. Generally at first I tried to do in this way:&lt;br /&gt;&lt;br /&gt;MyDDL.Text="item text";&lt;br /&gt;But this will not work and actually it will not also show any error. You will just try and try but nothing will happen. So we need to click the right way.&lt;br /&gt;&lt;br /&gt;As we already saw the two things for databound DDL is:&lt;br /&gt;* DataTextField&lt;br /&gt;* DataValueField&lt;br /&gt;&lt;br /&gt;Suppose Subcategorydesc=dataTextField&lt;br /&gt;        SubCatID=datavaluefield&lt;br /&gt;&lt;br /&gt;And we want to select a subcategory called "Marketing" having subcatid=3. Then the code will be like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;MyDDL.Items.getByValue("3").Selected=true;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;thanks&lt;br /&gt;Masud.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-9187657826479501147?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/9187657826479501147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/08/selecting-item-from-dropdownlist.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/9187657826479501147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/9187657826479501147'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/08/selecting-item-from-dropdownlist.html' title='Selecting a item from Dropdownlist'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-7689537846234188493</id><published>2009-08-05T06:59:00.000-07:00</published><updated>2009-08-05T07:37:31.743-07:00</updated><title type='text'>Gridview editing problem: Textbox cant store new value in the editing mode</title><content type='html'>This is a common problem I have faced during my work. Every events are properly handled you will not get the new value in the update time. This is ridiculous thing and often your head can be cracked. But the solution to this problem is quite simple. Lets look at the example that I did....&lt;br /&gt;&lt;br /&gt;Suppose this is the code for Update:&lt;br /&gt;&lt;br /&gt;protected void ImgGridView_RowUpdating(object sender, GridViewUpdateEventArgs e)&lt;br /&gt;   {&lt;br /&gt;          /*Image info to be updated*/&lt;br /&gt;           try {&lt;br /&gt;           /*Extracting different elements from Gridview*/&lt;br /&gt;           GridViewRow myRow = ImgGridView.Rows[e.RowIndex];&lt;br /&gt;           /*getting pic id*/&lt;br /&gt;           Label PicIDLabel = myRow.Cells[2].FindControl("PicIDLabel") as Label;&lt;br /&gt;           /*getting image title*/&lt;br /&gt;           TextBox titleTextBox = myRow.Cells[1].FindControl("ImgTitleTextBox") as TextBox;&lt;br /&gt;          &lt;br /&gt;&lt;br /&gt;           /*updating ad image*/&lt;br /&gt;           AdImage adImage = new AdImage();&lt;br /&gt;           adImage.ConnectionString = ConfigurationManager.ConnectionStrings["BIZNESConnectionString"].ConnectionString;&lt;br /&gt;           if(adImage.LoadByPrimaryKey(short.Parse(PicIDLabel.Text)))&lt;br /&gt;           {&lt;br /&gt;              adImage.ImgTitle=titleTextBox.Text;&lt;br /&gt;             &lt;br /&gt;              adImage.Save();&lt;br /&gt;             &lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           ImgGridView.EditIndex = -1;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;showAdImageInfo();&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;        StatusLabel.ForeColor=Color.Green;&lt;br /&gt;        StatusLabel.Text="Image information updated successfully!";&lt;br /&gt;        StatusImage.ImageUrl = "adimages/ok.gif";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;       catch (Exception exc)&lt;br /&gt;       {&lt;br /&gt;           StatusLabel.Text = exc.Message;&lt;br /&gt;      &lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;So found no problem in update code every time I debug the code ....I spend the whole day on it and at last I found a forum that probably I have to check for autopostback option of the page.&lt;br /&gt;So my Page_Load was like this:&lt;br /&gt;  protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;            string access = (string)Session["access"];&lt;br /&gt;            /*checking access*/&lt;br /&gt;            if (access != "yes")&lt;br /&gt;                Response.Redirect("SellerAdminLogin.aspx"&lt;br /&gt;            &lt;br /&gt;            /*showing images*/&lt;br /&gt;            showAdImageInfo();&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;For that killing problem to resolve we have to check the postback option. Lets look at the editing function:&lt;br /&gt;&lt;br /&gt; protected void ImgGridView_RowEditing(object sender, GridViewEditEventArgs e)&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        /*Image editing code*/&lt;br /&gt;        ImgGridView.EditIndex = e.NewEditIndex;&lt;br /&gt;        showAdImageInfo();&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;If autopost-back is not checked every time gridview will loaded with values from databse so when update command will be clicked then data will be loaded from database to the textbox and new value in the textbox will be lost. So we need to check the auto-postback option:&lt;br /&gt;&lt;br /&gt; protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;           if(!Page.IsAutoPostBack)&lt;br /&gt;{  &lt;br /&gt;            string access = (string)Session["access"];&lt;br /&gt;            /*checking access*/&lt;br /&gt;            if (access != "yes")&lt;br /&gt;                Response.Redirect("SellerAdminLogin.aspx"&lt;br /&gt;            &lt;br /&gt;            /*showing images*/&lt;br /&gt;            showAdImageInfo();&lt;br /&gt;        &lt;br /&gt;}&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;Thus update will easily work and we will be able to update the gridview data&lt;br /&gt;&lt;br /&gt;thanks.&lt;br /&gt;Masud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-7689537846234188493?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/7689537846234188493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/08/gridview-editing-problem-textbox-cant.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/7689537846234188493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/7689537846234188493'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/08/gridview-editing-problem-textbox-cant.html' title='Gridview editing problem: Textbox cant store new value in the editing mode'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-1037976249364548207</id><published>2009-08-04T15:58:00.000-07:00</published><updated>2009-08-04T16:01:56.238-07:00</updated><title type='text'>Image Carousel Tools</title><content type='html'>I came to learn a very interesting thing which is implemented using JQuery and named as Image carousel. I came to learn from my mentor while doing the project &lt;br /&gt;http://nochallenge.net/biznesmakler.&lt;br /&gt;Here I have made some cosmetic customization which evolves the existing carousel to a professional level as said by project manager. However I will be dealing with next couple of my posting with image carousel as well as lightBox slideshow&lt;br /&gt;&lt;br /&gt;thanks.&lt;br /&gt;Masud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-1037976249364548207?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/1037976249364548207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/08/image-carousel-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1037976249364548207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1037976249364548207'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/08/image-carousel-tools.html' title='Image Carousel Tools'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-2742329488067826339</id><published>2009-08-04T15:33:00.000-07:00</published><updated>2009-08-04T15:49:08.187-07:00</updated><title type='text'>Adding Select text in databound Dropdownlist</title><content type='html'>To create a data-bound dropdownlist we have to follow several steps. This time we are using Business entity which is CSharp Business Entity template and it is same as creating the business object. Suppose a business entity Category having three fields.&lt;br /&gt;&lt;br /&gt;Category:&lt;br /&gt;CatID&lt;br /&gt;CatDescription&lt;br /&gt;Active &lt;br /&gt;&lt;br /&gt;Now we want to make a databound dropdownlist(DDL). Lets call the dropdownlist is CatDropDownList. So we have 2 steps:&lt;br /&gt;1. Creating databound DDL&lt;br /&gt;2. Inserting select text&lt;br /&gt;&lt;br /&gt;Here we go:&lt;br /&gt;1. Creating databound DDL.&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;Category category=new Category();&lt;br /&gt;&lt;br /&gt;/*Generating and executing query*/&lt;br /&gt;category.Query.AddResultColumn(Category.ColumnNames.CatID);&lt;br /&gt;category.Query.AddResultColumn(Category.ColumnNames.CatDescription);&lt;br /&gt;category.Query.Load();&lt;br /&gt;&lt;br /&gt;/*databinding*/&lt;br /&gt;this.CatDropDownList.Datasource=category.DefaultView;&lt;br /&gt;this.CatDropDownList.DataTextField=Category.ColumnNames.CatDescription;&lt;br /&gt;this.CatDropDownList.DataValueField=Category.ColumnNames.CatID;&lt;br /&gt;this.CatDropDownList.DataBind();&lt;br /&gt;&lt;br /&gt;2.Inserting Select text:&lt;br /&gt;Generally if you add item now then DDL will not retain that item. this time you have to insert the values in the DDL. The required code is:&lt;br /&gt;this.CatDropDownList.Items.Insert(0,"select a category");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;catch(Exception exc){}&lt;br /&gt;&lt;br /&gt;Now comes how use the value selected by the DDL.This is quite simple.&lt;br /&gt;int selectedCatID=Convert.ToInt32(CatDropDownList.SelectedValue);&lt;br /&gt;here selectedCatID will give the selected CatID of the category you selected....&lt;br /&gt;&lt;br /&gt;Thanks.&lt;br /&gt;Masud (5.8.9)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-2742329488067826339?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/2742329488067826339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/08/adding-select-text-in-databound.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/2742329488067826339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/2742329488067826339'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/08/adding-select-text-in-databound.html' title='Adding Select text in databound Dropdownlist'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-7993923991293196615</id><published>2009-07-24T16:05:00.000-07:00</published><updated>2009-07-24T16:12:52.855-07:00</updated><title type='text'>Adding cc and bcc in MailMessage</title><content type='html'>This is a pretty little thing but it may cause sometimes a lot of problem when you are implementing the email function. Suppose you are using System.Net.Mail namespace for implementing email functionality.So code is:&lt;br /&gt;&lt;br /&gt;using System.Net.Mail;&lt;br /&gt;&lt;br /&gt;MailMessage msg=new MailMessage("from@gmail.com","to@gmail.com");&lt;br /&gt;msg.CC="masudcseku@gmail.com"; /*Error*/&lt;br /&gt;msg.CC.Add("masudcseku@gmail.com");/*correct*/&lt;br /&gt;&lt;br /&gt;msg.bcc="masud_mnthk@yahoo.com"; /*Error*/&lt;br /&gt;msg.bcc.Add("masud_mnthk@yahoo.com");/*correct*/&lt;br /&gt;&lt;br /&gt;This is a pretty little thing huh!...but often this will be useful.&lt;br /&gt;**************************************&lt;br /&gt;Masud(7.25.2009)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-7993923991293196615?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/7993923991293196615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/07/adding-cc-and-bcc-in-mailmessage.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/7993923991293196615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/7993923991293196615'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/07/adding-cc-and-bcc-in-mailmessage.html' title='Adding cc and bcc in MailMessage'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-1103602240829647570</id><published>2009-07-24T15:54:00.000-07:00</published><updated>2009-07-24T16:03:44.257-07:00</updated><title type='text'>Issuing a javascript object by ASP.NET at load time</title><content type='html'>This is a nice feature ASP.NET provides that ASP.NET is providing a javascript object populated with data which can be used by client-side script very effectively. Let see this step by step.&lt;br /&gt;Steps:&lt;br /&gt;1. Suppose in ASP.NET you are using some variable (ex:testaskingprices) having some value. Now you want to transfer this value to access by the client-side code. So then you have execute this code in Page_Load event of page&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;this.ClientScript.RegisterArrayDeclaration("myAskPriceList", testaskingprices);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;where&lt;br /&gt;testaskingprices=the ASP.NET variable&lt;br /&gt;myAskPriceList=the javascript variable issued for use&lt;br /&gt;&lt;br /&gt;**************************************&lt;br /&gt;Masud (25.7.9)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-1103602240829647570?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/1103602240829647570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/07/issuing-javascript-object-by-aspnet-at.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1103602240829647570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1103602240829647570'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/07/issuing-javascript-object-by-aspnet-at.html' title='Issuing a javascript object by ASP.NET at load time'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-6557804601589145533</id><published>2009-07-14T13:58:00.000-07:00</published><updated>2009-07-14T14:09:54.539-07:00</updated><title type='text'>Allowing paging in Gridview when datasource is not predefined</title><content type='html'>Suppose you are not setting predefined data source means you are not using sqldatasource as the data source then this article is helpful for enabling the paging option. Suppose you will determine data source at run-time means you are using SqldataAdapter then u are welcome:&lt;br /&gt;&lt;br /&gt;In the html code of Gridview you have to set AllowPaging="true"&lt;br /&gt;&lt;br /&gt;Here is the code for handling paging manualy:&lt;br /&gt;protected void TestGV_pageIndexChanging(object sender, GridViewPageEvent e)&lt;br /&gt;{&lt;br /&gt;  TestGV.pageIndex=e.NewPageIndex;&lt;br /&gt;  TestGV.dataBind();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Here we see page index is updated as the index of page changes. By default page size=10 however it can be changed in the html code of Gridview.&lt;br /&gt;&lt;br /&gt;Thats for today&lt;br /&gt;Masud (15.7.9)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-6557804601589145533?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/6557804601589145533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/07/allowing-paging-in-gridview-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6557804601589145533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6557804601589145533'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/07/allowing-paging-in-gridview-when.html' title='Allowing paging in Gridview when datasource is not predefined'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-6204257077977961129</id><published>2009-07-14T13:37:00.000-07:00</published><updated>2009-07-14T13:53:09.999-07:00</updated><title type='text'>Removing underline from a hyper link</title><content type='html'>This is a nice thing and expected attribute often. This time we have to take the help of Cascading Style sheet. Here we should follow 2 steps:&lt;br /&gt;1. define a class in css file&lt;br /&gt;2. apply the class to the control&lt;br /&gt;&lt;br /&gt;Lets discuss:&lt;br /&gt;1.class hyp in css file:&lt;br /&gt;.hyp&lt;br /&gt;{&lt;br /&gt;font-weight:bold;&lt;br /&gt;display:run-in; &lt;br /&gt;text-decoration:none;   &lt;br /&gt;cursor:pointer;&lt;br /&gt;}&lt;br /&gt;Here text-decoration is set to none therefore underline will not be shown.&lt;br /&gt;2. using class to the control:&lt;br /&gt;&amp;lt;asp:HyperLink ID=&amp;quot;mylink&amp;quot; runat=&amp;quot;server&amp;quot; CssClass=&amp;quot;hyp&amp;quot; NavigateUrl=&amp;quot;mypage.aspx&amp;quot;&amp;gt;&lt;br /&gt;Go to my page&lt;br /&gt;&amp;lt;/asp:HyperLink&amp;gt;&lt;br /&gt;&lt;br /&gt;Here we see that css class is set to the control but one thing must be done while using the css class. Css file must be linked to the page in head section. Here is that code&lt;br /&gt;&lt;br /&gt;&amp;lt;link href=&amp;quot;default.css&amp;quot; type=&amp;quot;text/css&amp;quot; rel=&amp;quot;Stylesheet&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;I think this will be helpful.&lt;br /&gt;&lt;br /&gt;thanks.&lt;br /&gt;Masud (15.7.9)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-6204257077977961129?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/6204257077977961129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/07/removing-underline-from-hyper-link.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6204257077977961129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/6204257077977961129'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/07/removing-underline-from-hyper-link.html' title='Removing underline from a hyper link'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-5241314220832620765</id><published>2009-07-14T02:07:00.000-07:00</published><updated>2009-07-14T12:59:57.747-07:00</updated><title type='text'>Formatting data in Gridview cell</title><content type='html'>This is an important thing u need when working with grid-view. Suppose u want to format the numerical data in currency form or date form then you have to do a little trick.&lt;br /&gt;Suppose your column name is &lt;br /&gt;"Amount" should be shown as currency (ex: $100)&lt;br /&gt;"PaymentDate" should be shown as date (ex:7/12/2009), generally SQL 2005 will show it as (7/12/2009 12.00 AM) which is a bad format.&lt;br /&gt;&lt;br /&gt;so lets check it out. Suppose we are using TemplatedField in GridView and as field we are using labels ..so the code like this.&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:GridView ID=&amp;quot;TestGV&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;Columns&amp;gt;&lt;br /&gt;&amp;lt;asp:TemplatedField&amp;gt;&lt;br /&gt;&amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;asp:Label ID=&amp;quot;CurrencyLabel&amp;quot; runat=&amp;quot;server&amp;quot; Text='&amp;lt;%#String.Format(&amp;quot;{0:c}&amp;quot;,Eval(&amp;quot;Amount&amp;quot;))%&amp;gt;' &amp;gt; &amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;/asp:TemplatedField&amp;gt;&lt;br /&gt;&amp;lt;asp:TemplatedField&amp;gt;&lt;br /&gt;&amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;asp:Label ID=&amp;quot;PaymentDateLabel&amp;quot; runat=&amp;quot;server&amp;quot; Text='&amp;lt;%#String.Format(&amp;quot;{0:d}&amp;quot;,Eval(&amp;quot;PaymentDate&amp;quot;))%&amp;gt;' &amp;gt; &amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;/asp:TemplatedField&amp;gt;&lt;br /&gt;&amp;lt;/Columns&amp;gt;&lt;br /&gt;&amp;lt;/asp:GridView&amp;gt;&lt;br /&gt;&lt;br /&gt;So this is the required code for converting into the desired format of data.&lt;br /&gt;&lt;br /&gt;thanks.&lt;br /&gt;Masud (15.7.9)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-5241314220832620765?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/5241314220832620765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/07/formatting-data-in-gridview-cell.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/5241314220832620765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/5241314220832620765'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/07/formatting-data-in-gridview-cell.html' title='Formatting data in Gridview cell'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-467364112802731904</id><published>2009-07-13T15:41:00.000-07:00</published><updated>2009-07-13T15:57:03.706-07:00</updated><title type='text'>Adding client side (javascript) function to ASP.NET server contorl</title><content type='html'>This is critical things I was looking for many days..that is how to add javascript event to the server side ASP.NET control. This is very needed often but I could not manage it for a long time. However, this time I got some. We have to follow 2 steps.&lt;br /&gt;1. Define client side function&lt;br /&gt;2. Add function/event to the control.&lt;br /&gt;&lt;br /&gt;1. Define the client side function&lt;br /&gt;Suppose a text box...I want to  limit total chars in it is 100. If we want to use javascript for this then code will be like this. This code will be scripted in the .aspx page...that means will be in the script tag in the main page.&lt;br /&gt;&lt;br /&gt;function allowInsert(total)  /*here total=100*/&lt;br /&gt;{&lt;br /&gt;   var mybox=document.getElementById("mytextbox");  /* server control ID="mytextbox"*/&lt;br /&gt;   var text=mybox.value;&lt;br /&gt;   var len=text.length;&lt;br /&gt;   int mylen=0;&lt;br /&gt;   mylen=parseInt(len);&lt;br /&gt; &lt;br /&gt;   /*testing condition*/&lt;br /&gt;   if(mylen&lt; total)return true;&lt;br /&gt;   else return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;2. Adding function to the server control&lt;br /&gt;In Page_Load event of .aspx.cs (code-behind) page we have to add the following line&lt;br /&gt;Let mytextbox is the ID of the control.So....&lt;br /&gt;mytextbox.Attributes.Add("onkeyup","javascript:return allowInsert(100)");&lt;br /&gt;&lt;br /&gt;Now when a char will be entered in mytextbox then each time this function will be checked&lt;br /&gt;whether it is allowed or not.&lt;br /&gt;&lt;br /&gt;thanks.&lt;br /&gt;Masud(14.7.9)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-467364112802731904?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/467364112802731904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/07/adding-client-side-javascript-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/467364112802731904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/467364112802731904'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/07/adding-client-side-javascript-function.html' title='Adding client side (javascript) function to ASP.NET server contorl'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-8928405035353244465</id><published>2009-07-13T15:18:00.000-07:00</published><updated>2009-07-13T15:38:15.242-07:00</updated><title type='text'>Use of stored procedure in a table data show</title><content type='html'>Most of us heard about the stored procedure. I also heard about it but I could not know how to use it. However stored procedure is very helpful for the big queries which is tough to build every time we use. So centrally a function/procedure is stored and called when we need that certain actions it perform....so this is called stored procedure. Here are some tips about stored procedure.&lt;br /&gt;&lt;br /&gt;1.create a stored procedure:&lt;br /&gt;How to build a stored procedure: Suppose u want to show info of the students of CSE discipline.&lt;br /&gt;So the code is:&lt;br /&gt;&lt;br /&gt;CREATE procedure  dbo.showAllInfo&lt;br /&gt;(&lt;br /&gt;  /*parameter list*/&lt;br /&gt;    @discipline varchar(50)&lt;br /&gt;&lt;br /&gt;)&lt;br /&gt;as&lt;br /&gt;select * from Student where discipline=@discipline&lt;br /&gt;&lt;br /&gt;EXEC dbo.showAllInfo&lt;br /&gt;&lt;br /&gt;Now save the document using any name and execute this sql in VS or any other tools that has access to DB. When it is executed successfully then you will see a new entry called showAllInfo in the stored procedure folder of your DB.&lt;br /&gt;&lt;br /&gt;2. Use of stored procedure&lt;br /&gt;Here is how to use stored procedure. Lets take a glance on it. Let we are using SqlConnection object.&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;SqlConnection conn=new SqlConnection(ConfigurationManager.ConnectionStrings["MASUDDBConnectionString"].ConnectionString);&lt;br /&gt;conn.open();&lt;br /&gt;SqlCommand comm=new SqlCommand();&lt;br /&gt;comm.Connection=conn;&lt;br /&gt;comm.CommandText="showAllInfo";&lt;br /&gt;comm.CommandType=CommandType.StoredProcedure;&lt;br /&gt;comm.Parameters.AddWithValue("discipline","ParamValue");   /*paramvalue=CSE*/&lt;br /&gt;&lt;br /&gt;SqlDataAdapter sda=new SqlDataAdapter(comm);&lt;br /&gt;DataTable dt=new DataTable();&lt;br /&gt;sda.Fill(dt);&lt;br /&gt;&lt;br /&gt;/*databinding*/&lt;br /&gt;SomeGridView.dataSource=dt;&lt;br /&gt;SomeGridView.dataBind();&lt;br /&gt;&lt;br /&gt;/*results rendered successfully*/&lt;br /&gt;&lt;br /&gt;/*closing conn*/&lt;br /&gt;sda.Dispose();&lt;br /&gt;conn.Close();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;catch(Exception exc)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-8928405035353244465?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/8928405035353244465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/07/use-of-stored-procedure-in-table-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/8928405035353244465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/8928405035353244465'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/07/use-of-stored-procedure-in-table-data.html' title='Use of stored procedure in a table data show'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-2064065517270883313</id><published>2009-07-13T15:09:00.000-07:00</published><updated>2009-07-13T15:16:13.776-07:00</updated><title type='text'>Updating an entry of table using mygeneration tool</title><content type='html'>To change an entry of the table is also interesting and easy. You don't need to write an update query or even think of creating and closing a sql connection...even no chance to hurt a primary key also. Just follow these steps. Lets consider the Admin table. Suppose Admin wants to change the password having AdminID=5. So here lies the following code:&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;Admin admin=new Admin();&lt;br /&gt;admin.ConnectionString=ConfigurationManager.ConnectionStrings["MASUDDBConnectionString"].&lt;br /&gt;ConnectionString;&lt;br /&gt;if(admin.LoadByPrimaryKey(5))&lt;br /&gt;{&lt;br /&gt;   admin.AdminPassword="new password";&lt;br /&gt;   admin.Save();&lt;br /&gt;   /*entry updated successfully*/&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;catch(Exception exc)&lt;br /&gt;{&lt;br /&gt;/*error notification*/&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;So this is the easiest way to update a table entry as I believe. what do you think about this?&lt;br /&gt;&lt;br /&gt;thanks&lt;br /&gt;Masud(14.7.9)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-2064065517270883313?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/2064065517270883313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/07/updating-entry-of-table-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/2064065517270883313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/2064065517270883313'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/07/updating-entry-of-table-using.html' title='Updating an entry of table using mygeneration tool'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-4407123574428854633</id><published>2009-07-13T14:49:00.000-07:00</published><updated>2009-07-13T15:08:00.099-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Showing entry of table using mygeneration'/><title type='text'>How to show a table data with mygeneration business object?</title><content type='html'>As from the last blog we came to learn about how to add a new entry in the table without any touch to the table. Lets consider the admin table. So we have got the following things already in hand:&lt;br /&gt;1. _Admin.cs (Abstract class)&lt;br /&gt;2. Admin.cs (Extension of _Admin)&lt;br /&gt;3. Admin.sql (All doodad's stored procedures)&lt;br /&gt;&lt;br /&gt;And it is expected we have already added some rows to the table. Now comes how we can show the value from the table. This is the most interesting part of mygeneration tool. You have 2 options&lt;br /&gt;a. show values of  one item&lt;br /&gt;b. show values of all items in table&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;show values of one item:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is quite easy. Here is the code following.&lt;br /&gt;Suppose AdminID of Admin table is 5. So the following code shows Admin's info having AdminID=5.&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;Admin admin=new Admin();&lt;br /&gt;admin.ConnectionString=ConfiguraionManager.ConnectionStrings["MASUDDBConnectionString"].&lt;br /&gt;ConnectionString;&lt;br /&gt;if(admin.LoadByPrimaryKey(5))&lt;br /&gt;{&lt;br /&gt;/*Loaded the single instance*/&lt;br /&gt;&lt;br /&gt;  Response.write("Email:"+admin.AdminEmail+"  Admin Pass:"+admin.AdminPassword+"&lt;br /&gt;");&lt;br /&gt;  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;catch(Exception exc)&lt;br /&gt;{}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;show values for all items:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;--------&lt;br /&gt;same as previous&lt;br /&gt;--------&lt;br /&gt;if(admin.LoadByAll())&lt;br /&gt;{&lt;br /&gt;/*All instances loaded*/&lt;br /&gt;admin.Rewind(); /*setting pointer to 0th row*/&lt;br /&gt;do&lt;br /&gt;{&lt;br /&gt;Response.write("Email:"+admin.AdminEmail+"  Admin Pass:"+admin.AdminPassword+"&lt;br /&gt;");&lt;br /&gt;&lt;br /&gt;}while(admin.MoveNext());&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch(Exception exc)&lt;br /&gt;{}&lt;br /&gt;&lt;br /&gt;So these are the way to access rows in the table. I think it is quite interesting, isn't it?&lt;br /&gt;&lt;br /&gt;thanks.&lt;br /&gt;Masud (14.7.9)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-4407123574428854633?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/4407123574428854633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/07/how-to-show-table-data-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/4407123574428854633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/4407123574428854633'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/07/how-to-show-table-data-with.html' title='How to show a table data with mygeneration business object?'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-910074157619584461</id><published>2009-07-07T03:36:00.000-07:00</published><updated>2009-07-14T13:31:26.481-07:00</updated><title type='text'>Adding a new entry in tha table (using Mygeneration)</title><content type='html'>If you want to add a new entry in the database table then this topic is going to help you. Let us consider that we have a table in the database called &lt;span style="font-weight: bold;"&gt;Student&lt;/span&gt; and schema like this&lt;br /&gt;&lt;br /&gt;table name: &lt;span style="font-weight: bold;"&gt;Student&lt;/span&gt;&lt;br /&gt;Fields:&lt;br /&gt;{&lt;br /&gt;name varchar(50),&lt;br /&gt;roll varchar(10),&lt;br /&gt;cgpa float,&lt;br /&gt;address varchar(50),&lt;br /&gt;email varchar(50),&lt;br /&gt;birthDate smalldatetime&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;During the creation of table two things must be done:&lt;br /&gt;1. setting a column as an  identity element with auto-increment 1&lt;br /&gt;2. setting that column as the primary key.&lt;br /&gt;Lets consider how this can be done. Suppose Admin is table&lt;br /&gt;lets create the table using a sql query:&lt;br /&gt;&lt;br /&gt;USE BIZNES&lt;br /&gt;go&lt;br /&gt;create table Admin&lt;br /&gt;(&lt;br /&gt;AdminID smallint IDENTITY,&lt;br /&gt;AdminEmail varchar(50),&lt;br /&gt;AdminPassword varchar(50),&lt;br /&gt;Primary key(AdminID)&lt;br /&gt;)&lt;br /&gt;go&lt;br /&gt;SET IDENTITY_INSERT Admin ON&lt;br /&gt;&lt;br /&gt;Another Process:&lt;br /&gt;Suppose you have created table using GUI of SQL server 200x and you want add that constraint.Use the following steps:&lt;br /&gt;a. Right click on table and do to table definition&lt;br /&gt;b. Select the desired column and set&lt;br /&gt;   Identity=Yes&lt;br /&gt;   Autoincrement=1&lt;br /&gt;   Not for replication=Yes&lt;br /&gt;c. Set this column as primary key&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;where BIZNES is the database name. So if you design a table like this using a query&lt;br /&gt;the created table is perfectly suitable for input to mygeneration tool. So please design&lt;br /&gt;your own table setting identity and primary key and generate business objects like _Admin.cs file or other stored procedures.&lt;br /&gt;&lt;br /&gt;We have already learned how to create &lt;span style="font-weight: bold;"&gt;_Student.cs&lt;/span&gt; or&lt;span style="font-weight: bold;"&gt; Student.cs&lt;/span&gt; file. If you are not familiar with this please follow my previous blogs about mygeneration tool. So now a small snippet of code is needed for you to add an entry in the database. That is:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(153, 153, 255);"&gt;Student&lt;/span&gt; std&lt;/span&gt;=new &lt;span style="color: rgb(153, 153, 255);"&gt;Student&lt;/span&gt;();&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;std&lt;/span&gt;.ConnectionString=ConfigurationManager.ConnectionStrings[&lt;span style="color: rgb(255, 153, 0);"&gt;"MASUDDB&lt;br /&gt;ConnectionString"&lt;/span&gt;].ConnectionString;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;std&lt;/span&gt;.AddNew();&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;std&lt;/span&gt;.name="Masud";&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;std&lt;/span&gt;.roll="040201";&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;std&lt;/span&gt;.cgpa=4.63;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;std&lt;/span&gt;.address="Farmgate,Dhaka";&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;std&lt;/span&gt;.email="test@gmail.com";&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;std&lt;/span&gt;.birthDate="25/04/1998";&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;std&lt;/span&gt;.Save();&lt;br /&gt;&lt;br /&gt;This is how a new row or entry is created in database. You don't need an insert query for getting an entry. You can handle all this in a fine manner...isn't it?&lt;br /&gt;&lt;br /&gt;thanks.&lt;br /&gt;Masud&lt;br /&gt;7.7.9&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-910074157619584461?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/910074157619584461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/07/adding-new-entry-in-tha-table-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/910074157619584461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/910074157619584461'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/07/adding-new-entry-in-tha-table-using.html' title='Adding a new entry in tha table (using Mygeneration)'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-1237416536279667886</id><published>2009-07-02T13:36:00.000-07:00</published><updated>2009-07-02T14:28:03.607-07:00</updated><title type='text'>Steps for working with Mygeneration tools</title><content type='html'>After installing the software you will have to follow the following steps to make it completely workable.&lt;br /&gt;1. Create your tables (as per your database design)&lt;br /&gt;2. Create abstract classes&lt;br /&gt;3. Extend the abstract classes&lt;br /&gt;4. Store them in App_Code folder in your website&lt;br /&gt;5. Executing the dooDad's stored procedures&lt;br /&gt;&lt;br /&gt;Now lets come step by step&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. Table creation&lt;/span&gt;&lt;br /&gt;I think people already know this how to create a table in the a database. Let me remind one important thing those who are working SQL Server 2005 or higher. While connecting to the database then:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Server: &lt;span style="color: rgb(0, 153, 0);"&gt;(local)\sqlexpress&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Here we often write &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;(local)/sqlexpress&lt;/span&gt; and generally get an error number 40. Those who are suffering this problem it can be cure for them. Though it is expected people are acquainted with process of table creation however let me give a clear view.&lt;br /&gt;a. Click Server Explorer from View&lt;br /&gt;b. Find Data Connections&lt;br /&gt;c.  Data Connection&gt;Create New SQL server database&lt;br /&gt;d.&lt;span style="font-weight: bold;"&gt;Server: (local)\sqlexpress&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;e. &lt;/span&gt;&lt;/span&gt;Now let database name Test..&lt;br /&gt;f. Test&gt;Tables&gt;New Table&lt;br /&gt;g. Generate different fields&lt;br /&gt;h. Save the table&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. Create abstract class&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;When your expected tables are created then actually your interaction with database is really over. Now mygeneration tool will take care of all the things. So open mygeneration tool and follow the steps.&lt;br /&gt;a.Open&gt;Templates&gt;C#&gt;CSharp_SQL_BusinessObject&lt;br /&gt;b. Execute&lt;br /&gt;c. Now fill the following like these&lt;br /&gt;Output File Path: C:/test folder/&lt;br /&gt;Namespace: TestNamespace&lt;br /&gt;Select a database:Test&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;Select Table: Maximus&lt;br /&gt;Select Language: C# (default)&lt;br /&gt;d. Press&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt; &lt;/span&gt;&lt;/span&gt;Ok&lt;br /&gt;Now you will find an abstract class named Maximus.cs, but the class file in it named as&lt;br /&gt;_Maximus. It will have following type of code&lt;br /&gt;&lt;br /&gt;namespace TestNamespace&lt;br /&gt;{&lt;br /&gt; public class _Maximus&lt;br /&gt;  {&lt;br /&gt;    /* different codes*/&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So rename the Maximus.cs to _Maximus.cs. And this is the abstract class file for you&lt;br /&gt;which will be used for further database operations&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;3. Extend abstract class&lt;/span&gt;&lt;br /&gt;This is very simple. Lets follow the steps&lt;br /&gt;a. Create a Maximus.cs class file from VS&lt;br /&gt;b. Now open the file and write the following code&lt;br /&gt;&lt;br /&gt;public class Maximus: TestNamespace._Maximus&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;c. Now save the Maximus.cs file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4. Store these files&lt;/span&gt;&lt;br /&gt;Now an important thing is to store these files where. Follow these steps&lt;br /&gt;a. Create/Open the App_Code folder in your website&lt;br /&gt;b. Create two folder in it named DAL and BO&lt;br /&gt;c. Now store _Maximus.cs in DAL&lt;br /&gt;d. And store Maximus.cs in BO&lt;br /&gt;e. As you storing these files in App_Code so these class files will be automatically complied.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5. Execute the stored procedure&lt;/span&gt;&lt;br /&gt;a. Open Mygeneration tool&lt;br /&gt;b. File&gt;New&gt;Mygeneration Project&gt;Add template instance&lt;br /&gt;A window will popup. Now insert the following info&lt;br /&gt;name:test&lt;br /&gt;Template: Microsoft SQL Server&gt;d00Dads Stored Procedures&lt;br /&gt;c. Now click Record Template input&lt;br /&gt;Now another window will popup&lt;br /&gt;d. Insert info like this&lt;br /&gt;Output file path:C:/test/&lt;br /&gt;Select a database: Test&lt;br /&gt;Select table: Maximus&lt;br /&gt;Press Button Ok. and return to previous window and also press Ok&lt;br /&gt;e. You will discover test like&lt;br /&gt;New Project &gt;test&lt;br /&gt;f. Now right click on test and select execure&lt;br /&gt;Here you will find a black screen giving message that stored procedure created successfuly.&lt;br /&gt;g. Now open C:/test.  Here you will find a file Maximus.sql&lt;br /&gt;h. Open this file using Mygeneration tool&lt;br /&gt;i. Then execute from toolbar&lt;br /&gt;&lt;br /&gt;Now your duty is finished. get relaxed and you can do all database works just calling Maximus class. Now from your website in any page you can create code like this:&lt;br /&gt;&lt;br /&gt;Maximus maxOb=new Maximus();&lt;br /&gt;maxOb.Name="Masud";&lt;br /&gt;maxOb.Roll=040201;&lt;br /&gt;&lt;br /&gt;where Name and Roll are fields of Maximus table you created. However thats all for today.&lt;br /&gt;Next time I will be more specific using example.&lt;br /&gt;&lt;br /&gt;thanks.&lt;br /&gt;Masud(3.7.9)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-1237416536279667886?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/1237416536279667886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/07/steps-for-working-with-mygeneration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1237416536279667886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/1237416536279667886'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/07/steps-for-working-with-mygeneration.html' title='Steps for working with Mygeneration tools'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-7811149054035901410</id><published>2009-06-26T01:39:00.000-07:00</published><updated>2009-06-26T01:43:49.556-07:00</updated><title type='text'>My Generation Tools</title><content type='html'>Those people who want to create abstraction about database applications that means don't want to care about low level database application I have a nice suggestion for them----use mygeneration tool which can take care of all database operations. Those who are interested with this just visit the following link and download the softyware&lt;br /&gt;http://www.mygenerationsoftware.com&lt;br /&gt;I will continue how to use of mygeneration tool in next some blogs&lt;br /&gt;&lt;br /&gt;thanks&lt;br /&gt;Masud (26.06.09)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-7811149054035901410?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/7811149054035901410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/06/my-generation-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/7811149054035901410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/7811149054035901410'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/06/my-generation-tools.html' title='My Generation Tools'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-4008748610159432281</id><published>2009-06-20T17:26:00.000-07:00</published><updated>2009-07-14T13:23:15.328-07:00</updated><title type='text'>How to send email from a website</title><content type='html'>This is a nice piece of task I get much pleasure. I think this is a very interesting task for a CSE student who is not yet recognized with the technique of sending an email. Let me state the process step by step. There are two sections:&lt;br /&gt;a.Administrative part&lt;br /&gt;b. Developer's part.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Administrative part:&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;For Administrative part you have to just set the configuration (shown above) in your web configuration (web.config) file. If you do it to the hosting company server's file then no need to think about other thing. But if you want to make local server (your computer) as the mail server then you have to do some other configuration:&lt;br /&gt;1. Open Control Panel&lt;br /&gt;2. Open Administrative tools&lt;br /&gt;3. Select Internet Information Service (IIS)&lt;br /&gt;4.Select Default SMTP&gt;Properties&lt;br /&gt;5. Click Access tab&gt;Relay (Relay Restrictions)&gt;Grant Access for 127.0.0.1 &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;when you are done with this configuration you are ready to write the funtion for sending email. The required configuration is:&lt;br /&gt;&lt;br /&gt;&amp;lt;!--Here Mailserver configuration--&amp;gt;&lt;br /&gt; &amp;lt;system.net&amp;gt;&lt;br /&gt; &amp;lt;mailSettings&amp;gt;&lt;br /&gt; &amp;lt;smtp from=&amp;quot;test@nochallenge.net&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;network host=&amp;quot;localhost&amp;quot; &lt;br /&gt;          userName=&amp;quot;test@company.net&amp;quot; &lt;br /&gt;          password=&amp;quot;****&amp;quot; &lt;br /&gt;          port=&amp;quot;25&amp;quot; &lt;br /&gt;          defaultCredentials=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;/smtp&amp;gt;&lt;br /&gt; &amp;lt;/mailSettings&amp;gt;&lt;br /&gt; &amp;lt;/system.net&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Developer's Part:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;As a developer you just have to write a function for sending email.&lt;br /&gt;Here is the code&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;protected void SendingEMail()&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt;string from="test@yahoo.com";&lt;br /&gt;string to="test@gmail.com";&lt;br /&gt;MailMessage msg=new MailMessage(from,to);&lt;br /&gt;msg.Subject="This is test mail";&lt;br /&gt;msg.Body="Please respond if you get this mail";&lt;br /&gt;SmtpClient client=new SmtpClient("localhost");&lt;br /&gt;client.Send(msg);&lt;br /&gt;Response.write("Mail Sent successfully!");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;thanks&lt;br /&gt;Masud(26.06.09)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-4008748610159432281?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/4008748610159432281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/06/how-to-send-email-from-website.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/4008748610159432281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/4008748610159432281'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/06/how-to-send-email-from-website.html' title='How to send email from a website'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-978626390176617741</id><published>2009-06-20T16:41:00.000-07:00</published><updated>2009-06-20T17:26:00.564-07:00</updated><title type='text'>How to upload an Image to web server</title><content type='html'>In this blog I am going to discuss about how to upload an image in web server. Before you upload an image to the server at first you have to ensure that the web server gives you exact permission to upload the image. If permission is not set to true and you yourself are the web administrator here then you have to set that permission true by yourself. For that you have to use Plesk File Manager (or probably others) for granting permission.&lt;br /&gt;Use the following steps:&lt;br /&gt;1. Open Plesk file manager for web server (provided by Hosting company)&lt;br /&gt;2. Login as administrator&lt;br /&gt;3. Click edit/modify for a folder&lt;br /&gt;4. For all users grant modify permission for the target folder you want to store in your image files.&lt;br /&gt;5. Logout from the Plesk file Manager.&lt;br /&gt;&lt;br /&gt;Now comes the user's task to do. He/she has small parts to do. Use the following steps.&lt;br /&gt;1. Drag and drop FileUpload control from toolbox of visual studio. This control has a Browse button. Clicking this button you can select any file and path will be shown in the textbox of this control.&lt;br /&gt;2. If you want to upload just image then you check file extension for images and allow to upload&lt;br /&gt;3. Now look at the following snippet of code (C#).&lt;br /&gt;&lt;br /&gt;protected void uploadImage()&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;string fileName=FileUpload1.FileName;&lt;br /&gt;string serverPath=Server.MapPath("images/"); /*images is the folder in webserver you want to upload images */&lt;br /&gt;if(FileUpload1.HasFile) /*already uploaded to server*/&lt;br /&gt;{&lt;br /&gt;FileUpload1.SaveAs(serverPath+fileName); /*image saved to web server folder*/&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;else StatusLabel.Text="No Image file selected";&lt;br /&gt;}catch(Exception exc)&lt;br /&gt;{&lt;br /&gt;StatusLabel.Text=exc.Message;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-978626390176617741?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/978626390176617741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/06/how-to-upload-image-to-web-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/978626390176617741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/978626390176617741'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/06/how-to-upload-image-to-web-server.html' title='How to upload an Image to web server'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-9203108551816061044</id><published>2009-06-20T15:02:00.000-07:00</published><updated>2009-07-14T13:20:42.066-07:00</updated><title type='text'>Making alignment with table</title><content type='html'>&lt;strong&gt;&lt;br /&gt;&amp;lt;table border=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;left&amp;quot;&amp;gt;Masud&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;left&amp;quot;&amp;gt;Assad&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;left&amp;quot;&amp;gt;Mamun&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;left&amp;quot;&amp;gt;Sayed&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;right&amp;quot;&amp;gt;Shakila&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;right&amp;quot;&amp;gt;Shamima&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;right&amp;quot;&amp;gt;Shahnaz&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;right&amp;quot;&amp;gt;Tonni&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;Grand father&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;Grand Mother&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;Father&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;Mother&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-9203108551816061044?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/9203108551816061044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/06/making-alignment-with-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/9203108551816061044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/9203108551816061044'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/06/making-alignment-with-table.html' title='Making alignment with table'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-7100056748364009619</id><published>2009-06-17T23:57:00.000-07:00</published><updated>2009-07-14T13:19:26.853-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Coding with table'/><title type='text'>Start design with table</title><content type='html'>If you want to start designing web page the start design with the table control. Nothing can be in a good shape without using table. During my university years, I spent a lot of time to discover that table is the key of all kind of design efficiently and with full control. Those who have little knowledge about HTML language they can easily realize my following code. Just start like this:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;A Simple web page design:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;First Column&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;Second Column&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;Third Colimn&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This is a simple page design using a table which has three columns. Now each of these 3 columns can be further nested with other different controls like table, GridView, labels, buttons.....more and more.&lt;br /&gt;However, just start with this ...you will be benifitted I am sure!&lt;br /&gt;&lt;br /&gt;Thanks.&lt;br /&gt;Masud (18.06.09)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-7100056748364009619?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/7100056748364009619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/06/start-design-with-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/7100056748364009619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/7100056748364009619'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/06/start-design-with-table.html' title='Start design with table'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9071023793074573342.post-5223890442072431575</id><published>2009-06-17T05:38:00.000-07:00</published><updated>2009-06-17T05:48:39.163-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Page design by coding'/><title type='text'>Learn to design web form by coding</title><content type='html'>Those people are still designing the web pages based upon the design view of Visual studio I think I am suggesting those people to stop that jsut from now and start coding just from now. I was a design-view user of visual studio which made me just a fool with a tool. However, time passed and things changed. I started designing web pages using raw xhtml which made me comfortable with website designing and to be very frank this made faster in design and many things have become clearer of the mark-up language like xhtml. However, my later blogs will contain different tutorials and solutions of the problems I have faced during my job-life.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks.&lt;/div&gt;&lt;div&gt; Masud (17.06.2009)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9071023793074573342-5223890442072431575?l=masudcseku.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masudcseku.blogspot.com/feeds/5223890442072431575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://masudcseku.blogspot.com/2009/06/learn-to-design-web-form-by-coding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/5223890442072431575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9071023793074573342/posts/default/5223890442072431575'/><link rel='alternate' type='text/html' href='http://masudcseku.blogspot.com/2009/06/learn-to-design-web-form-by-coding.html' title='Learn to design web form by coding'/><author><name>Md Masudur Rahman</name><uri>http://www.blogger.com/profile/16841288488091341357</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_vNxsOaa98uU/Svw5GjUefbI/AAAAAAAAACA/fywShw3kPf0/S220/masud-4.bmp'/></author><thr:total>0</thr:total></entry></feed>
