Saturday 5 September 2015

How to pass HTML5 70-483 Exam ?

It's pretty simple to prepare for 70-483 HTML5 exam,

Recently I became MCSD, passed 3 exam which is coming under MCSD path.

I would like to suggest go with,
1)Microsoft.Actualtests.70-480.v2013-12-31.by.MARY.169q.vce
2) Microsoft.Braindumps.70-480.v2014-04-14.by.TAMARA.31q.vce
(Above both vce downloadable from examcollection.com)


You may find PDF Latest-Microsoft-EnsurePass-70-480-Dumps-PDF-03_53.pdf
any where in the google, please review before go to exam.

Above dumps only give latest question, but real knowledge purpose kindly read book thoroughly. it may give confidence.


Let me know incase if you face difficulty.


Data Reader object to List type model Convert

How we can convert Data Reader object to List type model?
Most of developer are struggling while connecting with the DB, how to iterate those table data!
Developer may be go with DataTable fill using adapter concept, or it may be generic list concept.


I'm giving here pretty simple example for Mapping list.
 public static class Utility
    {
        public static List<T> DataReaderMappingToList<T>(IDataReader dr)
        {
            List<T> list = new List<T>();
            T obj = default(T);
            while (dr.Read())
            {
                obj = Activator.CreateInstance<T>();
                foreach (PropertyInfo prop in obj.GetType().GetProperties())
                {
                    if (!object.Equals(dr[prop.Name], DBNull.Value))
                    {
                        prop.SetValue(obj, dr[prop.Name], null);
                    }
                }
                list.Add(obj);
            }
            return list;
        }
    }

How we can access it?
// We are just passing command and iterating those kind of list.

 using (IDataReader dataReader = cmd.ExecuteReader())
                    {
                        stateDropdownAttribute = Utility.DataReaderMappingToList<StateDropdownAttribute>(dataReader);
                    }  

It's  pretty simple in this way to iterate it.

Thanks,
Gauttam

Friday 21 August 2015

runAllManagedModulesForAllRequests="true" when getting your MVC routing to work Don't use

It seems to be common advice to make your modules section of your web.config say <modules runAllManagedModulesForAllRequests="true">. In fact this is quite a drastic thing to do to solve the routing problem and has global effects that could CAUSE ERRORS.

You need a module that goes by the name of UrlRoutingModule-4.0 to be running through IIS. Now, since your MVC URLs are likely to end without .aspx these will not be picked up by IIS and run through the intergrated pipeline and therefore you will end up with 404 not found errors. I struggled with this when I was getting started until I found the <modules runAllManagedModulesForAllRequests="true"> workaround.

This highly recommended fix can cause other problems. These problems come in the form of making all your registered HTTP modules run on every request, not just managed requests (e.g. .aspx). This means modules will run on ever .jpg .gif .css .html .pdf etc.

This is:

  1. a waste of resources if this wasn't the intended use of your other modules
  2. a potential for errors from new unexpected behaviour.


Better solution

Fine, so the ranting about <modules runAllManagedModulesForAllRequests="true"> is over. What is a better solution?

In the modules section of your web.config, you can add the UrlRoutingModule-4.0 module in with a blank precondition meaning it will run on all requests. You will probably need to remove it first since it is most likely already registered at machine level. So make your web.config look like this:

?
1
2
3
4
5
<modules>
  <remove name="UrlRoutingModule-4.0" />
  <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
  <!-- any other modules you want to run in MVC e.g. FormsAuthentication, Roles etc. -->
</modules>

Note: the modules element does NOT contain the runAllManagedModulesForAllRequests="true" attribute because it is evil!

Wednesday 29 April 2015

How to pass Microsoft Developing Microsoft Azure and Web Services 70-487 exam

Hi All,
I've recently certified Microsoft Azure with WCF Certification 70-487,
I've notice that Microsoft has changed From 30 April 2014, the questions on this exam include content covering Visual Studio 2013 and updates to Microsoft Azure.

I've have few good tips for exam, which I'm sharing with this blogs,

  • If you are afraid 70-487 exam, then do not need to hasitate, It's pretty easy exam you need to make sure with latest dump.
  1.  Microsoft has divided this exam into two section.
  •  Case  Study
  • General Question
    In my case almost 26 Case study Question and 33 general Question

1) General Question
2) Case Study
3) LAURA Third party Dump -2013 September
4) Sure Pass Dump

Above Link will navigate you to download.

Few of the website which was usually referred by me.

Let me know in case if you needed any further help.

Thanks,
Gauttam
     
 

Monday 23 March 2015

List of Model Object Post to Controller in ASP.NET MVC

Introduction

Several times, we want to post list of model object from view to controller while HttpPost. Many developers try to get the list of data through an array. But I'll tell you without using array also, we can get those list of model objects in a simpler way. Let's go step by step. Create an ASP.NET MVC 4 application. First, create two model classes, for example, EmployeeModelClass.cs and DepartmentModelClass.cs inside Model folder in solution.

Model


public class EmployeeModelClass
    {
        public string Name { get; set; }

        public string Address { get; set; }

        public string Contact { get; set; }

        public IEnumerable<DepartmentModelClass> DeptList { get; set; }                 
    }

public class DepartmentModelClass
    {
        public string DepartmentCode { get; set; }
        public string DepartmentName { get; set; }
    }  

Controller
public class EmployeeController : Controller
    {
        //
        // GET: /Employee/

        public ActionResult Index()
        {
            return View(new EmployeeModelClass());
        }

        [HttpPost]
        public ActionResult Index(EmployeeModelClass emp, IEnumerable<DepartmentModelClass> dept)
        {
            emp.DeptList = dept;
            return View(emp);
        }
    }

View

Here, I want to get Employee details with list of department names which belong to that employee. The business logic is multiple departments should assign to a single employee.
I hope you understood what I am trying to do here. See the controller. In HttpPost Action, I am not using any array to get the Department list from view page while HttpPost. Simply, I am passing two parameters inHttpPost like below:
[HttpPost]
        public ActionResult Index(EmployeeModelClass emp, IEnumerable<DepartmentModelClass> dept)
        {
            emp.DeptList = dept;
            return View(emp);
        }
See those parameters, EmployeeModelClass emp and IEnumerable<DepartmentModelClass> dept. We can get the employee data from emp object and list of department data from dept object very easily here.
See the view section inside for loop I am putting DepartmentCode and Departmentname four times. This property name should be the same as the property in Model object.
To see the result in output, append the following lines in view page:
@{
                    if (Model.Name != null)
                    {
                        <div>
                    
                            Employee Name : @Model.Name <br/>
                            Address : @Model.Address <br/>
                            Contact : @Model.Contact <br/>
                            
                            @{
                                if (Model.DeptList != null)
                                {
                                  <table>
                                        <tr>
                                            <th>Dept code</th>
                                            <th>Dept Name</th>
                                        </tr>
                                    
                                    @{
                                        foreach (var dept in Model.DeptList)
                                        {
                                            <tr>
                                                <td>@dept.DepartmentCode</td>
                                                <td>@dept.DepartmentName</td>
                                            </tr>
                                        }
                                    }
                                </table>
                            }
                            }

                        </div>
                    }
                }



Attached Code Link to Download Source