hi brothers ,
i work on a ASP.NET MVC Project,
please i try to get a cookie who created already using server side C# , and in a pure HTML page not .CSHTML i talk now about .HTML page , in this page i want to using javascript to read the value of the cookie that i created using C# .
i wish if anyone can help me and thanks so much in advance.

Re: how can i get the cookie who created by server side (C#) using javascript 80 80

You woud access it like any other cookie for the site, using the Request.Cookies collection of the Controller class, Request.Cookies["cookie"] returns an object for the cookie named "cookie". Use the ToString() method to retrieve the text value of the cookie.

Check out the docs here, https://docs.microsoft.com/en-us/dotnet/api/system.web.httprequest.cookies?view=netframework-4.8 for more details.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.