asp.net (classic)
77 TopicsASP.NET webforms - compilation/httpruntime configuration in asp.net web.config
Will having the following configuration in asp.net/webform web.config file work without security issues due to lack of support after April 2022 for .NET Framework v4.5.2, 4.6 and 4.6.1? ie - compilation is v4.8, httpruntime is v4.5. <compilation debug="true" targetFramework="4.8"> ... </compilation> <httpRuntime targetFramework="4.5"/>5.3KViews0likes1CommentPublic Preview for Azure Migrate ASP.NET Assessments & Business Case for Windows Containers
Today we're excited to announce the public preview of ASP.NET Assessments and the Business Case features for Windows Containers on Azure Kubernetes Services (AKS) and App Service via Azure Migrate. These new features add on top of the existing functionality of discovering and migrating .NET web apps. Azure Migrate aims to be a one-stop shop for all migrations to Azure, providing capabilities to discover, assess and right size your workloads and migrate them at-scale. With these new features, Azure Migrate provides the following for ASP.NET web apps: Cloud readiness for AKS, App Service A recommended configuration of Node SKUs and Node count (or App Service plan) The yearly cost savings by running these apps on Azure.3.7KViews1like0CommentsObject becomes null after calling HTTPClient.PostAsJsonAsync to access Web Api in web form
In my web form (ASP .Net 4.8, VB .Net), I have calling the following function from code-behind submit sales transaction via web api: Public Async Function SendSale(fs As SaleTxnReqModel) As Task(Of SaleTxnRespModel) Dim returnData As SaleTxnRespModel = New SaleTxnRespModel() Dim apiUrl = "Sales/SendSale" Dim resultRemark As String= String.Empty Try Using client = New HttpClient() client.BaseAddress = New Uri(AppComp.NormalizeBaseUrl(constWebApiUri)) client.DefaultRequestHeaders.Accept.Clear() client.DefaultRequestHeaders.Accept.Add(New MediaTypeWithQualityHeaderValue("application/json")) Dim jsonString As String = JsonConvert.SerializeObject(fs) Dim content = New StringContent(jsonString, Encoding.UTF8, "application/json") Dim response As HttpResponseMessage = Await client.PostAsJsonAsync(apiUrl, content) returnData = Await response.Content.ReadAsAsync(Of SaleTxnRespModel)() If Not response.IsSuccessStatusCode Then resultRemark = AppComp.SetWebServStatusText(response.StatusCode) End If End Using Catch ex As Exception resultRemark = AppComp.GetExceptionMessage(ex) Finally returnData.REMARK = resultRemark End Try Return returnData End Function At the receiving web api, the request object has become null. [Route("SendFuelSale")] [HttpPost] public IActionResult SendFuelSale(SaleTxnReqModel txn) { // Process sales transaction... } I have tried using SendAsync method and it worked: Dim jsonString As String = JsonConvert.SerializeObject(fs) Dim content = New StringContent(jsonString, Encoding.UTF8, "application/json") Dim request = New HttpRequestMessage(HttpMethod.Post, apiUrl) request.Content = content Dim response As HttpResponseMessage = Await client.SendAsync(request).ConfigureAwait(False) I just wonder what went wrong when usingPostAsJsonAsync method. Any idea? Please adivse. Thanks.2.9KViews0likes2CommentsMVC Controller Method Overloading
Hi Folks, The application is built using .NET Framework 4.5.2 with MVC pattern. The current situation requires validating the input parameter and redirecting to the respective method. public ActionResult GetSomeData() { // Default execution for given route } public ActionResult GetSomeData(int inputValue) { // Route detection with the input parameter and change the functional flow for INT data type } public ActionResult GetSomeData(string inputString) { // Route detection with the input parameter and change the functional flow for STRING data type } Is such redirection possible? Thank you for reading.2.2KViews0likes6CommentsProblems with Visual Studio 2022
I am trying to create a simple website, not a web application, in VS 2022. The closest thing I can find is a ASP.NET Core Empty, but I do not want that, I only want a simple website with HTML pages only, not .cs files. How do I do this in VS 2022? I remember being able to do this in VS 2019? web5g2.2KViews0likes2CommentsSimple forms-based web app authenticated against Azure AD - Need advice re framework / tools to use
We have a need for a simple forms-based application that fronts SQL Server data, but this one needs to be secure. And we also need to support named users from outside the firm. It seems like a .NET web application is what we're looking for, with Azure AD as our source of authentication. But as a novice .NET programmer, I find it confusing trying to sort through all the advice and tutorials and best practices out there, many of which are not dated. Much of the advice seems out of date or inappropriate with today's technology. We're planning to use C# and .NET 6 for this project and have Visual Studio Enterprise for development. We'd like to get off on the right foot and use current technology and techniques. For the application, we're looking for easy rapid development of a forms and event driven application, similar to what we're used to when using Access forms, buttons, controls for rapid development of utility programs. Is there a recommended framework, or tool, or project type to support this kind of coding? While I can do HTML and CSS and client-side Java if I have to, I'd prefer not to be involved in all the intricacies of the form presentation. Visual forms design is a definite plus. For security, we're looking to authenticate the user against Azure AD, with MFA. We've got experience setting up other people's applications to authenticate against Azure AD, but never had to write one ourselves. Is OWIN the current preferred method and, if so, is there a preferred library to use or tutorial to follow that is relevant to today's technology and .NET 6? For reference, in the past, we'd often make Access front ends for quick and easy tools, especially those that interacted with SQL server databases. The visual forms and easy event driven programming made it quite cost effective to develop and support these important but low-complexity projects. We'd build a few forms, each fronting a table or view, add a few buttons or other controls with a couple of key lines of code to implement our logic and rules, and be all set. The fact that users could, if they tried, bypass the code and see the linked tables was not a concern in these cases. Now it is. We'd love that kind of ease of use, with the addition of webhosting and AAD authentication. I've done a good deal of development over 25+ years in many languages and worked with client server tools, SQL, remote procedure calls, and REST APIs. I'm currently working mostly in Python and some VB for Microsoft programs, though I can get by in C-like languages when needed. Thanks in advance for any advice on what the current .NET Web equivalent of our old tools would be. I don't mind putting in the effort to learn but want to be heading in the right direction.1.7KViews0likes1CommentUnable to get text value from user prompt
I hope someone can help point me in the right direction. I'm a newbie and have inherited a legacy application and no other employees can help me with this one. I have an asp.net application that has a Copy button. When the copy button is pressed, a screen pops-up and users can enter a value to indicate what they want to copy to. However, the copy does not work. I can not seem to get the text that the user enters to be picked up in the code so the copy can work. Why am I unable to get the code to pick up the text that is entered by the user? I have attached the files and a screenshot showing the copy button feature. I'd appreciate any guidance/help on this. As mentioned, I'm a newbie when it comes to this. Thanks.1.7KViews0likes5Commentsprogid:dximagetransform.microsoft.gradient is not a valid value for the "filter" property
I am trying to implement bootstrap 4 in my code. I am using ASP.NET MVC This error occurs. What replacement should I put in the filter property? I tried adding overflow:auto in the property but I get the same error. This is how my login page looks after this error:1.6KViews0likes1CommentASP.NET Community Standup - Blazor App Testing with Playwright
Learn how to use Playwright to implement end-to-end testing for your Blazor application! Community Links: https://www.theurlist.com/blazor-standup-2023-03-14 Featuring: Jon Galloway (@jongalloway), Debbie O'Brien (@debs_obrien), Mackinnon Buck (@MackinnonBuck) #Blazor #Playwright #dotnet1.5KViews0likes0Comments