<?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:blogger='http://schemas.google.com/blogger/2008' 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-4774617985778665145</id><updated>2024-08-28T12:35:22.322-07:00</updated><category term="ASPxGridview"/><category term=".Net MVC"/><category term="JQuery"/><category term="Javascript"/><category term="Maximum request length exceeded."/><category term="Microsoft Report"/><category term=".Net MVC Basics"/><category term=".Net MVC Sample"/><category term=".Net MVC Tutorial"/><category term=".Net Model View Controller"/><category term="9.2.6"/><category term="ASP.NET Email"/><category term="ASP.NET File upload Error"/><category term="ASP.NET Maximum Request Length Exceeded"/><category term="ASP.NET file store in DB"/><category term="ASP.NET master page"/><category term="ASPxButton"/><category term="ASPxCallBackpanel"/><category term="ASPxHyperLink"/><category term="ASPxPopupControl"/><category term="Callback"/><category term="Cascading dropdown in MVC"/><category term="Change the upload file size in ASP.NET application"/><category term="Circular Reference error in MVC dropdown"/><category term="Composite Control"/><category term="Control in a ASPxGridview Cell"/><category term="Databind is not working"/><category term="DevExpress"/><category term="Difference between Callback and Postback"/><category term="Difference between Postback and Callback"/><category term="Enable HTML tags in Email Body"/><category term="File Upload Error"/><category term="File Upload Runtime error"/><category term="File reference"/><category term="Find from which page the master file is invoked"/><category term="Gridview - Highlight selected row after Postback"/><category term="Highlight selected row"/><category term="How to create Server side Reports in ASP.NET"/><category term="How to update parent form control from child form"/><category term="ITemplate"/><category term="Javascript window open"/><category term="MVC Code"/><category term="MVC Grid"/><category term="MVC JQuery"/><category term="MVC Sample"/><category term="Microsoft Report Viewer"/><category term="MicrosoftReportViewer"/><category term="Obect Expected Error"/><category term="Object Not Found"/><category term="Open DB stored file in ASP.NET"/><category term="Open Database stored files in ASP.NET"/><category term="Open binary content file in ASP.NET"/><category term="Open file in ASP.NET"/><category term="Open page without postback"/><category term="Open up a page in the same browser"/><category term="Postback"/><category term="ReportViewer"/><category term="Runtime Report"/><category term="SSRS Report"/><category term="SSRS in ASP.NET"/><category term="Server side web reports using Reportviewer"/><category term="Service unavailable"/><category term="Service unavailable in websites"/><category term="Service unavailable in windows 2003"/><category term="Store files in database"/><category term="Update the parent form control"/><category term="Update the parent window control"/><category term="Web Report"/><category term="Web.confg settings for File upload size"/><category term="Window.Open"/><category term="Windows ReportViewer"/><category term="_self"/><category term="deploy webpart in sharepoint 2007"/><category term="deploy webparts"/><category term="document.opener"/><category term="file size restriction in web.config"/><category term="file store in ASP.NET"/><category term="gridview"/><category term="how to deploye webparts"/><category term="parent form update"/><category term="path of the file from master"/><category term="rdlc"/><category term="row selection after postback"/><category term="sharepoint 2007 deployment"/><category term="store files in SQL Server"/><category term="take controls from child form in ASP.NET"/><category term="upload file in ASP.NET"/><category term="upload file size limit in ASP.NET"/><category term="webpart deployment"/><category term="webparts"/><title type='text'>Knowledge matters...</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-6117659524245326456</id><published>2011-07-18T23:40:00.000-07:00</published><updated>2011-07-19T02:59:23.330-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET file store in DB"/><category scheme="http://www.blogger.com/atom/ns#" term="file store in ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Store files in database"/><category scheme="http://www.blogger.com/atom/ns#" term="store files in SQL Server"/><title type='text'>Store files in database</title><content type='html'>&lt;b&gt;&lt;u&gt;Scenario:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
This may not be very common scenario but needed some time to store the files in database. Mostly the attachments needs to be stored in a database instead of maintaining as files.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Solution:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This is very easy with the .NET and SQL Sever environment. Let me start from the database side.We need to have the &lt;b&gt;varbinary&lt;/b&gt; field in the database table in order to store the file stream. Look at the below image shows about the table structure.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF56yb2JrrNrC7rVgZgdXdM6xmD1qSQSb81uuRGVrzMdwccDp10OseRUJHl8F3Jing6C1LhzKfOlpVff_wEhWxIgYdp_VS88gyAsU2VIKlyxTqkQqjT3NF_txIlv338zhTXcuK8IwMgy0n/s1600/DB.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;171&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF56yb2JrrNrC7rVgZgdXdM6xmD1qSQSb81uuRGVrzMdwccDp10OseRUJHl8F3Jing6C1LhzKfOlpVff_wEhWxIgYdp_VS88gyAsU2VIKlyxTqkQqjT3NF_txIlv338zhTXcuK8IwMgy0n/s400/DB.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
We can go for the coding part, we&#39;ll use File upload control to get the file from the user. We need to convert the file stream in file upload control to byte array. This byte array has to be passed to the database as param.&lt;br /&gt;
Look at the screenshot of the code used to store the file,&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSXCsKTYkgapakPm3lOzYUYJSUc2PssjODuS1vW4AanTDXPQF8OZ3-7qS2RXHTRX8ZnFYpkU2j-DOUEqKlKfMYrBoOeM-lS2td9TQIh8LrME763vzEFNtxi7KkknGhYuMk9S4LTchV48N3/s1600/AttachFile.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;366&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSXCsKTYkgapakPm3lOzYUYJSUc2PssjODuS1vW4AanTDXPQF8OZ3-7qS2RXHTRX8ZnFYpkU2j-DOUEqKlKfMYrBoOeM-lS2td9TQIh8LrME763vzEFNtxi7KkknGhYuMk9S4LTchV48N3/s640/AttachFile.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Hope the above screenshot is explanatory about the code used. I would like to show how this parameter has been handled in executing the stored procedure.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6eb97DuXqvyK9LlFllicr3vn6vMA0Jw3PBdtkGq7Xpj0fNupDhPTyb0LiVRrt1a3p5EC5uUmuuYlE1pXKNrzhhrEhDpvdmKZOI_ka4IiuRiJnUUv2AqD6EymGT3sJ2ZND307MUXLhHkRP/s1600/AttachFileSPExe.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;342&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6eb97DuXqvyK9LlFllicr3vn6vMA0Jw3PBdtkGq7Xpj0fNupDhPTyb0LiVRrt1a3p5EC5uUmuuYlE1pXKNrzhhrEhDpvdmKZOI_ka4IiuRiJnUUv2AqD6EymGT3sJ2ZND307MUXLhHkRP/s640/AttachFileSPExe.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Conclusion:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
I believe the above code will be used to store the files in database.&lt;br /&gt;
&lt;br /&gt;
Happy .NETting..</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/6117659524245326456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2011/07/store-image-files-in-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6117659524245326456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6117659524245326456'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2011/07/store-image-files-in-database.html' title='Store files in database'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF56yb2JrrNrC7rVgZgdXdM6xmD1qSQSb81uuRGVrzMdwccDp10OseRUJHl8F3Jing6C1LhzKfOlpVff_wEhWxIgYdp_VS88gyAsU2VIKlyxTqkQqjT3NF_txIlv338zhTXcuK8IwMgy0n/s72-c/DB.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-7239696162820754669</id><published>2011-07-14T23:11:00.000-07:00</published><updated>2011-07-14T23:11:31.504-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET Email"/><category scheme="http://www.blogger.com/atom/ns#" term="Enable HTML tags in Email Body"/><title type='text'>MailMessage - Allowing html tags inside body text</title><content type='html'>&lt;b&gt;&lt;u&gt;Problem&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
This is the very simple scenario required when sending email from our application. We need to put html tags in the body of the text which we are sending.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm_zlSa-KV34zVs0EW0Z08zQy-NTR12iZm2NOawqTUz-wCLZkQ6eHDEigJeC9PNcWbCpQdf7B02YsV6ZDJsoy-cYqL0wbVUdTBZ04mI__MS-LFpGtCw53Cwd8zxsfcDdYXY8g5CfWqOJDj/s1600/EmailBody.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;16&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm_zlSa-KV34zVs0EW0Z08zQy-NTR12iZm2NOawqTUz-wCLZkQ6eHDEigJeC9PNcWbCpQdf7B02YsV6ZDJsoy-cYqL0wbVUdTBZ04mI__MS-LFpGtCw53Cwd8zxsfcDdYXY8g5CfWqOJDj/s640/EmailBody.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
We are expected to send the email with the above body. This should be appear in their inbox with two lines. The text &quot;Dear Murugesan,&quot; should come in the first line and the rest in second line.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Solution&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Normally this won&#39;t appear as we wish. We need to true the property named &quot;IsBodyHtml&quot;. Look at the below code sample,&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCuLS9dCTJ2-Ld1eB-MVwD9LH3bwVLbyHtZgSaJykyxpvt7jZjWIx9KeZX4MO7lwdRDCJtOSeYhdUGn5y1dBRXNBm07d7ROVwWuljvE4Mwuiw_xE_lDGZL3kC0uy241nfjCarXAT-p2NC2/s1600/Email.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;146&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCuLS9dCTJ2-Ld1eB-MVwD9LH3bwVLbyHtZgSaJykyxpvt7jZjWIx9KeZX4MO7lwdRDCJtOSeYhdUGn5y1dBRXNBm07d7ROVwWuljvE4Mwuiw_xE_lDGZL3kC0uy241nfjCarXAT-p2NC2/s640/Email.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;The above picture clearly shows the how to enable the property to get the work done.&lt;br /&gt;
&lt;br /&gt;
Keep .Neting...</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/7239696162820754669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2011/07/mailmessage-allowing-html-tags-inside.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/7239696162820754669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/7239696162820754669'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2011/07/mailmessage-allowing-html-tags-inside.html' title='MailMessage - Allowing html tags inside body text'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm_zlSa-KV34zVs0EW0Z08zQy-NTR12iZm2NOawqTUz-wCLZkQ6eHDEigJeC9PNcWbCpQdf7B02YsV6ZDJsoy-cYqL0wbVUdTBZ04mI__MS-LFpGtCw53Cwd8zxsfcDdYXY8g5CfWqOJDj/s72-c/EmailBody.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-4466399532760752518</id><published>2011-06-21T03:45:00.000-07:00</published><updated>2011-06-21T03:48:00.540-07:00</updated><title type='text'>ASP.NET Gridview Sorting</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;&lt;u&gt;Gridview Sorting:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
The Gridview sorting can be done with little code block. The Gridview itself has two events for sorting and one property to enable the sorting. Look at the below picture to change the Gridview property and create onsorting event.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPty3HPaTcbHQwrWpKc9gzeJJ8j1zP3_C6i-cbIWg7lQDi51aFBFSuHDT1Z5yhB3Bj9p5cdoZyplgFnGBfTJkP616MpwFEHEkvEWAL21JqgQJLxxhQ5k4YiTHT1tNtuWf7s2uASRVc0Ffl/s1600/Gridview_Sort.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;185&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPty3HPaTcbHQwrWpKc9gzeJJ8j1zP3_C6i-cbIWg7lQDi51aFBFSuHDT1Z5yhB3Bj9p5cdoZyplgFnGBfTJkP616MpwFEHEkvEWAL21JqgQJLxxhQ5k4YiTHT1tNtuWf7s2uASRVc0Ffl/s640/Gridview_Sort.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPty3HPaTcbHQwrWpKc9gzeJJ8j1zP3_C6i-cbIWg7lQDi51aFBFSuHDT1Z5yhB3Bj9p5cdoZyplgFnGBfTJkP616MpwFEHEkvEWAL21JqgQJLxxhQ5k4YiTHT1tNtuWf7s2uASRVc0Ffl/s1600/Gridview_Sort.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPty3HPaTcbHQwrWpKc9gzeJJ8j1zP3_C6i-cbIWg7lQDi51aFBFSuHDT1Z5yhB3Bj9p5cdoZyplgFnGBfTJkP616MpwFEHEkvEWAL21JqgQJLxxhQ5k4YiTHT1tNtuWf7s2uASRVc0Ffl/s1600/Gridview_Sort.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPty3HPaTcbHQwrWpKc9gzeJJ8j1zP3_C6i-cbIWg7lQDi51aFBFSuHDT1Z5yhB3Bj9p5cdoZyplgFnGBfTJkP616MpwFEHEkvEWAL21JqgQJLxxhQ5k4YiTHT1tNtuWf7s2uASRVc0Ffl/s1600/Gridview_Sort.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPty3HPaTcbHQwrWpKc9gzeJJ8j1zP3_C6i-cbIWg7lQDi51aFBFSuHDT1Z5yhB3Bj9p5cdoZyplgFnGBfTJkP616MpwFEHEkvEWAL21JqgQJLxxhQ5k4YiTHT1tNtuWf7s2uASRVc0Ffl/s1600/Gridview_Sort.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition with the AllowSorting property set and event creation, we need to do some code in the event method. Look at the below picture, the red colored box indicates the property enabled with ViewState to hold what sortdirection had clicked. With the help of the property, we cross check and sort the session stored dataview and assign it back to Gridview. Before that we need assign the property to switch between ASC and DESC.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAMQD4MYVrwtO3zEAH8KCxaQ-JwaB7nEgZCpmywucrQb4IyzfhzFiMHYXJ6U8vrKlbzYFYiBICIKw2PRilMOgas41dFU-PX8JiN4M3VeIMAILBB6zqrSV2FgSRGO0PyOqB2b7Xit3Jy8zr/s1600/Gridview_SortEvent.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;424&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAMQD4MYVrwtO3zEAH8KCxaQ-JwaB7nEgZCpmywucrQb4IyzfhzFiMHYXJ6U8vrKlbzYFYiBICIKw2PRilMOgas41dFU-PX8JiN4M3VeIMAILBB6zqrSV2FgSRGO0PyOqB2b7Xit3Jy8zr/s640/Gridview_SortEvent.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Hope this will help. Happy Coding...&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/4466399532760752518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2011/06/aspnet-gridview-sorting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/4466399532760752518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/4466399532760752518'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2011/06/aspnet-gridview-sorting.html' title='ASP.NET Gridview Sorting'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPty3HPaTcbHQwrWpKc9gzeJJ8j1zP3_C6i-cbIWg7lQDi51aFBFSuHDT1Z5yhB3Bj9p5cdoZyplgFnGBfTJkP616MpwFEHEkvEWAL21JqgQJLxxhQ5k4YiTHT1tNtuWf7s2uASRVc0Ffl/s72-c/Gridview_Sort.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-807555828077316587</id><published>2011-06-15T04:34:00.000-07:00</published><updated>2011-06-15T04:34:26.667-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Open binary content file in ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Open Database stored files in ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Open DB stored file in ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Open file in ASP.NET"/><title type='text'>Open Database stored files in ASP.NET</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;&lt;u&gt;Scenario:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
This post is about how to open the DB stored binary files in a ASP.NET form.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Solution:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
This can be achieved with the &lt;b&gt;Response &lt;/b&gt;of ASP.NET. Response&#39;s&amp;nbsp;&lt;b&gt;BinaryWrite&lt;/b&gt; function can write the binary content into appropriate content type and ll be opened.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Code Sample:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string fileName = dt.Rows[0][&quot;AttachFileName&quot;].ToString();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte[] FileContent = (byte[])dt.Rows[0][&quot;AttachFile&quot;];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Clear();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.AddHeader(&quot;Content-Disposition&quot;, &quot;inline;attachment; filename=&quot; + fileName);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.AddHeader(&quot;Content-Length&quot;, FileContent.Length.ToString());&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.ContentType = &quot;application/octet-stream&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.BinaryWrite(FileContent);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
From the above sample code, We are fetching the file name and binary file content from the database and assign to string and byte array respectively. We are adding some response Header with Content Description and Content-Length. Here we also need to specify the content type as octet-stream in order to write it as a file. Finally write the byte array content using BinaryWrite of Response method to open the attached document.&lt;br /&gt;
&lt;br /&gt;
Happy .Neting&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/807555828077316587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2011/06/open-database-stored-files-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/807555828077316587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/807555828077316587'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2011/06/open-database-stored-files-in-aspnet.html' title='Open Database stored files in ASP.NET'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-7478592110142732724</id><published>2011-06-15T03:48:00.000-07:00</published><updated>2011-06-15T03:55:16.548-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="document.opener"/><category scheme="http://www.blogger.com/atom/ns#" term="How to update parent form control from child form"/><category scheme="http://www.blogger.com/atom/ns#" term="parent form update"/><category scheme="http://www.blogger.com/atom/ns#" term="take controls from child form in ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Update the parent form control"/><category scheme="http://www.blogger.com/atom/ns#" term="Update the parent window control"/><title type='text'>How to update parent form control from child form</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;&lt;u&gt;Situation:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
I have had a scenario while developing one application like need to open a child window for adding attachments for the parent window. There is a link in parent window along with No. of attachments has to be displayed near by the link. The thing is the parent form control should be updated when user adds/deletes attachment in child form.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Solution:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
I believe most of the people known about the &quot;&lt;b&gt;window.opener&lt;/b&gt;&quot; is pointing the parent form and can manage this with some Javascript code. Here one more thing also there. When you write Javascript code, this has to be called during add/delete button click of server side event. This can be achieved by &quot;&lt;b&gt;RegisterClientScriptBlock&lt;/b&gt;&quot; of &lt;b&gt;ClientScript&lt;/b&gt; object.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Code Sample :&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt; StringBuilder RTScript = new StringBuilder();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; RTScript.Append(&quot;&lt;b&gt;script&amp;gt;&lt;/b&gt;window.opener.document.forms[&#39;aspnetForm&#39;].&quot; +&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&lt;b&gt;ControlName&lt;/b&gt;.value &amp;nbsp;= &#39;[&quot; + &lt;b&gt;AssigningValue&lt;/b&gt; + &quot;]&#39;;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;script&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&quot;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ClientScript.RegisterClientScriptBlock(this.GetType(), &quot;script&quot;, RTScript.ToString());&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
Kindly add &lt;b&gt;less than[&amp;lt;]&lt;/b&gt; symbol before and after the script tag in the above code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the above code you have to change it in two places one is &lt;b&gt;ControlName&lt;/b&gt;, which is the name of the control in parent window and &lt;b&gt;AssigningValue&lt;/b&gt;, whats the value you want to display it in the parent window.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
Happy .Neting.. :)&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/7478592110142732724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2011/06/how-to-update-parent-form-control-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/7478592110142732724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/7478592110142732724'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2011/06/how-to-update-parent-form-control-from.html' title='How to update parent form control from child form'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-461589282602245550</id><published>2011-06-03T05:31:00.000-07:00</published><updated>2011-06-03T05:31:02.184-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="How to create Server side Reports in ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Report"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Report Viewer"/><category scheme="http://www.blogger.com/atom/ns#" term="MicrosoftReportViewer"/><category scheme="http://www.blogger.com/atom/ns#" term="Server side web reports using Reportviewer"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS in ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS Report"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Report"/><title type='text'>Server side web reports using Reportviewer</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;&lt;u&gt;Scenario:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
I had to show SSRS report in my web application. I have used the MicrosoftReportviewer 9.0 control and add little bit of code can make it happen.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Solution:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
Its very easy to do it in few steps.&lt;br /&gt;
&lt;br /&gt;
1. Add MicrosoftReportViewer control to the web form. This will add the control and necessary @ Register directives and assembly to the references.&lt;br /&gt;
&lt;br /&gt;
2. Add the below code during any of the page events like load or Init.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Before start the code add the namespace &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;Microsoft.Reporting.WebForms&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a. Start with Reset command of the Reportviewer and set ProcessingMode as Remote.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ReportViewer1.Reset();&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;ReportViewer1&lt;/b&gt;&lt;/span&gt;.ProcessingMode = ProcessingMode.Remote;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/b&gt;b. Create Uri based on the SSRS server name.&lt;b style=&quot;color: #990000;&quot;&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Uri ReportURL = new Uri(&quot;http://ServerName/ReportServer&quot;);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #990000; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;c. Instantiate the ServerReport to assign the Report server and report path&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ServerReport sr =&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;ReportViewer1&lt;/b&gt;&lt;/span&gt;.ServerReport;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sr.ReportServerUrl = ReportURL;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sr.ReportPath = &quot;/ReportFileName&quot;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/b&gt;d. Define ReportParameter array to hold parameter to the report.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ReportParameter[] rp = new ReportParameter[1];&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/b&gt;e. Create and assign parameter name and value. Repeat for all the parameters.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rp[0] = new ReportParameter();&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rp[0].Name = &quot;EmpNo&quot;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rp[0].Values.Add(Convert.ToString(Session[&quot;EmpNo&quot;]));&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/b&gt;f. Assign Report parameter array to ServerReport&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sr.SetParameters(rp);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/b&gt;g. Finally show the report and can manipulate the session timeout and zoom modes.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;ReportViewer1&lt;/b&gt;&lt;/span&gt;.ServerReport.Timeout = Session.Timeout;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;ReportViewer1&lt;/b&gt;&lt;/span&gt;.ZoomMode = ZoomMode.PageWidth;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;ReportViewer1&lt;/b&gt;&lt;/span&gt;.Visible = true;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Conclusion:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
I believe this code will help you to show the SSRS reports in web form.&lt;br /&gt;
&lt;br /&gt;
Happy Coding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/461589282602245550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2011/06/server-side-web-reports-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/461589282602245550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/461589282602245550'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2011/06/server-side-web-reports-using.html' title='Server side web reports using Reportviewer'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-4043702930938059647</id><published>2011-05-31T02:36:00.000-07:00</published><updated>2011-05-31T02:37:31.071-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET File upload Error"/><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET Maximum Request Length Exceeded"/><category scheme="http://www.blogger.com/atom/ns#" term="File Upload Error"/><category scheme="http://www.blogger.com/atom/ns#" term="File Upload Runtime error"/><category scheme="http://www.blogger.com/atom/ns#" term="Maximum request length exceeded."/><category scheme="http://www.blogger.com/atom/ns#" term="Web.confg settings for File upload size"/><title type='text'>How to avoid the error &quot;Maximum Request Length Exceeded&quot;</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;&lt;u&gt;Scenario :&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
I had a requirement to develop a page which has to upload the file to the DB server.&amp;nbsp;Uploading a file to the server is a very easy thing with the FileUpload control. By default the maximum size allowed to upload is 4MB and if you want you can increase or decrease in web.config settings.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Problem :&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There won&#39;t be any problem, if you upload the file size of less than the specified size in web.config. If the size of the file is more than the limit specified, the runtime will be thrown with the message of &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;Maximum Request Length Exceeded&lt;/b&gt;&lt;/span&gt;&quot;. The thing is it won&#39;t be catched in button click of the File upload. Let us see how can we fix this. I found the solution in web and explaining for you.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Solution:&lt;/u&gt;&lt;/b&gt; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
I&#39;m not sure this is the best way to do it. But this also a solution. We could catch this in &lt;b&gt;Application_BeginRequest &lt;/b&gt;event of &lt;b&gt;Global.asax&lt;/b&gt;. Normally whatever the client request for a page or file this application BeginRequest event will be fired and the control goes to the page events. Since its going for all the postback and initial load. We can calculate the content length of each post by the below lines,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;HttpContext context = ((HttpApplication)sender).Context;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt; &lt;b&gt;int PageContentLength = context.Request.ContentLength;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In addition with that, we need to calculate the actual size of the page and do some calculations. Look at the entire code below, which have to be added in Global.asax.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ4bObebztxwiBX-q1F5uh9dB-PDL8nlXseQ33cEU7_DBO0TY_4htTRnojEAXpIEo6jOddXQVBGaJkPaEpdf1kNykMSL3YUn_PvXzUZHfyZW9MIYg5Sh-kj9R9kZBzXDU4mbkSMSDMNlMd/s1600/Code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;508&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ4bObebztxwiBX-q1F5uh9dB-PDL8nlXseQ33cEU7_DBO0TY_4htTRnojEAXpIEo6jOddXQVBGaJkPaEpdf1kNykMSL3YUn_PvXzUZHfyZW9MIYg5Sh-kj9R9kZBzXDU4mbkSMSDMNlMd/s640/Code.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;Event in Global.asax&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
The last line redirects the control to the same page with the url querystring. Based on the query string, we&#39;ll display the error message in Attachment page. Another thing here is as soon as you displayed the error message you need to remove the querystring value.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Conclusion:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
This solution may not be better for performance wise since this event is keep calling for all the page requests as well file requests like .JS or .CSS. Let me know if you have better solution than this.&lt;br /&gt;
&lt;br /&gt;
Happy Coding....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/4043702930938059647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2011/05/how-to-avoid-error-maximum-request.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/4043702930938059647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/4043702930938059647'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2011/05/how-to-avoid-error-maximum-request.html' title='How to avoid the error &quot;Maximum Request Length Exceeded&quot;'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ4bObebztxwiBX-q1F5uh9dB-PDL8nlXseQ33cEU7_DBO0TY_4htTRnojEAXpIEo6jOddXQVBGaJkPaEpdf1kNykMSL3YUn_PvXzUZHfyZW9MIYg5Sh-kj9R9kZBzXDU4mbkSMSDMNlMd/s72-c/Code.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-3813223008765159512</id><published>2011-05-26T01:55:00.000-07:00</published><updated>2011-05-26T02:07:37.109-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET master page"/><category scheme="http://www.blogger.com/atom/ns#" term="Find from which page the master file is invoked"/><category scheme="http://www.blogger.com/atom/ns#" term="path of the file from master"/><title type='text'>Find from which page the master file is invoked</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;&lt;u&gt;Scenario&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We may sometimes need to know from which page, the master file is invoked. Based on the file, we&#39;ll do some operation not for the other pages. For example if the user name in session is empty, it has to redirect to the login page otherwise the requested page should be opened. But at the same time, if the user request a login page, it should not redirect to the same page again.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Solution&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
In the above said scenario, we have to identify from where the master page is being called. We have the below code to identify from which page its called,&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;background-color: #ffe599;&quot;&gt;this.Parent.TemplateControl.AppRelativeVirtualPath.ToString()&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #ffd966;&quot;&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
If you put this code in master page file, you will get to know the page from where it&#39;s invoked. Its taking the parents relativevirtualpath.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Happy Coding...&lt;br /&gt;
&lt;b style=&quot;background-color: #ffd966;&quot;&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/3813223008765159512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2011/05/find-from-which-page-master-file-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/3813223008765159512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/3813223008765159512'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2011/05/find-from-which-page-master-file-is.html' title='Find from which page the master file is invoked'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-6229896242499041041</id><published>2011-05-25T00:03:00.000-07:00</published><updated>2011-05-26T02:05:42.205-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Change the upload file size in ASP.NET application"/><category scheme="http://www.blogger.com/atom/ns#" term="file size restriction in web.config"/><category scheme="http://www.blogger.com/atom/ns#" term="Maximum request length exceeded."/><category scheme="http://www.blogger.com/atom/ns#" term="upload file in ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="upload file size limit in ASP.NET"/><title type='text'>Change the upload file size in ASP.NET application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;&lt;u&gt;Problem:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
This is a scenario i faced when i worked in web application. Our application supports to upload the documents. When the user tries to upload the file more than 4MB, the browser shows error message and . Initially I did the work around, check the size of the file and notify the user to upload less than 4 MB document.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Solution&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I found that thats not the correct solution. We may stop breaking the application and google the web and found a very simple solution to solve the problem.&lt;br /&gt;
&lt;br /&gt;
We need to add the below line in web.config file under System.web tag&lt;system.web&gt;&lt;/system.web&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #ffe599;&quot;&gt;&amp;lt;&lt;b&gt;httpRuntime maxRequestLength=&quot;5120&quot;&lt;/b&gt;/&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
The &lt;b&gt;httpRuntime &lt;/b&gt;tag has the property called &lt;b&gt;maxRequestLength&lt;/b&gt;, which is to be specified in KB. The above shows the 5 MB file can be uploaded.&lt;br /&gt;
&lt;br /&gt;
If you are not specifying the httpRuntime in web.config..the default size is 4MB.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Conclusion:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
With that above work around, user can able to upload more than 4 MB and we can fix the size.&lt;br /&gt;
&lt;br /&gt;
Happy Coding... :)&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/6229896242499041041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2011/05/change-upload-file-size-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6229896242499041041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6229896242499041041'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2011/05/change-upload-file-size-in-aspnet.html' title='Change the upload file size in ASP.NET application'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-1666345270530075873</id><published>2011-01-25T00:56:00.000-08:00</published><updated>2011-01-25T01:23:56.794-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net MVC"/><category scheme="http://www.blogger.com/atom/ns#" term="File reference"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="Object Not Found"/><title type='text'>JavaScript Error - Object Not Found</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Problem:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;When you refer JavaScript/css/images files, it will be referred properly and the code works fine in local machine. But you may get JavaScript error &quot;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;Object Not Found&lt;/span&gt;&lt;/b&gt;&quot; when deployed in web servers.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Solution:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Kindly use the &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000; font-size: large; font-weight: bold;&quot;&gt;~&amp;nbsp;&lt;/span&gt;symbol to avoid this Object Not Found error to specify the root directory.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Sample Code:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The below code which generates &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;Object Not Found&lt;/b&gt;&lt;/span&gt;&quot; JavaScript error,&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;href&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;/Content/Styles/MasterPage.css&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;rel&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;stylesheet&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/css&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Or&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;href&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;../Content/Styles/MasterPage.css&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;rel&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;stylesheet&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/css&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Working Code:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Use &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000; font-size: large; font-weight: bold;&quot;&gt;~&amp;nbsp;&lt;/span&gt;symbol before the / to refer the root level as shown below,&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;href&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;~/Content/Styles/MasterPage.css&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;rel&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;stylesheet&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/css&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-weight: normal;&quot;&gt;In addition, if you are working in MVC, use &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;b&gt;Url.Content &lt;/b&gt;to get absolute URL as shown below,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;&lt;/span&gt;&lt;span style=&quot;background: yellow; mso-highlight: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt; Url.Content(&quot;~/Scripts/jquery-1.4.4.js&quot;) &lt;span style=&quot;background: yellow; mso-highlight: yellow;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/javascript&quot;&amp;gt;&lt;!--&lt;/span--&gt;&lt;span style=&quot;color: maroon;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Conclusion&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Make a practice of referring any external files by using the ~ symbol in the root level to avoid Object Not Fund error.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Happy Coding&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000; font-size: large; font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/1666345270530075873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2011/01/javascript-error-object-not-found.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/1666345270530075873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/1666345270530075873'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2011/01/javascript-error-object-not-found.html' title='JavaScript Error - Object Not Found'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-8986104986503756</id><published>2010-12-23T20:38:00.000-08:00</published><updated>2010-12-27T21:14:59.130-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net MVC"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC JQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="Obect Expected Error"/><title type='text'>&quot;Object Expected&quot; error in MVC JQuery autocomplete</title><content type='html'>&lt;b&gt;&lt;u&gt;Problem :-&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
I have been working in MVC and its very interesting to work with it. I just started working on JQuery. I have encountered this problem when implementing autocomplete to Text box in MVC with JQuery. The JavaScript error &quot;Object Expected&quot; will be coming when you reload the page. That means during first time load, there will be no problem. But if you click on paging and try to do autocomplete in text box. You could face this error in autocomplete statement.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Solution :-&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
Normally &amp;nbsp;we used to include the Jquery files by dragging to the page. When we drag the files, the following text will be added,&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;&amp;lt;&lt;/span&gt;script src=&quot;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000; font-size: large;&quot;&gt;../..&lt;/span&gt;&lt;/b&gt;/Scripts/jquery-1.4.1.js&quot; type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The blue color text shows like the Scripts&amp;nbsp;directory&amp;nbsp;is placed inside one folder from the root. But its not like that. Its placed directly under the root.&lt;br /&gt;
&lt;br /&gt;
So change that script include to the below one.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;&amp;lt;&lt;/span&gt;script src=&quot;/Scripts/jquery-1.4.1.js&quot; type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;This will solve your problem.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;b&gt;&lt;u&gt;Conclusion :-&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;This may be the small issue but kill your time like anything. You won think the problem due to this script include tag.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;Happy Coding.. :)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/8986104986503756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2010/12/object-expected-error-in-mvc-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/8986104986503756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/8986104986503756'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2010/12/object-expected-error-in-mvc-jquery.html' title='&quot;Object Expected&quot; error in MVC JQuery autocomplete'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-4612212503685057372</id><published>2010-11-26T01:36:00.000-08:00</published><updated>2010-11-26T01:37:12.668-08:00</updated><title type='text'>Assign default text in Html.TextBoxFor</title><content type='html'>&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;To assign textbox value in MVC view, use the following syntax.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;lt;%= Html.TextBoxFor(x =&amp;gt; x.EmployeeName, new { &lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;@Value&lt;/span&gt;&lt;/span&gt; = &quot;Enter Employee Name&quot;}) %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Here the &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;@Value&lt;/span&gt; case is must.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/4612212503685057372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2010/11/assign-default-text-in-htmltextboxfor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/4612212503685057372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/4612212503685057372'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2010/11/assign-default-text-in-htmltextboxfor.html' title='Assign default text in Html.TextBoxFor'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-6596672781142014700</id><published>2010-10-06T22:24:00.000-07:00</published><updated>2010-10-06T22:25:22.704-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cascading dropdown in MVC"/><category scheme="http://www.blogger.com/atom/ns#" term="Circular Reference error in MVC dropdown"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC Grid"/><title type='text'>MVC Cascading dropdown, Jquery Grid and Resolving circular references</title><content type='html'>1. Look at the below link by &lt;b&gt;Stephen Walther&lt;/b&gt; to work on Cascading dropdowns&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://stephenwalther.com/blog/archive/2008/09/07/asp-net-mvc-tip-41-creating-cascading-dropdown-lists-with-ajax.aspx&quot;&gt;http://stephenwalther.com/blog/archive/2008/09/07/asp-net-mvc-tip-41-creating-cascading-dropdown-lists-with-ajax.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
You may face this circular reference error due to referring one class in another class for foreign key relation,&lt;br /&gt;
&lt;br /&gt;
can use the below link to solve that problem&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blogs.telerik.com/atanaskorchev/posts/10-01-25/resolving_circular_references_when_binding_the_mvc_grid.aspx&quot;&gt;http://blogs.telerik.com/atanaskorchev/posts/10-01-25/resolving_circular_references_when_binding_the_mvc_grid.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
2. jquery provides the Grid with paging and sorting. check with the below link&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx&quot;&gt;http://haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Thanks to respective authors..</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/6596672781142014700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2010/10/mvc-cascading-dropdown-jquery-grid-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6596672781142014700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6596672781142014700'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2010/10/mvc-cascading-dropdown-jquery-grid-and.html' title='MVC Cascading dropdown, Jquery Grid and Resolving circular references'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-6101055978965161315</id><published>2010-09-23T01:42:00.000-07:00</published><updated>2010-09-23T01:44:12.675-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="deploy webpart in sharepoint 2007"/><category scheme="http://www.blogger.com/atom/ns#" term="deploy webparts"/><category scheme="http://www.blogger.com/atom/ns#" term="how to deploye webparts"/><category scheme="http://www.blogger.com/atom/ns#" term="sharepoint 2007 deployment"/><category scheme="http://www.blogger.com/atom/ns#" term="webpart deployment"/><category scheme="http://www.blogger.com/atom/ns#" term="webparts"/><title type='text'>Deploy Webparts in Sharepoint Server 2007</title><content type='html'>&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Steps to deploy Webpart in Sharepoint&amp;nbsp;Server&amp;nbsp;2007&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1. Copy themes files to&amp;nbsp;C:\Inetpub\wwwroot\wss\VirtualDirectories\80\_themes if you have it in&amp;nbsp;webpart.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;2. Open web.config file under the port 80&amp;nbsp;C:\Inetpub\wwwroot\wss\VirtualDirectories\80\&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;3. Add assembly information to &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;safecontrol&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt; tag&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Ex. &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;SafeControl Assembly=&quot;HelloworldWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5&quot; Namespace=&quot;HelloworldWebPart&quot; TypeName=&quot;HelloworldWebPart&quot; Safe=&quot;True&quot; /&amp;gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;4. Move the&amp;nbsp;webpart&amp;nbsp;assembly file(.dll under bin folder) to GAC.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;5. Restart IIS using &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;iisreset&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt; command&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;6. Go to&amp;nbsp;webpart&amp;nbsp;Gallery and click New on the top.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;7. You could find your&amp;nbsp;webpart, select the&amp;nbsp;webpart&amp;nbsp;and click populate button to load the webpart to Gallery.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;8. Eventually create a webpart page and add this webpart to the web page.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;9. Hope you could see the result displayed in the webpage in the form of webpart.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Happy Coding...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/6101055978965161315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2010/09/deploy-webparts-in-sharepoint-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6101055978965161315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6101055978965161315'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2010/09/deploy-webparts-in-sharepoint-server.html' title='Deploy Webparts in Sharepoint Server 2007'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-7531202175566386466</id><published>2010-08-19T06:24:00.000-07:00</published><updated>2011-02-10T02:44:13.892-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net Model View Controller"/><category scheme="http://www.blogger.com/atom/ns#" term=".Net MVC"/><category scheme="http://www.blogger.com/atom/ns#" term=".Net MVC Basics"/><category scheme="http://www.blogger.com/atom/ns#" term=".Net MVC Sample"/><category scheme="http://www.blogger.com/atom/ns#" term=".Net MVC Tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC Code"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC Sample"/><title type='text'>MVC Basics</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Model View Controller [MVC]&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;MVC is a design pattern which separates the Business Logic, User Interface and Controlling user inputs. It consists of Model, View and Controllers.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Let we see about each components...&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Model&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Model represents the data model which contains the all DB related operations including select, insert, delete and update. I have used Entity Data Model(edmx) to build model for my application. We can also have classes to represent the DB operations like DAL.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;u&gt;&lt;b&gt;View&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;u&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;The view describes the user interface which will appears to the user.&amp;nbsp;Normally&amp;nbsp;the page files(.aspx) with html design is called views. It doesn&#39;t contain the code behind file. since its not event driven.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Controller&lt;/b&gt;&lt;/u&gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Controllers are class file which should be derived from the base class &lt;b&gt;Controller. &lt;/b&gt;Basically controllers determine which view should be called based on the URL routes. The default route is defined in the Application_Start() event of Global.asax.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Sample Application&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;u&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;I&#39;d like to create one sample application so that you could understand more clearly how the model, view and controllers are interacting each other with real time scenario.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Purpose&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;To display all the Employees from &lt;b&gt;Northwind&lt;/b&gt;&amp;nbsp;database &lt;b&gt;Employees&lt;/b&gt; table.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Step 1 : Creating ASP.NET MVC Web Application&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt; &lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Create &lt;b&gt;ASP.NET MVC Web Application&lt;/b&gt; under .Net Framework 3.5. Note that we have created MVC Framework 1.0. Refer the below image how the solution looks,&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyPXJdMQOAIrBd4luPqz_i8VJziaLyRX0k6rku8mn4KnzqcL3qJGQ5Wge_akj0HIfrgvI-oJz7w9JusJ25AjP2LG_9DFuFkQU1KOHX96Bncuz0QoeUhXJ-cZrupTJ2Le4OHsxmdoqK2i_Y/s1600/ProjectStructure.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyPXJdMQOAIrBd4luPqz_i8VJziaLyRX0k6rku8mn4KnzqcL3qJGQ5Wge_akj0HIfrgvI-oJz7w9JusJ25AjP2LG_9DFuFkQU1KOHX96Bncuz0QoeUhXJ-cZrupTJ2Le4OHsxmdoqK2i_Y/s320/ProjectStructure.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;If you look at the project structure, you could find Controllers, Models and Views folder to hold the respective files.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Step 2 : Add Controllers&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Right click on the &lt;b&gt;Controllers&lt;/b&gt; folder and select &lt;b&gt;Add Controller &lt;/b&gt;menu, it will open a popup (see the below image) to give the controller name with suffix of &lt;b&gt;controller.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/span&gt; &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLnfos-J5DvdGF6vvLOzxvj7J63Kx1RNzK6p6py4YV8Uc9oxX3TnzMxuybhquInACu9GpKgpOGomAbHFG-K2XKorIkbz3BxpEx5ArHq_f4HRi-Qw_vrmIkE2DhgD2gSjzaP9WovTWgVxN3/s1600/AddController.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLnfos-J5DvdGF6vvLOzxvj7J63Kx1RNzK6p6py4YV8Uc9oxX3TnzMxuybhquInACu9GpKgpOGomAbHFG-K2XKorIkbz3BxpEx5ArHq_f4HRi-Qw_vrmIkE2DhgD2gSjzaP9WovTWgVxN3/s320/AddController.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/span&gt; &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;It also has the check box to Add action methods for create, update and Details scenarios. If you check this box it will create controller action for the Create, update and details action.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Step 3 : SampleController File&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;After you click that &lt;b&gt;Add &lt;/b&gt;button, it will add controller file to Controllers folder. Look at the below image how it looks like.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiE84Peb2icPrdmp0XBCG9hdiqwFwFwNJsw_Hwf_Iov-eqOml-TeY2z5ksdC5tcFupoj0UsUIoefGcgniTmtTY4PkoJR6lByJZd1FWatmlJLi36i5pB6PX3JW_MI0r5EJeVZ3YvBLSqqdZK/s1600/SampleControllers.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiE84Peb2icPrdmp0XBCG9hdiqwFwFwNJsw_Hwf_Iov-eqOml-TeY2z5ksdC5tcFupoj0UsUIoefGcgniTmtTY4PkoJR6lByJZd1FWatmlJLi36i5pB6PX3JW_MI0r5EJeVZ3YvBLSqqdZK/s320/SampleControllers.jpg&quot; width=&quot;262&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The Class contains &lt;b&gt;Index&lt;/b&gt; method with the type of &lt;b&gt;ActionResult &lt;/b&gt;and return View(). The controller is ready now. We have to create Model and View to make this work.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;Step 4 : Create Model&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Creating model is very easy as we are going to use Entity Data Model(edmx). Right click on the Model folder and select &lt;b&gt;New Item&lt;/b&gt;. Select &lt;b&gt;Data &lt;/b&gt;from Category then select &lt;b&gt;ADO.NET Entity Data Model&lt;/b&gt;. A pop up will open and select &lt;b&gt;Generate From Database&lt;/b&gt;.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Click &lt;b&gt;Next&lt;/b&gt;&amp;nbsp;and select the server and database to create Model.You could find the &lt;b&gt;Model1.edmx &lt;/b&gt;under Model folder.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Good.. Model is ready to consume the data from Database.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;Step 5 : Add Code in Controller file&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-weight: normal;&quot;&gt;Add &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Model Namespace&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-weight: normal;&quot;&gt; to controller file in order to get the classes from the Model.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;b&gt;&lt;u&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #b6d7a8;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;public ActionResult Index()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #b6d7a8;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #b6d7a8;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;NorthwindEntities nw = new NorthwindEntities();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #b6d7a8;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;var emp = nw.Employees;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #b6d7a8;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;return View(&quot;Index&quot;,emp);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #b6d7a8;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Add the above code into method &lt;b&gt;Index &lt;/b&gt;of the controller file created. The first line is creating the instance for the model which we have created from Northwind/any other DB. The Employees is a ObjectQuery which will return all the employees from the database. The var defines the Object which can be bind to the View. The last line return the View with the view name called &quot;Index&quot; and the datasource object.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;Note: &lt;/b&gt;Here we are calling the view from Controller.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;Step 6 : Creating View&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Right click on the Above ActionResult &lt;b&gt;Index &lt;/b&gt;and click &lt;b&gt;Add View. &lt;/b&gt;Now you could see the below image...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisu8XxQ6N4TMSh1CcJTGRa7PCB8tow8FC0pXdsGbZvTClK5FiXPV98xHnRhXLn21A_xoEfxeuqkMrA1sMzEAY45HEWmHtk29ebCnm06lLZPdAvTR9vxTw3mA_QmA8xu-yTJQvGXWvXwhoB/s1600/AddView.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisu8XxQ6N4TMSh1CcJTGRa7PCB8tow8FC0pXdsGbZvTClK5FiXPV98xHnRhXLn21A_xoEfxeuqkMrA1sMzEAY45HEWmHtk29ebCnm06lLZPdAvTR9vxTw3mA_QmA8xu-yTJQvGXWvXwhoB/s320/AddView.jpg&quot; width=&quot;297&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/span&gt;&lt;/span&gt; &lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The View name will come by default. Check &lt;b&gt;Create a strongly-typed view &lt;/b&gt;and&amp;nbsp;&amp;nbsp;you have to choose the Model from the Model(.edmx) class here am using Employees. In addition with select view content, We are going to display all the employees so select &lt;b&gt;List.&lt;/b&gt;&amp;nbsp;Note that the user can select the Master page for the view.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/span&gt;&lt;/span&gt; &lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Finally click &lt;b&gt;Add.&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;Step 7 : Index View&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/span&gt;&lt;/span&gt; &lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;If you look at the Views Folder, new folder has created with the controller name(Sample). Inside Sample folder, file named Index.aspx created with all the table fields to display the list of employees.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Its really amazing when see it first time. No need to drag and drop any controls or write any html code to build the tables. Simply all the html codes are in the view.If you look in deep you could see the binding has also been included in the html code.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju2B8VGo4KElNdMEaXButu6koGRZwTfvknFA_Tqv255fNOc9l9rONvV0jwKbO_RVm5sHpxSSPKwApes7vNGEIXBmkkKoz2ptNRbdFOb65PAzqJn67MdgCo1uJpcv1RTtZne5hBiGwx7jKi/s1600/View_Code.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju2B8VGo4KElNdMEaXButu6koGRZwTfvknFA_Tqv255fNOc9l9rONvV0jwKbO_RVm5sHpxSSPKwApes7vNGEIXBmkkKoz2ptNRbdFOb65PAzqJn67MdgCo1uJpcv1RTtZne5hBiGwx7jKi/s400/View_Code.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Index View Code&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;It loop through all the items in the Model(The model selected for this view is Employees) and build the html table. The arrow indicates the loop and how the field has been binded with the table cell. Also note that the&amp;nbsp;Edit/Details/Delete&amp;nbsp;links are created for each row. This will help you to edit the particular row or to see the details about the row. Don worry about this at present. We have to build view to display the details/edit the row.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The Application is ready except one below configuration settings step.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;Step 8 : Configure in Global.asax&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The Global.asax is located in the applications root directory and open it.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH-J81HNvbyql0UCFEj-PgDNdkCHOwDdmLjUuV7UTfMmqvN1UQCzz5-gioBrWirs08XG9Lnpttrx1Khj37t2MGqxR1aAklnOH2UoB3XGtu5OHrOdwlU4wTMJa8vS9lS2OZ7hpA7UDl9EKR/s1600/Global.asax.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH-J81HNvbyql0UCFEj-PgDNdkCHOwDdmLjUuV7UTfMmqvN1UQCzz5-gioBrWirs08XG9Lnpttrx1Khj37t2MGqxR1aAklnOH2UoB3XGtu5OHrOdwlU4wTMJa8vS9lS2OZ7hpA7UDl9EKR/s400/Global.asax.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;Global.asax&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The &lt;b&gt;Application_Start()&lt;/b&gt;&amp;nbsp;call the &lt;b&gt;RegisterRoutes &lt;/b&gt;method and pass the &lt;b&gt;RouteTable.Routes &lt;/b&gt;as parameter. We are going to add the default route to the routes. The green color bordered area shows how to add MapRoute to the Routes. The &quot;Default&quot; is the route name, next one is format and last on is value for the format. For the above definition, the URL looks like&amp;nbsp;&lt;b&gt;http://localhost:1173/Home/Index&lt;/b&gt;. Home is a Controller and Index is a View.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;Step 8 : Run the Application&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Run the application and this will display the default page (&lt;b&gt;Home\Index.aspx&lt;/b&gt;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1gzRNNvPiCs2M1RH3iVbMTHr2ikWf8ZVugoWurED2EcC_a5DHGmDjOpjTce9cNRa3pJgNIhu7LlazN8CS64tsUDMNBYk6zIwyT3CT9BzHzvHDVb8sPtRaNsY7Qe-Hs7bU145ed11h1riz/s1600/ResultPage_Default.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;90&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1gzRNNvPiCs2M1RH3iVbMTHr2ikWf8ZVugoWurED2EcC_a5DHGmDjOpjTce9cNRa3pJgNIhu7LlazN8CS64tsUDMNBYk6zIwyT3CT9BzHzvHDVb8sPtRaNsY7Qe-Hs7bU145ed11h1riz/s400/ResultPage_Default.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;If you want to access our page which we have developed, Change the URL to the below one,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;http://localhost:1173/Sample/Index&lt;/b&gt; or&amp;nbsp;&lt;b&gt;http://localhost:1173/Sample&lt;/b&gt;&amp;nbsp;is enough since Index is a default page.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Here is our First MVC output..&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy41FQbuJFQmxHPXKj5HIiateHq8I-KzntbqRksHuAyn_TcP2OJt6kmLHpivxdMJP24mRNJ2p52icn35aJhNMfdjEnGS9tL-HwoSB5ApOsmPY3QgoDO3-TxPmwx57d_T8a-9FDlVPg0fir/s1600/ResultPage.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy41FQbuJFQmxHPXKj5HIiateHq8I-KzntbqRksHuAyn_TcP2OJt6kmLHpivxdMJP24mRNJ2p52icn35aJhNMfdjEnGS9tL-HwoSB5ApOsmPY3QgoDO3-TxPmwx57d_T8a-9FDlVPg0fir/s400/ResultPage.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;This is really nice to see the output without coding much...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Happy Programming...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/7531202175566386466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2010/08/mvc-tutorial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/7531202175566386466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/7531202175566386466'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2010/08/mvc-tutorial.html' title='MVC Basics'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyPXJdMQOAIrBd4luPqz_i8VJziaLyRX0k6rku8mn4KnzqcL3qJGQ5Wge_akj0HIfrgvI-oJz7w9JusJ25AjP2LG_9DFuFkQU1KOHX96Bncuz0QoeUhXJ-cZrupTJ2Le4OHsxmdoqK2i_Y/s72-c/ProjectStructure.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-3730258308159749457</id><published>2010-07-19T04:02:00.000-07:00</published><updated>2010-08-10T05:51:53.574-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Service unavailable"/><category scheme="http://www.blogger.com/atom/ns#" term="Service unavailable in websites"/><category scheme="http://www.blogger.com/atom/ns#" term="Service unavailable in windows 2003"/><title type='text'>Service unavailable error when browse pages in Windows 2003</title><content type='html'>&lt;script type=&quot;text/javascript&quot;&gt;
  var _gaq = _gaq || [];
  _gaq.push([&#39;_setAccount&#39;, &#39;UA-17779694-1&#39;]);
  _gaq.push([&#39;_trackPageview&#39;]);

  (function() {
    var ga = document.createElement(&#39;script&#39;); ga.type = &#39;text/javascript&#39;; ga.async = true;
    ga.src = (&#39;https:&#39; == document.location.protocol ? &#39;https://ssl&#39; : &#39;http://www&#39;) + &#39;.google-analytics.com/ga.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(ga, s);
  })();
&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
Getting &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;Service unavailable&lt;/span&gt;&quot; error when you try to access the web pages hosted in Windows 2003 server.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Resolution 1&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
Right click on website and click Properties menu. you could find &quot;Web Site&quot; tab.&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
Check for TCP Port Number. Change the port number which is not assigned to any other web site. The other virtual directories(web sites) may access the same port no.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Resolution 2&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
1. Right click on website and click Properties menu. Click on &quot;&lt;b&gt;Home Directory&lt;/b&gt;&quot; tab.&lt;br /&gt;
&lt;br /&gt;
2. Get &quot;&lt;b&gt;Application pool&lt;/b&gt;&quot; name and verify whether that application pool service has started.&lt;br /&gt;
&lt;br /&gt;
3. &quot;&lt;b&gt;Application Pools&lt;/b&gt;&quot; exists above the websites folder.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Conclusion&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
I have faced the above said error and rectified using the resolution2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/3730258308159749457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2010/07/service-unavailable-error-when-browse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/3730258308159749457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/3730258308159749457'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2010/07/service-unavailable-error-when-browse.html' title='Service unavailable error when browse pages in Windows 2003'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-1746961915048897065</id><published>2010-04-25T00:00:00.000-07:00</published><updated>2010-04-25T01:13:27.595-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gridview"/><category scheme="http://www.blogger.com/atom/ns#" term="Gridview - Highlight selected row after Postback"/><category scheme="http://www.blogger.com/atom/ns#" term="Highlight selected row"/><category scheme="http://www.blogger.com/atom/ns#" term="row selection after postback"/><title type='text'>Gridview - Highlight selected row after Postback</title><content type='html'>&lt;div&gt;&lt;b&gt;&lt;u&gt;Problem:&lt;/u&gt;&lt;/b&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;I have a gridview to display employee information. When user clicks on employee no /name the particular row should be selected and selected row color should be changed. This has to be done after the postback.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTwx9bl721aCA5zarDNH_6HSY-VevWdfibF50deIabgWjD2z-wqcGx713YNSAvvWJ7Q5Xf0buVKwkwtixS5XOooeHYZFgfQq-v4-gAQSjNg5vmcfmZB7NkzEiOzyQlx1T6hYAZ1ogHCffx/s1600/CodeSnippet.png&quot;&gt;&lt;img style=&quot;float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 63px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTwx9bl721aCA5zarDNH_6HSY-VevWdfibF50deIabgWjD2z-wqcGx713YNSAvvWJ7Q5Xf0buVKwkwtixS5XOooeHYZFgfQq-v4-gAQSjNg5vmcfmZB7NkzEiOzyQlx1T6hYAZ1ogHCffx/s320/CodeSnippet.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5463980702503666130&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0x08pDD9hj0ttRj3FHrQmHR1DXDZ5CqGTdTISVVGoICl1lgIA7wM6IXiBXQVyFCxeqUeld-E4cFsWuIXgXNx5sSHQQozCpBLxESX5UlhHm6x_McucWXHxN42JzM4LANjtgCt8i-lWZfc6/s1600/Grid.png&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0x08pDD9hj0ttRj3FHrQmHR1DXDZ5CqGTdTISVVGoICl1lgIA7wM6IXiBXQVyFCxeqUeld-E4cFsWuIXgXNx5sSHQQozCpBLxESX5UlhHm6x_McucWXHxN42JzM4LANjtgCt8i-lWZfc6/s1600/Grid.png&quot;&gt;&lt;img style=&quot;float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 97px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0x08pDD9hj0ttRj3FHrQmHR1DXDZ5CqGTdTISVVGoICl1lgIA7wM6IXiBXQVyFCxeqUeld-E4cFsWuIXgXNx5sSHQQozCpBLxESX5UlhHm6x_McucWXHxN42JzM4LANjtgCt8i-lWZfc6/s320/Grid.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5463976947539920002&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Solution:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Since we are doing it after postback, the control losts the data as well  selected row. We can do this with linkbutton control to change the color of the selected row very easily.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;code snippet:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;div&gt;If you look at the snippet in the first image, I have used the linkbutton inside the itemtemplate. The important thing here is the property &lt;b&gt;CommandName&lt;/b&gt; as &lt;b&gt;Select&lt;/b&gt;. This property will take care of the selected row color changes. The row selection color will be taken from the SelectedRowStyle styles from the gridview.&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Conclusion:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;Hope this will be easy for everyone rather than doing it after the binding the grid with some  extra code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy coding...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/1746961915048897065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2010/04/gridview-highlight-selected-row-after.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/1746961915048897065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/1746961915048897065'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2010/04/gridview-highlight-selected-row-after.html' title='Gridview - Highlight selected row after Postback'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTwx9bl721aCA5zarDNH_6HSY-VevWdfibF50deIabgWjD2z-wqcGx713YNSAvvWJ7Q5Xf0buVKwkwtixS5XOooeHYZFgfQq-v4-gAQSjNg5vmcfmZB7NkzEiOzyQlx1T6hYAZ1ogHCffx/s72-c/CodeSnippet.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-6450026879151994378</id><published>2010-04-15T20:05:00.000-07:00</published><updated>2010-04-18T21:52:26.368-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="_self"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript window open"/><category scheme="http://www.blogger.com/atom/ns#" term="Open page without postback"/><category scheme="http://www.blogger.com/atom/ns#" term="Open up a page in the same browser"/><category scheme="http://www.blogger.com/atom/ns#" term="Window.Open"/><title type='text'>Open a page in the same browser using JavaScript without Postback</title><content type='html'>Problem:&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;Had a requirement to open up a page in the same browser window without postback to the existing page.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Solution:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;In JavaScript, &lt;b&gt;window.Open(...)&lt;/b&gt; is there to open a page in a new window. With the value of &lt;b&gt;_self &lt;/b&gt;as a second parameter to the Window.Open, we could open the page in the same browser window. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Code Snippet:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;#1 Using Image Button&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;asp:imagebutton id=&quot;ImageButton1&quot; runat=&quot;server&quot; imageurl=&quot;~/coupon1.JPG&quot;&gt;&lt;/asp:imagebutton&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#CC0000;&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;  &lt;asp:imagebutton id=&quot;ImageButton1&quot; runat=&quot;server&quot; imageurl=&quot;~/coupon1.JPG&quot;&gt;&lt;/asp:imagebutton&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;             OnClientClick=&quot;Javascript:window.open(&#39;Format.aspx&#39;,&#39;_self&#39;,null,false);return false;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); &quot;&gt;&lt;b&gt;&lt;u&gt;#2 Using href anchor tag&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;a href=&quot;javascript:window.open(&#39;Format.aspx&#39;,&#39;_self&#39;);&quot; style=&quot;text-decoration:underline&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;a href=&quot;javascript:window.open(&#39;Format.aspx&#39;,&#39;_self&#39;);&quot; style=&quot;text-decoration:underline&quot;&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/a&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt; href=&quot;javascript:window.open(&#39;Format.aspx&#39;,&#39;_self&#39;);&quot; style=&quot;text-decoration:underline&quot; id=&quot;A1&quot; &gt;Click...Here&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;I have opened the page called &quot;Format.aspx&quot; using window.open with the second parameter as &quot;&lt;b&gt;_self&lt;/b&gt;&quot; on the OnClientclick of  ImageButton. Finally give the return false to not posted back to the existing page.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Reference:&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;Refer the below Microsoft knowledge base library for more info. &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms536651(VS.85).aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/ms536651(VS.85).aspx&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/6450026879151994378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2010/04/open-page-in-same-browser-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6450026879151994378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6450026879151994378'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2010/04/open-page-in-same-browser-using.html' title='Open a page in the same browser using JavaScript without Postback'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-6502336847175375889</id><published>2010-03-03T23:55:00.001-08:00</published><updated>2010-03-04T00:09:56.213-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Report"/><category scheme="http://www.blogger.com/atom/ns#" term="rdlc"/><category scheme="http://www.blogger.com/atom/ns#" term="ReportViewer"/><category scheme="http://www.blogger.com/atom/ns#" term="Runtime Report"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows ReportViewer"/><title type='text'>Windows ReportViewer - Change rdlc report files during runtime</title><content type='html'>&lt;div&gt;&lt;b&gt;Problem&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I had faced the problem of assigning different rdlc report files to a single Reportviewer. It always shows the report which opened first.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Clear the datasources of the LocalReport or ServerReport in ReportViewer&lt;/li&gt;&lt;li&gt;Reset the ReportViewer control in the beggining of the function. &lt;/li&gt;&lt;li&gt;Do assign the datasources Name and Value. The Datasources name from the dataset as string and value.&lt;/li&gt;&lt;li&gt;Finally add the datasource to the reportviwer datasource in localreport or serverreport.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Sample c# code snippet to solve this problem&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;      this.reportViewer1.Reset();&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;      this.reportViewer1.LocalReport.DataSources.Clear();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;      reportDataSource.Name = &quot;DataSet_usp_EmpFoodCouponMonthly&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;      reportDataSource.Value = this.DataSet.usp_EmpFoodCouponMonthly;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;      this.reportViewer1.LocalReport.DataSources.Add(reportDataSource);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;      this.reportViewer1.RefreshReport();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/6502336847175375889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2010/03/windows-reportviewer-change-rdlc-report.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6502336847175375889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6502336847175375889'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2010/03/windows-reportviewer-change-rdlc-report.html' title='Windows ReportViewer - Change rdlc report files during runtime'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-3831775503488905890</id><published>2010-01-04T20:04:00.000-08:00</published><updated>2010-01-04T20:10:33.550-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Callback"/><category scheme="http://www.blogger.com/atom/ns#" term="Difference between Callback and Postback"/><category scheme="http://www.blogger.com/atom/ns#" term="Difference between Postback and Callback"/><category scheme="http://www.blogger.com/atom/ns#" term="Postback"/><title type='text'>Difference between Postback and Callback</title><content type='html'>The &lt;b&gt;OnPreRender &lt;/b&gt;won&#39;t be fired in the Callback event. Whereas in Postback, After the particular event handling, the PreRender will be invoked.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But all the controls will be created again in both Postback and Callback. The viewstate values will be reassigned to the controls again.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/3831775503488905890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2010/01/difference-between-postback-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/3831775503488905890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/3831775503488905890'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2010/01/difference-between-postback-and.html' title='Difference between Postback and Callback'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-350794267341955231</id><published>2009-10-15T20:10:00.001-07:00</published><updated>2010-08-20T02:15:23.733-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="9.2.6"/><category scheme="http://www.blogger.com/atom/ns#" term="ASPxGridview"/><category scheme="http://www.blogger.com/atom/ns#" term="Databind is not working"/><title type='text'>Binding Datasource to ASPxGridview Version 9.2.6</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;color: #3366ff; font-family: arial;&quot;&gt;&lt;u&gt;Control : DevExpress - ASPxGridView - 9.2.6&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #3366ff; font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #3366ff; font-family: arial;&quot;&gt;&lt;u&gt;Problem Statement&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3366ff; font-family: Arial; font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3366ff; font-family: Arial;&quot;&gt;  We &#39;ll be assigning the datasource to the ASPxGridview and set KeyFieldName and call the DataBind method to get the data displayed in the ASPxGridview. Below is the partial code of BindData() method,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3366ff; font-family: Arial; font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #990000; font-family: Arial;&quot;&gt;&lt;em&gt;ASPxGridview.Datasource = DataTable;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #990000; font-family: Arial;&quot;&gt;&lt;em&gt;ASPxGridview.KeyFieldName = &quot;PrimaryKey&quot;;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #990000; font-family: Arial;&quot;&gt;&lt;em&gt;ASPxGridview.DataBind();&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #990000; font-family: Arial; font-size: 85%;&quot;&gt;&lt;em&gt;&lt;br /&gt;
&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;This method is being called from OnLoad and button click event.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;This is working fine with 9.1.3. But when we try to convert it to 9.2.6 it shows the below error&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial;&quot;&gt;The KeyFieldName is not exists in the underlying datasource...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial; font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;&lt;strong&gt;&lt;u&gt;Solution&lt;/u&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;&lt;strong&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;You can assign the datasource there itself. But need to move the keyfieldname assignment and DataBind() call to OnPreRender method as given below..&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial; font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;protected override void OnPreRender(EventArgs e)        &lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;{            &lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;base.OnPreRender(e);&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;ASPxGridview.KeyFieldName = &quot;KeyID&quot;;     &lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;ASPxGridview.DataBind();&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;}&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;OnLoad method for your reference..&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3333ff; font-family: Arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;protected override void OnLoad(EventArgs e)    &lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;{     &lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;base.OnLoad(e);     &lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;if(Page.IsPostBack)&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;{     &lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;EnsureChildControls();     &lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;BindData();&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;} &lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000;&quot;&gt;}&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: #990000; font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;color: #990000; font-family: Arial; font-size: 85%;&quot;&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;color: #990000; font-family: Arial; font-size: 85%;&quot;&gt;&lt;/span&gt;&lt;/em&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/350794267341955231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2009/10/binding-datasource-to-aspxgridview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/350794267341955231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/350794267341955231'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2009/10/binding-datasource-to-aspxgridview.html' title='Binding Datasource to ASPxGridview Version 9.2.6'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-6349838481282972107</id><published>2009-09-16T00:35:00.000-07:00</published><updated>2009-09-16T01:14:08.363-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASPxGridview"/><category scheme="http://www.blogger.com/atom/ns#" term="ASPxHyperLink"/><category scheme="http://www.blogger.com/atom/ns#" term="Control in a ASPxGridview Cell"/><category scheme="http://www.blogger.com/atom/ns#" term="ITemplate"/><title type='text'>Have link button inside ASPxGridview cell using ITemplate</title><content type='html'>&lt;span style=&quot;color:#3333ff;&quot;&gt;Requirement :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;This might be useful when you have list of items displayed in a ASPxGridview and a column have link which needs to open a popupmenu when user clicks on that link. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;We have to create a ASPxPopupMenu with menu items and add ITemplate class to have link to be displayed inside the ASPxGridview cell. Define &quot;CustomColumnDisplayText&quot; event for the ASPxGridview and assign the ITemplate with the column. &quot;CustomColumnDisplayText&quot; event will be fired whenever the new record added to the ASPxGridview from Datasource. Then the ITemplate will be fired and place the control inside ASPxGridview cell.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;I&#39;ve given the above scenario with sample code.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;Create menu at class scope&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;private ASPxPopupMenu menu;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;private ASPxGridView gvControl;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;Instantiate the menu this inside CreateChildControls() method and add menu items...&lt;br /&gt;&lt;/span&gt;&lt;em&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;menu = new ASPxPopupMenu();&lt;br /&gt;menu.ID = &quot;menu&quot;;&lt;br /&gt;menu.ClientInstanceName =”menu”;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;em&gt;menu.Items.Add(&#39;Add-Menu&#39;&#39;mnuAdd&#39;);&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;em&gt;gvControl = new ASPxGridView(); &lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;em&gt;gvControl .ID = &quot;gvControl &quot;;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;gvSalesOrderItemPegging.ClientInstanceName = &quot;gvControl&quot;;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;em&gt;gvControl .SettingsBehavior.AllowFocusedRow = true; &lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;em&gt;gvControl .CustomColumnDisplayText += new ASPxGridViewColumnDisplayTextEventHandler(gvControl_CustomColumnDisplayText); &lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;em&gt;gvControl .SettingsBehavior.AllowSort = true;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;em&gt;// Kindly add the columns and assign datasource to the gvControl Gridview&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;Create ITemplate to display link in a Gridview cell.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;em&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;public class MenuTemplate : ITemplate&lt;br /&gt;{&lt;br /&gt;ASPxHyperLink hp = new ASPxHyperLink();&lt;br /&gt;// Create hyperlink to display the popup menu when user clicks on&lt;br /&gt;hp.ID = &quot;HyLink&quot; + strHyperId;&lt;br /&gt;hp.ClientInstanceName = &quot;HyLink&quot; + strHyperId;&lt;br /&gt;hp.Text = strSelected;&lt;br /&gt;hp.Cursor = &quot;Hand&quot;;&lt;br /&gt;sring strScript = &quot;menu.ShowAtElement(s.mainElement);&quot;;&lt;br /&gt;hp.ClientSideEvents.Click = String.Format(&quot;function(s, e) {{{0}}}&quot;, strScript);&lt;br /&gt;container.Controls.Add(hp);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;Create Gridview’s CustomColumnDisplayText event&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;em&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;private void gvControl_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)&lt;br /&gt;{&lt;br /&gt;If (e.Column.Name == &quot;ReqMrpElementAbbr&quot;)&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;e.Column.DataItemTemplate = new MenuTemplate();&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/em&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/6349838481282972107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2009/09/have-link-button-inside-aspxgridview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6349838481282972107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/6349838481282972107'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2009/09/have-link-button-inside-aspxgridview.html' title='Have link button inside ASPxGridview cell using ITemplate'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-2125525177385161973</id><published>2009-09-04T02:33:00.000-07:00</published><updated>2009-09-16T01:15:41.664-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASPxCallBackpanel"/><category scheme="http://www.blogger.com/atom/ns#" term="ASPxGridview"/><category scheme="http://www.blogger.com/atom/ns#" term="ASPxPopupControl"/><category scheme="http://www.blogger.com/atom/ns#" term="Composite Control"/><title type='text'>Points to remember while creating composite controls</title><content type='html'>&lt;strong&gt;1. Get the ClientID of the control created and attach that ID to the child controls ID as well ClientInstanceName.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Sample Code in C#&lt;br /&gt;&lt;em&gt;&lt;span style=&quot;color:#990000;&quot;&gt;public class NewControl : CompositeControl&lt;br /&gt;{&lt;br /&gt;ASPxTextBox txtTest;&lt;br /&gt;protected override void CreateChildControls()&lt;br /&gt;{&lt;br /&gt;txtTest = new ASPxText();&lt;br /&gt;txtTest.ID = &quot;txtTest&quot; + this.ClientID;&lt;br /&gt;txtTest.ClientInstanceName = &quot;txtTest&quot; + this.ClientID;&lt;br /&gt;txtTest.Text = “Control Initialized”;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;this.Controls.Add(txtTest);&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;strong&gt;2. All controls that are interactive (i.e. not standard HTML code) created in CreateChildControls().&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;3. &lt;strong&gt;When you use popup control inside a composite control, use popup control’s Show/Popup client side events to render the controls and change contents.&lt;br /&gt;&lt;/strong&gt;&lt;em&gt;&lt;span style=&quot;color:#990000;&quot;&gt;strScript = cbPanelID + &quot;.PerformCallback (&#39;Binding&#39;);&quot;;&lt;br /&gt;pcComments.ClientSideEvents.PopUp = string.Format (&quot;function(s,e) {{{0}}}&quot;, strScript);&lt;br /&gt;void cbPanel_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)&lt;br /&gt;{&lt;br /&gt;// Write codes here to perform action while loading the control&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;We are calling the Callback panels (cbPanelID) PerformCallback client side event when popup window (pcComments) populated.</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/2125525177385161973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2009/09/points-to-remember-while-creating.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/2125525177385161973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/2125525177385161973'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2009/09/points-to-remember-while-creating.html' title='Points to remember while creating composite controls'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4774617985778665145.post-1827673062890936386</id><published>2009-09-04T01:37:00.000-07:00</published><updated>2009-09-16T01:16:08.757-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASPxButton"/><category scheme="http://www.blogger.com/atom/ns#" term="ASPxGridview"/><category scheme="http://www.blogger.com/atom/ns#" term="DevExpress"/><title type='text'>Tips to work in DevExpress Controls</title><content type='html'>DevExpress controls are rich in cleint side script handling. I&#39;ve started using this from jun-09 onwards only. I&#39;ve some points to share when you work with DevExpress controls especially ASPxGridView, ASPxCallBackPanel and ASPxPopupControl...&lt;br /&gt;&lt;br /&gt;1. &lt;strong&gt;Set unique ID and ClientInstanceName for every control created in the form/user control&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style=&quot;color:#990000;&quot;&gt;string strClientItemClickScript =” window.open(strURL,&#39;Popup&#39;,&#39;toolbar=no ,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=900,height=600,left=50,top=60&#39;)” ;&lt;br /&gt;&lt;br /&gt;menuCUSORD.ClientSideEvents.ItemClick = String.Format (&quot;function(s, e) {{{0}}}&quot;, strClientItemClickScript);&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;2. Make AutoPostback property of ASPxButton control to false, when you call callback panel’s callback events through client side (Javascript) code.&lt;br /&gt;&lt;br /&gt;3. &lt;strong&gt;How to add controls into an ASPxGridview cell&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Create an ITemplate class&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;&lt;span style=&quot;color:#990000;&quot;&gt;public class PeggingReqMenuTemplate : ITemplate&lt;br /&gt;{&lt;br /&gt;public void InstantiateIn(Control container)&lt;br /&gt;{&lt;br /&gt;ASPxHyperLink hp = new ASPxHyperLink();&lt;br /&gt;hp.ID = &quot;HyLink&quot; + strHyperId;&lt;br /&gt;hp.ClientInstanceName = &quot;HyLink&quot; + strHyperId;&lt;br /&gt;container.Controls.Add(hp);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Add ITemplate class to DataItemTemplate,&lt;br /&gt;private void gvSalesOrderItemPegging_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)&lt;br /&gt;{&lt;br /&gt;If (e.Column.FieldName == &quot;MaterialNo&quot;)&lt;br /&gt;e.Column.DataItemTemplate = new PeggingReqMenuTemplate();&lt;br /&gt;}&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style=&quot;color:#990000;&quot;&gt;&lt;/span&gt;&lt;/em&gt;</content><link rel='replies' type='application/atom+xml' href='http://murugesanblogs.blogspot.com/feeds/1827673062890936386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://murugesanblogs.blogspot.com/2009/09/devexpress-aspxbutton-in-callbackpanel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/1827673062890936386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4774617985778665145/posts/default/1827673062890936386'/><link rel='alternate' type='text/html' href='http://murugesanblogs.blogspot.com/2009/09/devexpress-aspxbutton-in-callbackpanel.html' title='Tips to work in DevExpress Controls'/><author><name>Murugesan Kumarasamy</name><uri>http://www.blogger.com/profile/11111857307775521480</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9dGa_lZ-H4T0IbEir0p5qeXCjGPHEgxv_Ix5qHfOZZAFVdRZvNDt1K5FVOsPcDja47oEk1z1Nkw2eFGK2quUU5mTuSv6uAH-fXHjyHn6uUl4HP35_eUOsffUdCXl0u7w/s220/Murugesan.jpg'/></author><thr:total>0</thr:total></entry></feed>