Показаны сообщения с ярлыком MVC. Показать все сообщения
Показаны сообщения с ярлыком MVC. Показать все сообщения

четверг, 26 ноября 2020 г.

MVC , Microsoft.VisualStudio.Web.PageInspector.Loader, Error

Error in MVC App

@wiero: Me. Happened after installing VS 2019 Preview side-by-side with VS 2017 Community. FWIW, solution was to remove line 

<add assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

 from C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config

OR

Add new Line to web.config

<system.web> <authentication mode="None" /> <compilation> <assemblies> <remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </assemblies> </compilation> <httpRuntime targetFramework="4.5" />

вторник, 22 декабря 2015 г.

MVC Video

MVC 6

MVC Resource

MVC5 Identity, Secure

пятница, 17 апреля 2015 г.

Uri

Uri Encode

http://www.dotnetperls.com/uri

http://stackoverflow.com/questions/575440/url-encoding-using-c-sharp

https://msdn.microsoft.com/ru-ru/library/System.Web.HttpServerUtility(v=vs.110).aspx

https://msdn.microsoft.com/ru-ru/library/system.web.httputility(v=vs.110).aspx


QueryString
UrlEncoding
using System;
using System.Collections.Generic;
using System.Text;
// Need to add a Reference to the System.Web assembly.
using System.Web;

namespace UriEncodingDEMO2
{
    class Program
    {
        static void Main(string[] args)
        {
            EncodeStrings();

            Console.WriteLine();
            Console.WriteLine("Press any key to continue...");
            Console.Read();
        }

        public static void EncodeStrings()
        {
            string stringToEncode = "ABCD" + "abcd"
            + "0123" + " !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" + "ĀāĒēĪīŌōŪū";

            // Need to set the console encoding to display non-ASCII characters correctly (eg the 
            //  Latin A-Extended characters such as ĀāĒē...).
            Console.OutputEncoding = Encoding.UTF8;

            // Will also need to set the console font (in the console Properties dialog) to a font 
            //  that displays the extended character set correctly.
            // The following fonts all display the extended characters correctly:
            //  Consolas
            //  DejaVu Sana Mono
            //  Lucida Console

            // Also, in the console Properties, set the Screen Buffer Size and the Window Size 
            //  Width properties to at least 140 characters, to display the full width of the 
            //  table that is generated.

            Dictionary<string, Func<string, string>> columnDetails =
                new Dictionary<string, Func<string, string>>();
            columnDetails.Add("Unencoded", (unencodedString => unencodedString));
            columnDetails.Add("UrlEncoded",
                (unencodedString => HttpUtility.UrlEncode(unencodedString)));
            columnDetails.Add("UrlEncodedUnicode",
                (unencodedString => HttpUtility.UrlEncodeUnicode(unencodedString)));
            columnDetails.Add("UrlPathEncoded",
                (unencodedString => HttpUtility.UrlPathEncode(unencodedString)));
            columnDetails.Add("EscapedDataString",
                (unencodedString => Uri.EscapeDataString(unencodedString)));
            columnDetails.Add("EscapedUriString",
                (unencodedString => Uri.EscapeUriString(unencodedString)));
            columnDetails.Add("HtmlEncoded",
                (unencodedString => HttpUtility.HtmlEncode(unencodedString)));
            columnDetails.Add("HtmlAttributeEncoded",
                (unencodedString => HttpUtility.HtmlAttributeEncode(unencodedString)));
            columnDetails.Add("HexEscaped",
                (unencodedString
                    =>
                    {
                        // Uri.HexEscape can only handle the first 255 characters so for the 
                        //  Latin A-Extended characters, such as A, it will throw an 
                        //  ArgumentOutOfRange exception.                       
                        try
                        {
                            return Uri.HexEscape(unencodedString.ToCharArray()[0]);
                        }
                        catch
                        {
                            return "[OoR]";
                        }
                    }));

            char[] charactersToEncode = stringToEncode.ToCharArray();
            string[] stringCharactersToEncode = Array.ConvertAll<char, string>(charactersToEncode,
                (character => character.ToString()));
            DisplayCharacterTable<string>(stringCharactersToEncode, columnDetails);
        }

        private static void DisplayCharacterTable<TUnencoded>(TUnencoded[] unencodedArray,
            Dictionary<string, Func<TUnencoded, string>> mappings)
        {
            foreach (string key in mappings.Keys)
            {
                Console.Write(key.Replace(" ", "[space]") + " ");
            }
            Console.WriteLine();

            foreach (TUnencoded unencodedObject in unencodedArray)
            {
                string stringCharToEncode = unencodedObject.ToString();
                foreach (string columnHeader in mappings.Keys)
                {
                    int columnWidth = columnHeader.Length + 1;
                    Func<TUnencoded, string> encoder = mappings[columnHeader];
                    string encodedString = encoder(unencodedObject);

                    // ASSUMPTION: Column header will always be wider than encoded string.
                    Console.Write(encodedString.Replace(" ", "[space]").PadRight(columnWidth));
                }
                Console.WriteLine();
            }
        }
    }
}

среда, 1 апреля 2015 г.

Layout in MVC

MBC Tutorial

MVC partial view update with Ajax

понедельник, 16 марта 2015 г.

Passing Net.Data to javascript/ Razor to javascript/ Current Url in javascript

https://blog.mariusschulz.com/2014/02/05/passing-net-server-side-data-to-javascript

http://stackoverflow.com/questions/18928014/how-to-send-this-razor-data-to-a-javascript-function

http://stackoverflow.com/questions/18311503/how-to-pass-a-razor-value-to-a-jquery-function-in-an-mvc-view


http://stackoverflow.com/questions/11903695/passing-a-razor-object-to-a-javascript-function


http://www.softfinity.com/blog/sending-and-recieving-data-between-asp-net-mvc-and-knockout-js/


http://gotoanswer.stanford.edu/?q=How+to+send+this+Razor+data+to+a+javascript+function%3F


http://www.mikesdotnetting.com/article/220/posting-data-with-jquery-ajax-in-asp-net-razor-web-pages


http://www.dematte.org/2014/01/08/MixingAngularJSAndASPNETMVC.aspx

Current Url in javascript

var pathname = window.location.pathname; // Returns path onlyvar url = window.location.href; // Returns full URL

http://stackoverflow.com/questions/406192/get-current-url-in-javascript

Refresh

http://stackoverflow.com/questions/2099201/javascript-hard-refresh-of-current-page

Polling from mvc view page