ASP.NET MVC - Working With Multiple Models In A Single View

33512 2/6/2014 4:02:57 PM

Download Sample Source Code-Using Multiple Models In Single View ASP.NET_MVC_5.zip Introduction Most of the real work application requires to show data from multiple/different Models / Tables / Databases. Showing multiple models in a view is common requirement, that's where I started Learning different ways to achieve this. Best approaches of passing / using multiple models (objects)in one view in ASP.NETMVC 4 / MVC 5 are as follows: Using Combined Model (Model with multiple objects) Using Partial Views Using Ajax Data Carrier in MVC ViewBag ViewData TempData Background Please download sam...

ASP.NET MVC - Working With Files : File Operations

14452 12/25/2013 9:02:38 PM

Uploading, Downloading, Displaying / Streaming and DeletingMultiple Files in ASP.NET MVC (C#): Download Sample Source Code - Working With Files ASP.NET MVC 5 File processing- Working with Files (Uploading / Downloading / Displaying Streaming / Deleting) using C# in ASP.NET MVC 4 and MVC 5 , here we are going to cover following : Setting up form method and content type Uploading Files Uploading File On Server Uploading Multiple Files On Server Downloading Files Streaming / Displaying Files Deleting Files This article will work for all types of files- Images / Videos ( .jpg, .png, .bmp, .jpeg, ....

ASP.NET MVC - Html.ActionLink As Button Or An Image, Not A Link

12156 12/7/2013 12:04:36 PM

Apply a CSS class to the htmlAttributes object. <%= Html.ActionLink("Button Name", "Action Name", "ControllerName", new { @class="classname" }) %> and then create a class in your stylesheet a.classname { background: url(../Images/image.gif) no-repeat top left; display: block; width: 150px; height: 150px; text-indent: -9999px; /* hides the link text */ } ...

ASP.NET MVC - Adding and Updating Meta Tags Dynamically

9043 12/6/2013 9:40:12 PM

If you are working in ASP.NET MVC have questions like - How to pass page's meta tags - adding Meta tags onRazor engine.cshtml Pages/adding it dynamically ? Here is answer- In this article we are going to see three ways of doing this- Using JQuery Using ViewBag Using @RenderSection and @Section Approach 1 - Using Jquery : A) In the "_Layout.cshtml" page add a new section call inside the <head> tag, as given below: <head> <meta name="keywords" content="" /> <meta name="description" content="" /> </head> B) In Pag...

ASP.NET MVC - Getting List Of All Active Sessions

8620 9/29/2014 4:11:08 PM

Download Free Source Code Sample :List_Active_Sessions_In_ASP_NET_Web_Form_MVC.zip Introduction In this article we are going to see how can we can we track active users in ASP.NET (Web Form & MVC) web application, and to answer questions like How to get online users count? Track/get active user information? etc. We are going to do it in four steps: Creating Session Repository Setting web.config Configuration Storing Session Data Removing Session Data Show Online User (Active Sessions) Count Background Please download sample code so that you can follow code along with documentation. Sample ...

Perfect Binary Tree - Non-Linear Data Structures

6525 1/31/2017 4:03:55 AM

A binary tree is Perfect if all internal nodes have two children and all leaves are at same level. Examples: Family tree Time Complexity Space Complexity Average Worst Worst Data Structure Access Search Insertion Deletion Access Search Insertion Deletion Binary Search Tree Θ(log(n)) Θ(log(n)) Θ(log(n)) Θ(log(n)) O(n) O(n) O(n) O(n) O(n) Cartesian Tree N/A Θ(log(n)) Θ(log(n)) Θ(log(n)) N/A O(n) O(n) O(n) O(n) B-Tree Θ(log(n)) Θ(log(n)) Θ(log(n)) Θ(log(n)) O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(n) Red-Black Tree Θ(log(n))...

Creating Multilingual Website in ASP.NET MVC

6384 12/7/2013 8:02:47 AM

Download Source Code-ASP_NET_MVC_Multilingual_App.zip Building multilingual website using ASP.NET MVC - This article is intended for beginners and for ASP.NET MVC 2, lets start with introduction. Introduction In this article, we are going to see how we can show localized content to your ASP.NET MVC web application. Background We will see mainly two approaches to resolve this issue: Approach 1: Using Static Pages Approach 2: Using Dynamic page with localized data at runtimeHow It Works / Using Code : Before we start with Approach 1, I would like to request you to download the attached source co...

EWS - Working With Exchange Server Using Web Service

5746 12/20/2013 10:06:25 PM

Introduction Remotely working with Exchange Server /Outlook using Exchange Web Service (EWS)- There are many article how to process using EWS managed API but there are very less article of how we can actually do it remotely using exchange web service. EWS Managed API works only on exchange server. If you are looking for remote processing here is solution. Following are steps involved - Creating An Instance Of Exchange Web Service (EWS) Process Unread Email Attachment Iterate Through Attachments Process Email Attachments Change Status of Emails From ‘Unread’ to ‘Read’ Ho...

Haldiche Gane - Marathi Lagna

5578 10/13/2014 12:46:24 PM

Marathi: पाचा पानाचा विडा । सगळी सुपारी । मारुतीच्या पारावरी ।।१।। मांडवाच्या दारी नुपर गेल्या डेळी । माझे मामाजी लावे केळी ।।२।। मांडवाच्या दारी नुपर गेल्या जांबा । माझे मामाजी लावे आंबा ।।३।। मांडव सुतावायला नागीलीचे पान । पहिला तो माम्याचा मान ।।४।। मांडव सुतावायला नागीलीच्या देठा । कारागीर तो आला चुलता ।।५।। मांडवाच्या दारी उंच घेता काचवा। आल्या नवरदेवाच्या आतवा।।६।। मांडवाच्या दारी चिखल कशाचा झाला । नवरदेवाचा बाप न्हाला ।।७।। मांडवाच्या दारी वाजा वाजते राहू राहू । अहेरी बसले दोघे भाऊ ।।८।। मांडवाच्या दारी वाजा वाजते सनईचा । पहिला अहेर बहिणीचा ।।९।। गावातल्या गावात ननंद्याच नातं। आला अहेर ...


ASP.NET MVC - Exception Handling In Web Application

4036 12/25/2013 3:24:07 PM

ASP.NET MVC Error handling using CSharp: Exception handling is crucial part of every application. It is required for logging errors into database or text/log file, very importantly presenting them to the user in a nicely in case of exception. Introduction: When I was working on application I encounter exceptions (e.g. 400, 500, etc ) but I was not sure of what might have caused it. That's where I started exploring various approaches of exception handling in ASP.NET MVC. There are various ways to handle exceptions, based upon usability and error location/type (SQL, Application, etc) We are ...

EWS - Changing Status Of Emails Using Exchange Web Service

4013 12/19/2013 4:49:41 PM

Changing status of emails from ‘unread’ to ‘read’ using Exchange web service (EWS)- In previous article (How to process email attachments using Exchange web service in ASP.NET?) we saw how to iterate through attachment and process them. Once it is processed you would like to mark as read (change status from ‘unread’ to ‘read’ ) Here will se how we can do that. /// <summary> /// EWS code to update the IsRead flag, *ONLY* for MessageType /// </summary> /// <param name="messageId">email massage/item id</param> /// &...

(BG-CH-02-V-22) Bhagavad Gita Chapter 2 Verse 22

3872 12/5/2013 11:35:31 AM

(BG-CH-02-V-22) Shrimad Bhagavad Gita Chapter 2 Verse (Shloka) 22 Verse (Shloka) वासांसि जीर्णानि यथा विहाय नवानि गृह्णाति नरोऽपराणि।तथा शरीराणि विहाय जीर्णान्यन्यानि संयाति नवानि देही ॥२- २२॥ Transliteration- Vāsānsi jīrṇāni yathā vihāya navāni gr̥hṇāti narō̕parāṇiTathā śarīrāṇi vihāya jīrṇān'yan'yāni sanyāti navāni dēhī #2- 22 Synonyms vasamsi--garments; jirnani--old and worn out; yatha--as it is; vihaya--giving up; navani--new garments; grhnati--does accept; narah--a man; aparani--other; tatha--in the same way; sarirani--bodies; vihaya--giving up; jirnani--old and useless; anyani--different...

ASP.NET - Maximum Length Limit On Query String / URL Parameters / Request

3818 12/11/2013 12:25:19 PM

What is the maximum limit on Query String/ GET/ POST / URL parameters /length- Maximum uniform resource locator (URL) length is 2,083 characters. This limit applies to both POST request and GET request URLs. Note – Maximum URL also varies based on browsers. On Windows: · Opera supports ~4050 characters, · IE 4.0+ supports exactly 2083 characters, · Netscape 3 -> 4.78 support up to 8192 characters before causing errors on shut-down, Netscape 6 supports ~2000 before causing errors on start-up. GET method -you are limited to a maximum of 2,048 characters, minus the n...

Shankarachi Aarti : Lavthavati vikrala brahmandi mala

3650 9/23/2014 4:50:01 PM

Shankarachi Marathi Aarti : Lavthavati vikrala brahmandi mala ||Vishe kantha kala trinetri jwala ||Lavanyasundar mastaki bala ||Tethuniya jal nirmal vahe zhulzhula ||1|| Jai dev jai dev jai shrishankara ||Arti ovaloo tuj karpurgaura Jai dev Jai dev || Karpurgaura Bhola nayani vishala ||Ardhangi parvati sumanachya mala ||Vibhutiche udhalana shitikanth nila ||Aisa shankar shobhe umavelana ||2|| Jai dev jai dev jai shrishankara ||Arti ovaloo tuj karpurgaura Jai dev Jai dev || Devi daitya sagarmanthan pai kele || Tyamaji avachit halahal sapadale ||Te tva asurpane prashan kele ||Neelkantha nam pras...

(BG-CH-01-V-01) Bhagavad Gita Chapter 1 Verse 1

3613 12/8/2013 7:42:55 PM

(BG.1.1) Shrimad Bhagavad Gita - Chapter 1 - Verse (Shloka)-1 Verse (Shloka) - Dhritarashtra said :dharmakshetre kurukshetre samaveda yuyutsavahmamakah pandavas caiva kim akurvata sanjaya #1-1 Synonyms- dhrtarastrah--King Dhrtarastra; uvaca--said; dharma-ksetre--in the place of pilgrimage; kuru-ksetre--in the place named Kuruksetra; samavetah--assembled; yuyutsavah--desiring to fight; mamakah--my party (sons); pandavah--the sons of Pandu; ca--and; eva--certainly; kim--what; akurvata--did they do; sanjaya--O Sanjaya. Meaning- Assembled at Kurukshetra, at Dharmakshetra, and eager for combat, O S...

ASP.NET : FIX-The Length Of The URL For This Request Exceeds MaxUrlLength

3557 12/11/2013 1:23:24 PM

FIX : [HttpException (0x80004005)]: The length of the URL for this request exceeds the configured maxUrlLength value. (HTTP/1.1 400 Bad Request)- What is default length of QueryString / GET / URL parameters? Default length is 290 characters. What is the maximum limit on QueryString / GET/ POST / URL parameters /length? Maximum uniform resource locator (URL) length is 2,083 characters. This limit applies to both POST and GET request URLs. Note – Maximum URL also varies based on browsers. e.g. On Windows: · Opera supports ~4050 characters, · IE 4.0+ supports exactly 2083 char...

ASP.NET MVC - Exception Handling at Application Level - Using Global.aspx

3391 12/23/2013 8:08:28 PM

In previous post you have seen how we can handle exception inside action method Exception Handling in ASP.NET MVC - Using Action Method Advantage - custom error handling can be done for particular action method. Disadvantage - We need to repeat code (try… catch block) in every action. That's why it is good to handle exceptions at application level, so that will write code once use it for all pages. In order to do that you have to add Application_Error() function definition in Global.aspx as follows, this is just an example. protected void Application_Error() { Exception unhandledExc...

ASP.NET MVC - Searching in Table Using JQuery - Client Side

2882 1/15/2014 7:41:13 PM

Download Source Code - Searching In Table ASP.NET MVC 5 In this approach we are assuming we have all data loaded on page. If there are many rows and columns we would like to provide search functionality. Here we are going to create UI just as shown- For this you need - <p> Search term: <input type="text" name="search" /> </p> <table cellpadding="0" cellspacing="0" border="2"> <tr class="data-header" style="color:Blue;"> <td> JQuery Searching - Text 1 </td> <td> JQuery Searching...

EWS - Creating An Instance Of Exchange Web Service In ASP.NET

2803 12/16/2013 4:37:23 PM

Creating an instance of Exchange web service (EWS) in ASP.NET (MVC) using CSharp: First you will need to add web service to project then you will get instance of ExchangeServiceBinding() . You can initiate/invoke an instance of EWS using following code : /// <summary> /// Set all required configuration parameters /// </summary> public void Initialize() { try { // you can also get if from configuration file EmailAddress = "MyEmail@MyDomain.Com"; //AppConfig.EmailAddress; UserName = "MyUserName"; //AppConfig.UserName; Password = "MyPassword"; //AppConfig...

(BG-CH-02) Bhagavad Gita Chapter 2

2744 12/8/2013 7:59:37 PM

Chapter 2 (अध्याय २), Sankhya Yoga (सांख्ययोग) :Mr. Krishnarjuna Wartala (Chapter 2 Slok 1 to 10) श्री कृष्णार्जुन वार्ताला (अध्याय 2 शलोक 1 से 10)Description of Gnana Yoga (Chapter 2 Slok 11 to 30) ज्ञानयोग का वर्णन (अध्याय 2 शलोक 11 से 30)The religious wars Kshatriya (Chapter 2 Slok 31 and 38) क्षत्रिय का धर्म युद्ध (अध्याय 2 शलोक 31 से 38)Selfless Karma Yoga (Chapter 2 Slok 39 to 53) निष्काम कर्मयोग (अध्याय 2 शलोक 39 से 53)Signs wise glory (Chapter 2 Slok 54 to 72) प्रज्ञ लक्षण महिमा (अध्याय 2 शलोक 54 से 72)...

ASP.NET MVC - Show static .html files directly without controller

2728 6/20/2015 2:09:29 AM

MVC framework provide support to static files e.g. images, css, js. Its just .html files are not configured by default. In order us to include static files in application we need to tell MVC application to allow Html file. routes.IgnoreRoute("StaticHtmls/{*path}"); After you include this in Route configuration files. You should be able to access all .html files in 'StaticHtmls' folder directly. e.g. http://YourSite/StaticHtmls/YourHtmlFile.html http://YourSite/StaticHtmls/YourHtmlFile.cshtml . ...

(BG-CH-01-V-24) Bhagavad Gita Chapter 1 Verse 24

2707 5/5/2014 1:44:50 PM

(BG.1.24) Shrimad Bhagavad Gita- Chapter-1 Verse (Shloka)-24Verse (Shloka) - sanjaya uvaca :evam ukto hrsikeso gudakesena bharata senayor ubhayor madhye sthapayitva rathottamam #1-24 Synonyms sanjayah--Sanjaya; uvaca--said; evam--thus; uktah--addressed; hrsikesah--Lord Krsna; gudakesena--by Arjuna; bharata--O descendant of Bharata; senayoh--of armies; ubhayoh--of both; madhye--in the midst of; sthapayitva--by placing; ratha-uttamam--the finest chariot. Meaning- Sanjaya said: O descendant of Bharata, having thus been addressed by Arjuna, Lord Krishna drew up the fine chariot in the midst of the...

SQL Server - Normalization In Database - 1NF, 2NF, 3NF and BCNF

2647 4/25/2015 11:20:02 PM

Normalization the process of organizing data in a database that includes creating tables and establishing relationships between the tables. The process is used to help eliminate redundant data. Five normalization forms (NF's): 1NF: Eliminate Repeating Groups 2NF: Eliminate Redundant Data 3NF: Eliminate Columns Not Dependent on Key 4NF: Isolate Independent Multiple Relationships 5NF: Isolate Semantically Related Multiple Relationships In this article, we are going to cover first three normaizations,which are most frequently used. ...

Ganpati Aarti Lyrics - With Transliteration

2558 9/23/2014 3:15:43 PM

Shree Ganesh Aarti (श्री गणपतीची आरती): Transliteration Sukhakartā dukhahartā vārtā vighnācī |nuravī pūrvī prēma kr̥pā jayācī |sarvāṅgī sundara uṭī śēndurācī |kaṇṭhī jharakē māla muktāphaḷācī || 1 || jaya dēva jaya dēva jaya maṅgalamūrtī |darśanamātrē manakāmanā puratī ||ratnakhacita pharā tūja gaurīkumarā |candanācī uṭī kuṅkumakēśarā |hirē jaḍita mukuṭa śōbhatō barā |ruṇajhuṇatī nupurē caraṇī ghāgariyā || 2 || lambōdara pitāmbara phanī varavandanā |saraḷa sōṇḍa vakratuṇḍa trinayanā |dāsa rāmācā vāṭa pāhē sadanā |saṅkaṭī pāvāvē nirvāṇī rakṣāvē suravandanā |jaya dēva jaya dēva jaya maṅgalamūrtī...

Difference Between Vidya and Shiksha

2549 1/17/2014 9:23:55 AM

Guru is one who gives vidya. Shikshak gives shiksha. Vidya teaches morality, values, difference between good and bad etc. Shiksha teaches subjects meaning Math, Sciences, Languages, and Social Sciences etc. The Guru also taught how to lead a life with dharma (virtues). ...

(BG-CH-18-V-41-48) Bhagavad Gita Chapter 18 Verse 41-48

2527 1/18/2015 5:28:21 PM

(BG-CH-18-V-41) Bhagavad Gita Chapter 18 Verse 41; (BG-CH-18-V-42) Bhagavad Gita Chapter 18 Verse 42; (BG-CH-18-V-43) Bhagavad Gita Chapter 18 Verse 43; (BG-CH-18-V-44) Bhagavad Gita Chapter 18 Verse 44; (BG-CH-18-V-45) Bhagavad Gita Chapter 18 Verse 45; ...

EWS - Processing Email Attachments Using Exchange Web Service

2526 12/19/2013 4:45:12 PM

In previous article (How to iterate through the attachments using Exchange web service in ASP.NET?) we saw how to iterate through attachments contained in unread email and filtering based on type. I applied filter to process only attachment of xml type. Here will see how we can process xml file in outlook email. /// <summary> /// Here is code to process attachement /// </summary> /// <param name="esb"></param> /// <param name="itemID"></param> private static void ProcessAttachmentByAttachmentItemID(ExchangeServiceBinding esb, string itemI...

Purushartha : Dharma, Artha, Kama and Moksha

2515 1/10/2015 2:55:09 PM

पुरुषार्थ = पुरुष+अर्थ = अर्थात मानव को 'क्या' प्राप्त करने का प्रयत्न करना चाहिये। प्रायः मनुष्य के लिये वेदों में चार पुरुषार्थों का नाम लिया गया है - धर्म, अर्थ, काम और मोक्ष। योग वसिष्ठ के अनुसार सद्जनो और शास्त्र के उपदेश अनुसार चित्त का विचरण ही पुरुषार्थ कहलाता हे। भारतीय परम्परा में जीवन का ध्येय पुरुषार्थ को माना गया है। धर्म का ज्ञान होना जरूरी है तभी कार्य में कुशलता आती है कार्य कुशलता से ही व्यक्ति जीवन में अर्थ अर्जित कर पाता है। काम और अर्थ से इस संसार को भोगते हुए मोक्ष की कामना करनी चाहिए। पुरुषार्थ चार है- (1) धर्म (Dharma- Religion or Righteousness), (2) अर्थ (Artha -Wealth)...

ASP.NET - FIX-A Potentially Dangerous Request Was Detected From The Client

2474 12/15/2013 12:27:23 PM

ASP.NET MVC-A potentially dangerous Request was detected from the client Exception Details: System.Web.HttpRequestValidationException: [HttpRequestValidationException (0x80004005) A potentially dangerous Request.Form value was detected from the client (Model_Field="<!-- Begin ...") Source Error : An unhanded exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Description: ASP.NETMVC has detected data in the request that is potentially dangero...

(BG-CH-01-V-11) Bhagavad Gita Chapter 1 Verse 11

2345 2/2/2014 8:50:07 AM

(BG.1.11) Shrimad Bhagavad Gita- Chapter-1 Verse (Shloka)-11Verse (Shloka) - ayanesu ca sarvesu yatha-bhagam avasthitah bhismam evabhiraksantu bhavantah sarva eva hi #1-11# Synonyms ayanesu--in the strategic points; ca--also; sarvesu--everywhere; yatha-bhagam--as they are differently arranged; avasthitah--situated; bhismam--unto Grandfather Bhisma; eva--certainly; abhiraksantu--support may be given; bhavantah--all of you; sarve--respectively; eva--certainly; hi--and exactly. Meaning- So, while keeping to your respective stations in the several divisions, all of you should doubtlessly protect B...