mvc
53 TopicsHow to increase session timeout
Hello Everyone, I am working on .NET framework 4.8 with a MVC web application. To login I am using MFA with microsoft's openid-configuration method. When I create FormsAuthenticationTicket and try to set session timeout as per my requirement but it doesn't work. See the sample code as below FormsAuthenticationTicket ticket1 = new FormsAuthenticationTicket( 1, // version adminEmail, // get username from the form DateTime.Now, // issue time is now DateTime.Now.AddDays(365), true, // cookie is not persistent "XXXXX" // role assignment is stored in userData ); But it is not working properly, it gets timeout within 15 mins41Views0likes0Commentsajax and connection to mvc .net
I need to access some c# code from javascript in MVC ,NET (not blazor). I have the below. This is very specific to .NET and MVC stack and not a generic ajax question like another one in stack overfow. I get no error message it just continues to the next statement after the ajax call. There could be 2 possible issues i think. My url: '/Home/CreatePostcodeFromCoordinates', is wrong. Or my C# assembly is not part of the assembly? or something similar. I am not that experienced with Web techs, I come from a DB background but can't be that difficult to get this link working right? Can't see anything else wrong. Also does the return value from C# need to be some special format or a string (as per now) is ok? this could be another reason? Thank you! console.log("just before /Home/CreatePostcodeFromCoordinates"); $.ajax({ type: "POST", url: '/Home/CreatePostcodeFromCoordinates', data: { param1: longitude, param2: latitude }, success: function (response) { console.log('success'); console.log(response); }, error: function (error) { console.error(error); } });Solved107Views0likes1CommentOpenstreet maps on azure websites
Hi, I am at the beginning of starting my own project. I come from a database tech background and have not kept up to date with all the Web frameworks. The project will run on azure and I will use visual studio. I need to be able to access opensteet maps for mapping and coordinates. So what I need to do is go to open street maps. Click somewhere on the map and a special tag should come up which I am populating in c# based on coordinates and country. I will to do the same on android, ios. Is xanarin my best option here? So there is MVC, the new .net core, web forms, some other framework. I didn't particularly like the .net core as there seems to be no designer with toolbox and components. Or do I use umbraco framework. I also saw a project called OSMsharp on github. What .net tech should I go for asI have to use openstreetmap and no Google maps, am i limited by this?. Thank you! Panos120Views0likes0CommentsBest way to migrate from .Net Framework to .Net 6
Hello everyone! I have many web projects with ORM and MVC with Net framework. I would like to migrate to .net 6 or higher. I tried Net Upgrade Assistant and also created a new project and did it step by step, but this option is very slow. Does anyone know what is the best way to do this?261Views0likes3CommentsDockerize App based .NET Framework 4.6.1
I have a Rest API based on .Net framework 4.6.1 I want to dockerize this API, but the problem is that I can't find a solution? All the solutions I found are almost all dedicated to other versions, for example, version 4.6.2, 4.7.0 etc. Can anyone recommend me the base image that I can use to build this application? I used mcr.microsoft.com/dotnet/framework/aspnet:4.8 but it is not suitable for my project.114Views0likes0CommentsAsp.Net Core MVC .Net 8.0
Olá, meu nome é Wellingon e gostaria de saber como eu faço para personalizar as minhas as views que são geradas automaticamente pelo scaffolding, a ideia é criar o meu modelo e oscaffolding gerar novas views com base no modelos que criei. Li várias artigos que falam em criar uma pasta na raiz do projeto com o nome CodeTemplates e colocar os modelos .cshtml lá dentro, mas não funcionou, oscaffolding continou ignorando as minhas views. Eu uso o Visual Studio 2022, podem me ajudar? Grato202Views0likes0CommentsLooking for recommendations for hosting ASP.NET web apps
I've been with an ASP.NET web hosting service for several years. However, the service provided has declined in the last couple of years. So, I started looking for a new, inexpensive, web hosting service. This is for my side business, which doesn't attract that much traffic. Yes, I'm sure that Azure would do, but like I said I'm trying to keep costs down. Naturally, I started searching. I've come across a couple of "Top 10 hosting services for 2023". I've spent about three weeks looking at different ones. I want to publish my ASP.NET Core both from Visual Studio and Azure DevOps Services, using the Azure DevOps FTP task if necessary. My website is currently written in .NET 6. This search experience has not been a pleasant experience. Some services I've spoken to said that because I am working with ASP.NET, then it can only run on Windows, and therefore I couldn't use their service, since they are a Linux only provider (mostly WordPress). I have told two of these web hosting services that ASP.NET Core can run on Linux. I even shared links from Microsoft that ASP.NET Core can run on Linux, Mac, and Windows. In both cases their response was disbelief and a refusal to discuss the topic further with me. Since it seems that many web hosting services have a mindset that refuse to accept the idea that anything from Microsoft can run on Linux, I decided to go back to researching web hosting companies that offer ASP.NET on Windows (both traditional .NET Framework varieties as well as .NET Core with .NET 5, 6, and 7). I settled on one, but they insist that I must allow them to re-register the domain I've owned for 10+ years. They will not allow me to upload my website to them until I've unlocked my website from the domain registrar I use. I've told them, at least three times, that I am satisfied with the domain registrar I have and only need a web hosting provider. They won't hear of it and refuse to go any further with me. So, once again I'm back to searching for a web hosting company for small businesses, that is inexpensive (OK, cheap), that I might be able to have multiple domains on. Therefore, I'd appreciate recommendations from this community, please.1.3KViews0likes8CommentsAsp.Net Core How to create PDF Product Catalog With a template with an image in the background
Hi, I am developing a web application with Asp.net. The application will select the products on the e-commerce website, create headings according to categories and subcategories, and create a pdf catalog with product information images properly underneath (I hope). But I haven't been very successful with PdfSharp right now, everything works with coordinates and it is very difficult to design something original. Two solutions came to my mind: 1- Upload a pdf template and edit it with PDFSharp or a similar plug-in. Here, perhaps we can place a fixed photo area and text area with a form and enter product information there. Here we can name the text and photo fields, such as texbox1 picture1. 2- Prepare a table on the PdfSharp side, use it just like a template and have the products listed. I haven't quite decided what to do right now. I added an area to upload font files and templates to the plugin I developed, and I also made the information that should be included in the catalog, such as picture, sku, title, selectable with a checkbox. I don't know how to continue. I would appreciate it if you could help me.1KViews0likes2CommentsAjax to Controller bind model
Guys, good afternoon, I'm working on an application in which it makes javascript ajax requests to the backend An error occurs when I send a structure this way: " const OFManutencaoViewModel = { Justification: Justification, RequesterJustification: idOFJustificationRequestor, EmailsJustifications: idListaOFJustificationEmails, OFBecalhoViewModel: oFCabecalhoViewModel } " Properly populated according to the payload (attached image) below: My model is structured like this: public class OFManutencaoViewModel { public OFBecalhoViewModel OFBecalhoViewModel { get; set; } public string Justification { get; set; } public string RequesterJustification { get; set;} public string EmailsJustifications { get; set; } } When making the call it hits the controller but with null values Method structure (image attached): I've already checked property by property and everything is correct. Could someone give me some help211Views0likes0CommentsThreading problems in SignalR Hub
Hello, I implemented a SignalR Hub to make a game server. The idea is that when a room is full (4 people in it) I run a new game. A game: 1. We notify everybody 2. The first player send one data. 3. We switch to next one 4. while the game isn't finished: Ask the current player two data. Switch to next player My problem is that with that simple system, once the client sent the data, the server do nothing, that's why I think there is a data race somewhere that I don't see. Here is myGithub repoin OkeyServer/ you have the server code, in OkeyScript/ you have all the functions needed for game logic. Thanks in advance for your help.282Views0likes0Comments