Questions tagged [asp.net]

ASP.NET is a web application framework developed by Microsoft to allow programmers to build dynamic web sites and web applications.

29 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
775 views

OAuth 2.0 implicit flow implementation

I have been implementing the OAuth 2.0 implicit flow to secure the API I use in an Angular SAP. Please, could you review my code? I am sure there is a lot of stuff to improve in it. I have separated ...
4
votes
0answers
3k views

REST Web API Claims / Identity 'refresh' per request

I intend to expose a ASP.Net REST API for a project. I would like to use the default ASP.Net Identity system to provide the SQL backend. Users are managed in a different project. For my REST API ...
4
votes
0answers
745 views

Wrapping a GridView with custom controls

My aim is to create a server control which inherits from a GridView and outputs the basic output wrapped in external markup, including other controls. For example, the output will look something like:...
3
votes
0answers
33 views

Prettified GridView: is this JS code concise?

I been writing code for my company for years and there is never any constructive criticism for what I do. I am the only developer here and I would appreciate your opinion on this web page I made. It ...
3
votes
0answers
3k views

Hosted service for queuing and running tasks in parallel in ASP.NET Core

I am attempting to construct a background service for an IIS-hosted ASP.NET Core project that basically queues tasks and runs them, and I decided to go with the ...
3
votes
1answer
671 views

Validating the model outside of the controller in ASP.NET

I wasn't quite sure whether I should do it this way or create a validation service and inject it, but this works: Controller: ...
2
votes
0answers
751 views

Ninject binding for Dbcontext

I have an asp.net web API and I am using EF6 to connect to a third party rest API which sells online game codes. We made a deal with the company so clients have to call my rest API in order to get the ...
2
votes
0answers
133 views

How to optimize code to only pull separate table rows that are necessary

I have a Company Class, and separate normalized Address Class. I did this because the Address table will hold more than just Company Addresses, so I don't want "CompanyAddress", "EmployeeAddress", "...
2
votes
0answers
877 views

RESTful API combining three other APIs

I have created a RESTful API that uses three other APIs with Visual Studio 2017 in .NET Core. It is the first time I have ever programmed in .NET so I am sure the code could use a lot of improvements. ...
2
votes
0answers
47 views

Creating many aspx pages

I just want to ask if its okay to create many aspx pages. What i did was, i made a guitar store website that has 6 brands and each of them have their own webpage. The code is like this: The aspx.cs ...
2
votes
0answers
6k views

Securing Web API using token authentication and allowing external application to post or get data

Implementing OAuthAuthentication with OWIN and Identity to secure Web API and let external application like Chrome Extension to access our self hosted API for getting and posting data through our ...
2
votes
0answers
266 views

Dynamically created controls in Page_Load()

I have a question regarding creating controls in runtime in ASP.NET 4.0. I'm building a application and in admin.aspx page I have multiple controls (DropDownLists) which are dynamically created with ...
1
vote
0answers
20 views

Access to IIdentity outside of aspnet application

My ASP.NET application references a classlib that contains the business logic, where I need to have access to the IIdentity of the "current user". In ASP....
1
vote
0answers
21 views

Adding multiple child entities to a parent entity when creating the parent entity

I have a form on a page to add a Post (parent), before submitting the form, a user should be able to add 1 or more Sections (children) to the Post. The form: ...
1
vote
0answers
74 views

Bookmark controller with IMemoryCache

I'm just doing a small hobby project to solve a little problem I have and I'm using it as a learning exercise for ASP.Net MVC 5, .Net Core 2 and Bootstrap. I'm using a nuget package that handles ...
1
vote
0answers
91 views

Helper class for ASP.net to return data from SQL server

My goal is to create a class that I can call from my webpages like this. Similar to a data access layer? ...
1
vote
0answers
90 views

Populating a container with dynamic pairs of connected sortable lists

I am working on an application which is used to assign work to Operators based on the Category of the work. Each Operator has several Categories of work they are qualified to work on. They have a ...
1
vote
0answers
95 views

Add or modify bunch of data into database

I got my code works fine, but I am not really sure whether the approach that I took is a best practice or not. So, I decided to ask in this forum instead. So here is my situation: I got my model ...
1
vote
0answers
182 views

Retain previous values in Label

I am trying to write a simple program, from which the following can be achieved. Button1_Click, the number on the Button is increased by 1. The increased number is ...
1
vote
0answers
2k views

ValidationAttribute to validate a string against a JSON schema

This is my implementation of an .NET ValidationAttribute to validate a string against a JSON schema. The JSON schema file is stored within the application as an ...
1
vote
0answers
85 views

Bootstrapped tabbed table view

This produces tabbed tables. Here's how it looks: Each table displays comments of E-commerce products. The variable dtProductComments is ...
1
vote
0answers
1k views

Unit of work using session for NHibernate for WebApi and MVC

My goal was to use the NHibernate Session and to create a UnitOfWork class that I could use thoughout my project. My goals are: Calling Commit should commit everything including un-flushed state (...
1
vote
0answers
2k views

Create JSON object from self-nested LINQ query

I created this function to created nested JSON object using a Linq query. How can I optimize this and make it more readable? ...
1
vote
0answers
1k views

Azure Active Directory controller

I have a class called AzureActiveDirectoryController. This class has some methods: one to create users, one to get the app name, one to register schema extensions (...
1
vote
0answers
2k views

DataTable 'adapter' to HTML table generator

This is a project I am working on, which generates an HTML table out of a query result. (The result DataTable of an SQL command via SP) This section of the ...
0
votes
0answers
11 views

What's the best practice element to use when allowing selection in C# website?

To display text where each word is selectable. Which Html element is recommended to surround each word. I would like it to be visible to the user and underline when selected. Then, a submit button ...
0
votes
0answers
34 views

Initializing Google APIs serverside in MVC controller

I have this code in my MVC Controller: ...
0
votes
0answers
68 views

Vue.js in legacy web application

I'm working on modernizing legacy ASP.NET WebForms site which heavily relies on doing AJAX request for client-side rendering. Without the use of vue-cli compiling <...
-1
votes
1answer
4k views

ASP.NET MVC multi language website

What is the best way to make an ASP.NET MVC multi language website? The following code is what I use, but I need to make sure from your real-world experience that my code is the best way for ...