My problem is that the i donot get the latest tracks records in map. But in terminals it shows that the vehicle is active.But in my tracks its not updated.

Please help me

I need to submit a list of users. I have a MVC controller

public JsonResult Handler(List<User> users) {

where User is

public class User {
    public string name { get; set; }
    public string email { get; set; }

in JavaScript I send the array by jquery

    var users = {};
    for (var i = 0; i < 3; i++) {
        users [i] = {
            name: "User " + i, 
            email: "user" + i + ""

        type: "POST",
        data: {
                users: users
        url: "",
        success: callback

I get the list with 3 items, but parameters name and email are NULL.

Where am I wrong?

I was trying to display a Map.

But here I took the values for Latitude and Longitude getting from AngularJs,

How to assign these values to variable. Can any one suggest me the solution Please.

Here is my Code.

    <div id="map">
            var lat = {{proplist.propagentslattitude}};
            var long = {{proplist.propagentslongitude}};
        <script type="text/javascript" src=""></script>
        <div style="overflow:hidden;height:300px;width:920px;">
            <div id="gmap_canvas" style="height:300px;width:920px;"></div>
            <a class="google-map-code" href="" id="get-map-data">google maps</a>
            <style>#gmap_canvas img{max-width:none!important;background:none!important}</style>
            <a class="google-map-data" href="" id="get-map-data">sparmichl</a>
        <script type="text/javascript"> function init_map() { var myOptions = { zoom: 16, center: new google.maps.LatLng(lat, long), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("gmap_canvas"), myOptions); marker = new google.maps.Marker({ map: map, position: new google.maps.LatLng(lat, long) }); infowindow = new google.maps.InfoWindow; google.maps.event.addListener(marker, "click", function () {, marker); });, marker); } google.maps.event.addDomListener(window, 'load', init_map);</script>

Here I have assigned the both latitude and longitude values.

How to assign proper way.

    var lat = {{proplist.propagentslattitude}};
    var long = {{proplist.propagentslongitude}};

I have done some work on ASP.NET MVC 3 but I'm no expert.

So, based on the pattern definition, the view has no direct awareness of the model and does not communicate with the model directly; only controller is directly dealing with model.

However, in ASP.NET MVC 3, I can access the model data directly from the view using Razor engine. Isn't that breaking the pattern design or am I missing something?

enter image description here

I am using TinyMCE 4.0 and everything works fine except binding with reference to this question I asked earlier and the answer .

The Problem:

I am able to bind the value into newProductText.ProductText but only when I format the the which is entered in the HTML WYSIWYG text editor space.

For example if I enter 'sample' as text and select it and change the size or font only then the $scope.newProductText.ProductText gets updated.

Setting up TinyMCE:

$scope.tinymceOptions = {
        selector: "textarea",
        theme: "modern",
        plugins: ["textcolor code link"],
        statusbar: false,
        browser_spellcheck: true,
        resize: false,
        menubar: false,
        toolbar1: "fontselect | fontsizeselect | bold italic underline | bullist numlist | alignleft aligncenter alignright | forecolor backcolor | link unlink | code",

Setting up Scope variable:

var NewCustomerProductText = {
    SalesPartNo: $scope.initial,
    LanguageCode: $scope.initial,
    ProductText: $scope.initial,
$scope.newProductText = NewCustomerProductText;


 @Html.Label("Language", new { @for = "language" })
 <select id="language" ng-model="newProductText.LanguageCode" ng-options="language.LanguageName for language in languages"><option value="">-- Choose Language --</option></select>
 @Html.Label("Sales Part No:", new { @for = "salesPartNo" })
 @Html.TextBox("salesPartNo", null, new { placeholder = "Click to select sales part no", @readonly = "readonly", ng_click = "OpenProducts()", ng_model = "newProductText.SalesPartNo" })
 @Html.TextArea("tinymce2", new { data_ui_tinymce = "tinymceOptions", ng_model = "newProductText.ProductText" })
 <button ng-click="addProductText()" /> Add </button>

I have a question. I have Index view and it has a button. I want to show loading panel when the page refresh and the button click but I couldn't do. To do this in layout, I must add the event or something like that to show loading panel when click the button. But How ? Here is my code.

<!DOCTYPE html>




<script type="text/javascript">
function OnLoadingPanelInit(s, e) 
    e.processOnServer = true;
function OnLabelInit(s, e) {

    //Hide After Timeout
    setTimeout(function () {
    }, 1000);


@*Loading Panel*@
@Html.DevExpress().LoadingPanel(settings => {
settings.Name = "lp";
settings.Modal = true;
settings.ClientSideEvents.Init = "OnLoadingPanelInit";
@*Loading Panel*@

@*Last DevExpress Object*@
@*Last DevExpress Object*@

@Html.DevExpress().Label(settings => {
settings.Name = "lbl";
settings.Properties.ClientSideEvents.Init = "OnLabelInit";


@model Project.Models.Kullanici
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";


@using (Html.BeginForm("Index", "Home", FormMethod.Post))
    @Html.DevExpress().LabelFor(a=> a.TcKimlik, settings =>
        settings.Width = 100;

    @Html.DevExpress().TextBoxFor(a => a.TcKimlik, settings =>
        settings.Width = 200;

    @Html.DevExpress().LabelFor(a => a.Sifre, settings =>
        settings.Width = 100;

    @Html.DevExpress().TextBoxFor(a => a.Sifre, settings =>
        settings.Width = 200;

    @Html.DevExpress().CheckBox(settings =>
        settings.Name = "remember";
        settings.Checked = false;
        settings.Text = "Remember me?";


    @Html.DevExpress().Button(settings =>
        settings.Name = "login";
        settings.Text = "Login";
        settings.UseSubmitBehavior = true;
        settings.RouteValues = new { Action = "Index", Controller = "Home" };



using DocumentFormat.OpenXml.Wordprocessing;
using DocumentFormat.OpenXml;

namespace GeneratedCode
    public class GeneratedClass
        // Creates an Document instance and adds its children.
        public Document GenerateDocument()
            Document document1 = new Document(){ MCAttributes = new MarkupCompatibilityAttributes(){ Ignorable = "w14 w15 wp14" }  };
            document1.AddNamespaceDeclaration("wpc", "");
            document1.AddNamespaceDeclaration("mc", "");
            document1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
            document1.AddNamespaceDeclaration("r", "");
            document1.AddNamespaceDeclaration("m", "");
            document1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
            document1.AddNamespaceDeclaration("wp14", "");
            document1.AddNamespaceDeclaration("wp", "");
            document1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
            document1.AddNamespaceDeclaration("w", "");
            document1.AddNamespaceDeclaration("w14", "");
            document1.AddNamespaceDeclaration("w15", "");
            document1.AddNamespaceDeclaration("wpg", "");
            document1.AddNamespaceDeclaration("wpi", "");
            document1.AddNamespaceDeclaration("wne", "");
            document1.AddNamespaceDeclaration("wps", "");

            Body body1 = new Body();

            Paragraph paragraph1 = new Paragraph(){ RsidParagraphMarkRevision = "00100E91", RsidParagraphAddition = "009D5F75", RsidRunAdditionDefault = "00100E91" };

            ParagraphProperties paragraphProperties1 = new ParagraphProperties();

            ParagraphMarkRunProperties paragraphMarkRunProperties1 = new ParagraphMarkRunProperties();
            Languages languages1 = new Languages(){ Val = "en-US" };



            Run run1 = new Run();

            RunProperties runProperties1 = new RunProperties();
            Languages languages2 = new Languages(){ Val = "en-US" };

            Text text1 = new Text();
            text1.Text = "Hello";

            BookmarkStart bookmarkStart1 = new BookmarkStart(){ Name = "_GoBack", Id = "0" };
            BookmarkEnd bookmarkEnd1 = new BookmarkEnd(){ Id = "0" };


            SectionProperties sectionProperties1 = new SectionProperties(){ RsidRPr = "00100E91", RsidR = "009D5F75" };
            PageSize pageSize1 = new PageSize(){ Width = (UInt32Value)11906U, Height = (UInt32Value)16838U };
            PageMargin pageMargin1 = new PageMargin(){ Top = 1134, Right = (UInt32Value)850U, Bottom = 1134, Left = (UInt32Value)1701U, Header = (UInt32Value)708U, Footer = (UInt32Value)708U, Gutter = (UInt32Value)0U };
            Columns columns1 = new Columns(){ Space = "708" };
            DocGrid docGrid1 = new DocGrid(){ LinePitch = 360 };



            return document1;


I want to get the document created on this code (code from Open XML SDK).

how by pressing the button to get ready document (get hello.docx)?

Created project: mvc 4 add: 1) Controller 2) View-> code:

    @using (Html.BeginForm())
        <input type="submit" value="Get docx file" />

I am working on Bundling js files using .NET 4.5 bundling System.Web.Optimization; on WebForms. I have managed to add files to BundleTable successfully, enter image description here

however they don't seem to appear on web page itself. I am able to see bundle specified in Sources Tab on Google Chrome but it is empty, and scripts are failing to load.

enter image description here

I must be missing something here, how do I inspect that bundles have loaded correctly on the browser, and check the contents.

Not that I think it matters, but to prevent avalanche of downvotes.


protected void Application_Start(object sender, EventArgs e)


namespace OnTheMoveOffline.Framework.App_Start
    public class BundleConfig
        public static void RegisterBundles(BundleCollection bundles)
            bundles.Add(new ScriptBundle("~/OnTheMoveWebFiles/bundles/development").Include("~/OnTheMoveWebFiles/js/*.js"));
            var resolver = new BundleResolver(bundles);
            List<string> cont = resolver.GetBundleContents("~/OnTheMoveWebFiles/bundles/development").ToList();


 <%: System.Web.Optimization.Scripts.Render("~/bundles/development") %>

I'm a php developer and i want to learn using MVC4 in web developing , i started downloading Pro ASP.NET MVC4 Framework and professional MVC4 and i found a series of tutorials on the internet.

I tried to look at it but I found that it need a lot of effort.

but i have a question , if I must firstly learn normal C# and without MVC , then start using model-view-controller , or I can start learning MVC4 directly ??

please recommend to me resources to a new comer to this field.

thanks in advance

I'm still learning and I want to ask you about how to reverse the grid view, I mean the default grid view would be like this

grid view with columns header

and this is the code for it:

        <asp:GridView ID="GridView1" runat="server" EnableModelValidation="True" 
        AutoGenerateColumns="false" Width="256px">

            <asp:TemplateField HeaderText="1"> <ItemTemplate>
                            <asp:Label ID="test1" runat="server" Text="test1"></asp:Label>

            <asp:TemplateField HeaderText="2"> <ItemTemplate>
                            <asp:Label ID="test2" runat="server" Text="test2"></asp:Label>

            <asp:TemplateField HeaderText="3"> <ItemTemplate>
                            <asp:Label ID="test3" runat="server" Text="test3"></asp:Label>
                         </ItemTemplate></asp:TemplateField>  </Columns>
        <RowStyle HorizontalAlign="Left" VerticalAlign="Bottom" />

and i want it to be like this picture :

enter image description here

the test here will be data bound and the numbers should be header text, this is only for test, is there a way to reverse it?

thank you all for your valuable advises and efforts, I really appreciate it.

I wrote this code in Console Application but its not working

GeoCoordinate coord = new GeoCoordinate(21.0000, 78.0000);
CivicAddressResolver res = new CivicAddressResolver();
CivicAddress add= res.ResolveAddress(coord);

I am new on FB API. I don't know how I can show comments of my website's page on facebook's post (relevant to that page)

Please help me on showing my website's page comments (will be done by users with proper facebook auth) on specific post of facebook

I am using IHttpHeader to redirect 403 requests to a 404. This is running on a .Net 3.5 Web Forms and IIS 6 setup.

<add verb="*" path="products/" type="RequestCheck.NoAccessHandler, RequestCheck, Version=, Culture=neutral" />

The site is also running with a CMS system handled by another department, and all of their files are under a marketing folder, in which they also have a products folder.

Directory structure


Before I realized this marketing folder existed (we don't get to see it in development) the following code was working fine.

    public void ProcessRequest(HttpContext context)
        context.Response.StatusCode = (int)HttpStatusCode.NotFound;

We have a link in the navigation similar to this


Which of course now redirects to the NotFound.aspx page, since it is going to products/ If you navigate directly to the default.asp inside of it, you can get to the page.

The easy fix is to just update the navigation to use the following url


This isn't a fix for us, because they want me to handle it in code. So I changed my handler to the following.

    public void ProcessRequest(HttpContext context)
        var url = context.Request.Url.ToString().ToLower();
        if (url.Contains("/mtgmktg/")) // ignore any requests coming for the CMS folders
        else // everything else gets a 404
            context.Response.StatusCode = (int)HttpStatusCode.NotFound;

And this...

    public void ProcessRequest(HttpContext context)
        var url = context.Request.Url.ToString().ToLower();
        if (!url.Contains("/mtgmktg/")) // ignore any requests coming for the CMS folders
            // everything else gets a 404
            context.Response.StatusCode = (int)HttpStatusCode.NotFound;

but both of these just send me to a blank page, it doesn't render anything. Then I tried this...

Bad Code

    public void ProcessRequest(HttpContext context)
        var url = context.Request.Url.ToString().ToLower();
        if (url.Contains("/mtgmktg/")) // ignore any requests coming for the CMS folders
            context.Response.Redirect(url); // This causes an infinite loop
        else // everything else gets a 404
            context.Response.StatusCode = (int)HttpStatusCode.NotFound;

Now it just goes to a "This page can't be displayed"

I have also tried removing the marketing folder through the config, but that just gets ignored. I tried putting this before and after my add above. neither one does anything.

<remove verb="*" path="marketing/" />
<remove verb="*" path="marketing/products/" />

Does anyone have any other ideas? Remember, I cannot change the link in the navigation.

Update 1

The blank page is because I didn't pay attention to what I did... The last code sample causes an infinite loop, crashing the page. So I need to rollback to one of the previous samples that are causing the blank page.

We are running a very large web application in MVC .NET 4.0. Recently we had an audit done and the performance team says that there were a lot of null reference exceptions.

So I started investigating it from the dumps and event viewer. My understanding was as follows:

We are using Asyn Tasks in our controllers. We rely on HttpContext.Current.Items hashtable to store a lot of Application level values.

Task<Articles>.Factory.StartNew(() =>
            System.Web.HttpContext.Current = ControllerContext.HttpContext.ApplicationInstance.Context;
            var service = new ArticlesService(page);
            return service.GetArticles();
        }).ContinueWith(t => SetResult(t, "articles"));

So we are copying the context object onto the new thread that is spawned from Task factory. This context.Items is used again in the thread wherever necessary. Say for ex:

public class SomeClass
    internal static int StreamID
            if (HttpContext.Current != null)
                return (int)HttpContext.Current.Items["StreamID"];
                return DEFAULT_STREAM_ID;

This runs fine as long as number of parallel requests are optimal. My questions are as follows:

1. When the load is more and there are too many parallel requests, I notice that HttpContext.Current.Items is empty. I am not able to figure out a reason for this and this causes all the null reference exceptions.

2. How do we make sure it is not null ? Any workaround if present ?

NOTE: I read through in StackOverflow and people have questions like HttpContext.Current is null - but in my case it is not null and its empty. I was reading one more article where the author says that sometimes request object is terminated and it may cause problems since dispose is already called on objects. I am doing a copy of Context object - its just a shallow copy and not a deep copy.

I seem to be doing a lot of Exception swallowing with Child Actions.

    [OutputCache(Duration = 1200, VaryByParam = "key;param")]
    public ActionResult ChildPart(int key, string param)
            var model = DoRiskyExceptionProneThing(key, param)
            return View("_ChildPart", model);
        catch (Exception ex)
            // Log to elmah using a helper method
            ErrorLog.LogError(ex, "Child Action Error ");

            // return a pretty bit of HTML to avoid a whitescreen of death on the client
            return View("_ChildActionOnlyError");

I feel like I'm cutting and pasting heaps of code, and with each cut an paste we all know a kitten is being drowned in angels tears.

Is there a better way to manage exceptions in child actions that would allow the rest of the screen to render appropriately?

When I bind a date in ASP.NET MVC to a plain text I get "/Date(8233200000)/"

To interop with this from my custom control I need to convert a Javascript Date() object to that text string?

What is the format of the number in "/Date(8233200000)/"

I have researched this quite a bit and while I can find a number of articles on the general issue and the code, unfortunately none quite like what we have.

Environment: We have 2 web servers running Windows 2012 and IIS 8. All running .net 2-4.5

Web Server 1: This is our main server that runs our main websites and web applications

Web Server 2: This runs our client websites

Code: Both sets of code are uncompiled. Both the shared code and the client websites are .NET 4 sites.


On Web1 we have a set of website code that is shared amongst a number of client websites. On Web2 the client site is set up in IIS and a sub directory of the App_code is a virtual directory pointing to a folder in the shared code on web1. We also have another virtual folder that points to the Web1 code as well. We have over 100 websites running in this fashion for over a couple of months.

Recently a couple of our clients have contacted us to say that they are receiving an error when browsing to parts of their website that are served by these virtual directories. The file that it references in the error message is in a modules folder in the virtual directory. it is a .cs file.

It only seems to be one website at a time and if we make a change that forces IIS to 'recompile' the site (meaning that we make a slight change to the web.config, save it and then change it back and save again), the error disappears and the web site starts working correctly. When we check other sites that are in the exact same setup as the one failing, we do not get any errors and they work correctly.

We are whits end as the issue seems to be completely random. This issue has only started occurring in the last week or at least this is the first we have seen of it.

We are at the point where we believe that it might be an IIS 8 issue and something that might be occurring when it is trying to recompile a client web site but due to the randomness and the 'easy fix' it is difficult to troubleshoot or even know where to go looking for the issue.

Any help would be much appreciated.



I'm using onbeforeunload to call a function when the user leaves the page. It works fine with IE and Firefox, but not with Safari and Google Chrome. Is there any solution or alternative option?


Hi struggling to work out sharepoint online provider hosted applications.

I am looking at hosting an intranet and internet site that will be able to do multiple business logic items such as dealing with payments to and from banks.

My colleague wants to develop this in sharepoint online where the scanned mail is stored but we have lots of processes that are run internally such as reports and finance on a MVC application.

How does sharepoint online applications work I'm struggling to find anything other than some tutorials on this subject.

I want to know how does a provider hosted application environment work. does the application get hosted in my local IIS/Azure and go out to sharepoint for the sharepoint stuff... or does it get hosted in sharepoint and it go back to the hosted applications.

Do I need to have have on premises sharepoint for this to work/a 3rd party such as rackspace or can I use IIS locally and only need the sharepoint online.

We communicate internally between services using WCF and Kerberos delegation. Will I still be able to use these for programs that create files that need to be sent off to printers or files that need to be imported manually into other systems such as finance files and reports.

Can I connect to my local SQL server or do I need to use azure?

If I set it up locally on IIS is it easy to switch later to it being served via Azure?

If I want to only use the sharepoint for the document management so the rest of the site is business logic am I missing out on features? other than document management I don't really understand why sharepoint online is better than say azure/IIS hosted website. can somebody explain what benefits I should be seeing so I can plan the business case and in the development planning stage.

sorry if I seem stupid I can't really find questions that adequately answer my question and I have never developed for sharepoint before.

I got a question blocked for being opinion based I hope that this isn't that way if so can somebody write an explanation of how I'm phrasing this wrong rather than just blocking me.


I have in model two fields date type (StartDate, Finish)

public DateTime StartDate { get; set; }
public DateTime FinishDate { get; set;}


@Html.TextBox("StartDate",null, new {@class="Date"})
@Html.TextBox("FinishDate", null, new { @class = "Date" })

<input type="submit" value="Generate"/>

also i have a js file with script

$(function () {
        dateFormat: "dd-mm-yy",
        showOn: "button"

when i clicked to sumbit button, controller get a model with Stardate=date from first datepicker, FinishDate=01/01/0001 ,why ? they have a same code

Folks, I have a web site (asp.NET & MVC) that is implemented using NHibernate 3.X. I have manually updated NHibernate.Search to bring it up to date with that version of NHibernate and a more recent version of but I am having constant performance issues with Lucene. I'd like to move towards a SOLR implementation but looking at the current codebase, the NHibernate plugin/library is deprecated and documentation is sparse.

I am using overridden NHibernate listeners to decide when to inject data into the lucene index (as my entities do not (a) put all their info into the index and (b) only enter/leave the index depending on their state (all for data security). My question is, does anyone have a good working example of how I'd implement the same kind of listener behavior on solrNET instead of lucene and

Thanks in advance...