ASP.NET

ASP.NET authentication cookie disappears, only in IE, only from specific locations

亡梦爱人 提交于 2021-02-19 01:40:50
问题 Internet explorer is not keeping my authentication cookie after one page redirect. Here is the situation: I have an ASP.NET 2.0 web application running on a shared iis7 hosting. The application uses forms authentication to handle login and user identity and writing a cookie (.ASPXFORMSAUTH) on the client machine for that purpose. in IE (checked with version 8, 9), from some locations , the authentication cookie is not being kept after the first page. The observed behavior is: User name and

asp .net core app doesn't set response cookie in IE and EDGE but works well in firefox and chrome

蹲街弑〆低调 提交于 2021-02-19 01:37:10
问题 I have a login controller with a post action which redirects to home page after successful login. I am using following code for redirection, which works well in Chrome and Firefox. but doesn't redirect in IE and EDGE, and response cookie not set private ActionResult RedirectToLocal(string returnUrl) { if (Url.IsLocalUrl(returnUrl)) { return Redirect(returnUrl); } else { return RedirectToRoute("default", new { controller = "", action = "" }); } } My Login action public IActionResult Login

UserManager.FindAsync(username, password) not available in ASP.NET 5 / Identity 3

a 夏天 提交于 2021-02-19 01:16:53
问题 I'm trying to upgrade a project to ASP.NET 5 / MVC 6. The UserManager that came with AspNet.Identity used to have a FindAsync method where I could pass in a username and password. It doesn't seem to be there anymore. I don't think I need the SigninManager or Authentication as I'm using JWT Bearer Authentication. I just need to check the username and password are valid before I grant an access token, 回答1: Simply use UserManager.FindByNameAsync() to find the user object then check its password:

UserManager.FindAsync(username, password) not available in ASP.NET 5 / Identity 3

爷,独闯天下 提交于 2021-02-19 01:16:27
问题 I'm trying to upgrade a project to ASP.NET 5 / MVC 6. The UserManager that came with AspNet.Identity used to have a FindAsync method where I could pass in a username and password. It doesn't seem to be there anymore. I don't think I need the SigninManager or Authentication as I'm using JWT Bearer Authentication. I just need to check the username and password are valid before I grant an access token, 回答1: Simply use UserManager.FindByNameAsync() to find the user object then check its password:

UserManager.FindAsync(username, password) not available in ASP.NET 5 / Identity 3

匆匆过客 提交于 2021-02-19 01:16:23
问题 I'm trying to upgrade a project to ASP.NET 5 / MVC 6. The UserManager that came with AspNet.Identity used to have a FindAsync method where I could pass in a username and password. It doesn't seem to be there anymore. I don't think I need the SigninManager or Authentication as I'm using JWT Bearer Authentication. I just need to check the username and password are valid before I grant an access token, 回答1: Simply use UserManager.FindByNameAsync() to find the user object then check its password:

Change the Access Modifiers of ASP.NET controls

巧了我就是萌 提交于 2021-02-18 23:50:35
问题 If I put a control in a .aspx file like this; <asp:TextBox ID="protectedTextBox" runat="server">Some info</asp:TextBox> I get a declared control in the page's .aspx.designer.cs file; protected global::System.Web.UI.WebControls.TextBox protectedTextBox; But I'd like to change the access modifier of the control to public . Is there any attribute or similar that I can set to change the access modifier? Here's why I want to do it. I am trying to have cross-page postbacks work nice and neatly. I

Change the Access Modifiers of ASP.NET controls

放肆的年华 提交于 2021-02-18 23:47:44
问题 If I put a control in a .aspx file like this; <asp:TextBox ID="protectedTextBox" runat="server">Some info</asp:TextBox> I get a declared control in the page's .aspx.designer.cs file; protected global::System.Web.UI.WebControls.TextBox protectedTextBox; But I'd like to change the access modifier of the control to public . Is there any attribute or similar that I can set to change the access modifier? Here's why I want to do it. I am trying to have cross-page postbacks work nice and neatly. I

Why do we use Response.ClearHeaders()?

安稳与你 提交于 2021-02-18 23:00:13
问题 I copied a code piece to send files to browser. I don't know why we use the lines written below cause removing these does not make any difference in my development environment. Response.Clear(); Response.ClearHeaders(); Response.Buffer = false; Can anyone provide a simple break down of the intended purpose & appropriateness of these. Thanks 回答1: Response.Clear(); If you have written anything out already to the buffer, you'll need to clear that so extraneous content doesn't get included.

Map to wwwroot in ASP.Net 4?

青春壹個敷衍的年華 提交于 2021-02-18 22:22:51
问题 Is there an easy way to add a subdirectory in ASP.Net v4 Web API that would contain all of my client content? I have read a lot of articles today on virtual paths and routing, but nothing that quite describes this case. For example, I want to store my images under wwwroot so when the the app receives this request: http://myapp/img/logo.png It fetches wwwroot\img\logo.png to handle the request. Obviously, I don't want to have to map out every file or folder individually. There will be a Web

TagLib.Sharp on a website (vb.net) (Type 'TagLib.File' is not defined)

无人久伴 提交于 2021-02-18 19:35:56
问题 (Coding for VB.NET) I am working with the TagLib-Sharp. I really enjoy how it works. Very simple and straight forward. Well, within VS, it is, anyway. I took the files and placed them on my web server, of which included the BIN folder that VS created with the DLL files when I referenced the TagLib-Sharp.dll file. When I run the site through my browser, I get the following error. Type 'TagLib.File' is not defined I was told that I had to create a Namespace for it, so I did that. I also