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

learn more… | top users | synonyms

-4
votes
0answers
13 views

How to turn on IncludeExceptionDetailInFaults in wcf? [on hold]

i had trouble about this service, i got error somethimes like that: The server was unable to process the request due to an internal error. For more information about the error, either turn on ...
3
votes
0answers
27 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 ...
3
votes
0answers
32 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 ...
5
votes
1answer
44 views

Filtering ASP.NET membership roles without the default attributes

I am building an application, and I needed an attribute similar to AuthorizeAttribute, supporting Roles but not using the ...
-1
votes
0answers
45 views

SQL generates a dynamic table as an input for a Kendo UI table

I'm just registered to codereview.stackexchange. Please provide some feedback on this code. I have a backend (ASP + SQL) and frontend Kendo UI. This SQL provides data to WebMethod. Decided to ...
4
votes
2answers
70 views

Factory for report handlers

Below is my try. ...
4
votes
1answer
86 views

C# Rate Limiter

A flexible, fast and lightweight rate limiter that allows rate limiting of any action on a website. Doesn't work across a scaled deployment by design, but could easily be modified to work in this way ...
2
votes
0answers
98 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 ...
0
votes
2answers
146 views

Assigning properties

I am leaving my first job because I always worked alone on projects from my day one, which was both useful but also taught me some bad practices some of which I managed to realize but many others are ...
1
vote
0answers
49 views

Instantiate repository classes dynamically

I'm curious about the best way to instantiate my repositories. Currently they're in the main controllers constructor method. I was thinking making separate controllers for inbounds, outbounds, ...
2
votes
3answers
357 views

Overloaded handlers for various configurations retrieved from a database

I have a switch statement that references different configurations based on data pulled from a database. Each iteration of configuration has variations in what needs to be enabled/modified. I've set ...
3
votes
1answer
96 views

An Edit action in ASP.NET MVC, with handling for missing id parameter

I have a standard Edit action in Asp.Net MVC 5 and I want to avoid throwing the unhandled exception when is made a get request without the id like ~/food/edit, so I did this. ...
0
votes
1answer
81 views

Data paging for a forum website in Asp.Net MVC

I've struggled with this for quite some time. Today I finally wrote the following code. The ViewModel contains an int property which later tells the view how many ...
1
vote
1answer
53 views

Get all the list of users depending on user role

I rewrote a ActionResult method that will output list of users depending if it is a SuperAdmin, ...
3
votes
1answer
87 views

Validating email confirmation and sending different emails to admins

I wrote a method that will confirm email with token send to user emails. It will also send different email depending on the condition for the registered user. If anyone would write the same method, ...
1
vote
0answers
36 views

Retrieving XML data

I am using the following function to receive XML data from a URL. Is there a more efficient method for retrieving this XML data? ...
6
votes
1answer
628 views

Using Identity to create user administration page

I'm developing an ASP.Net web application, using MVC 5. This application authenticates via LDAP and will assign an Identity Role of "Admin" to a designated user. The Admin user will be able to go to ...
3
votes
1answer
135 views

DotNetZip: Adding files to archive faster in web app

I'm looking for ways to speed up the process of adding entries to a zip-archive, in a web app, using DotNetZip. The problem currently is that the response times out before all files has been added to ...
1
vote
2answers
149 views

CRUD code for a finance WebForm

I have a finance web-application in ASP.NET WebForms using Telerik RAD controls. Two event handlers wound up being very similar in implementation. What steps could I take to improve the organization ...
1
vote
2answers
81 views

Code Behind to manage AD users for a CRM system

I have big class in ASP.NET WebForms (legacy). I use VS 2012. I want to evaluate Conditions and execute Actions - Commands like: Create in AD Delete in AD Enable in CRM DesEnable in ...
3
votes
1answer
54 views

Database design for users' postcards

I would like to a review of my database design. There are 3 tables + ASP.NET Identity tables. The Users could have many postcards. Here's my tables without Identity. I attached also my scripts of ...
1
vote
0answers
53 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
3answers
470 views

ASP.NET Product Listing

I am working on a e-shop in ASP.NET MVC, and I just made the listing of product the way I figured out this night. Is it correct? Or should I make it differently? How? So this is my Product controller,...
10
votes
1answer
126 views

ASP controller for tracking equipment

This was originally posted here. I'm hoping Code Review will be a little more helpful in giving me a concrete direction. I've been working on a project based off of this tutorial. Unfortunately, ...
1
vote
2answers
251 views

Simple Repository Pattern without ORM and Unit Tests

I'm trying to implement the repository pattern in the following manner: Interface: ...
0
votes
1answer
28 views

Caling AJAX Method for multiple hidden ids aspx

I am calling a ajax method for a number of hidden client ids on an aspx page. The ajax method returns some html to a div provided. So the code looks like below: ...
4
votes
2answers
69 views

Fetching the website version number from the database

I was just writing some code the other day, and I found myself writing something I am not sure whether it is OK to do it like this, or not. Let me give an example of what this is: I have this Method:...
2
votes
1answer
95 views

Simple repository for a small/medium sized ASP.NET MVC site

I am about to start a small/medium sized project. I am by no means a software architect. But I tend to question every move I make at times, since I want to do things correct. I found a way to ...
3
votes
2answers
98 views

Luhn Algoritm for social security numbers

I just got some negative feedback on some code I wrote and I was not able to know exactly what was wrong with it (I tried). It is a program that verifies to see if a social security number is valid or ...
0
votes
2answers
72 views

Have a class that holds all the interfaces [closed]

I seriously didn't know how to write this in Google, there must be an answer lying around. Here it goes: I'm using Ninject (IoC) and ASP.NET MVC 5. I have a business layer with a couple of classes. ...
2
votes
2answers
153 views

Login page code enhancement

I am starting to learn ASP.NET, and I am designing a page for an admin to login and do some stuff. I have the username and password for the admin stored in Web.config (Is that a good practice?). ...
2
votes
2answers
144 views

Copy Data from Informix to SQL Server

The following method copies data from Informix db to SQL Server db and it's so slow, I want to refactor it so it could be more readable and faster: ...
1
vote
1answer
75 views

Scoping resources per HTTP request

I am using this code in an MVC application to manage objects that should only have one instance per request. ...
1
vote
0answers
249 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 (...
0
votes
0answers
25 views

Improving a hand rolled Select tag with OptGroups

I am working in asp.net. The asp:dropdownlist does not have an option for optgroups. I attempted to roll my own select using HtmlTextWriter but it feels flimsy at best. The following code works, ...
1
vote
2answers
725 views

Which is correct : Open one Connection for inserting List of objects or open connection for every single insertion?

I have written the following method twice but I don't know which is better from performance perspective, code design and best practice. First: ...
2
votes
1answer
59 views

Building a simple REST service using Web API 1.0

Friends, It's been several years since I last worked with the ASP.NET Web API framework. Even then I had developed with it minimally. I have a requirement for a service that will allow for the ...
5
votes
0answers
555 views

Dependency injection with asp.net identity and property injection with dbcontext

I configure asp.net identity using Simple Injector ...
5
votes
1answer
865 views

Recurring tasks in ASP.NET MVC

I have 2 alternatives for executing recurring tasks in ASP.NET MVC. We just need to add some code in Global.asax First alternative: ...
2
votes
0answers
908 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 ...
0
votes
1answer
36 views

Creating controls on a page which differ slightly depending on an external state

I've got a part of my application which deals with tracking the dates a particular item is worked on. It is a single aspnet page, which displays controls to either start or stop tracking, depending on ...
1
vote
2answers
386 views

Get Word Doc from SQL table, save temp file, edit that file, save new doc in a different table

I have Frankensteined the crap out of this method and just wanted to make sure of two things. I'd like to make sure that this is the best route to take. If it isn't, I would welcome with open arms an ...
1
vote
1answer
135 views

SQL Inserting up to 10'000 records from a table to a secondary table

I'm relatively new to ASP.net and working with larger data sets as a fresh graduate, and I am currently maintaining/developing for an ASP webform and T-SQL system at the moment where we have a ...
4
votes
1answer
563 views

Utilizing Areas to handle subdomains with shared state/resources

I am currently working on a side-project and have the basic foundation and architecture I want in place for the site. I wanted to get your opinion and thoughts on my current practices and methods ...
4
votes
1answer
96 views

Joining tables with EF

Here is my database: Here is my viewModel: ...
3
votes
1answer
139 views

Modifying the response object for creating and downloading a document

I've been looking at some code done in C# ASP .NET WebForms and for some reason I really don't like the below code. What is the best alternative for creating a document and downloading it in Webforms, ...
4
votes
3answers
140 views

Central Database class

I have this web site I inherited as part of my job and it has some old code. I'd like to optimize it, but I don't really have the time to do it right, so I'm looking for some "low hanging fruit" to ...
8
votes
1answer
2k views

First SignalR application (Connecting 2 clients; mobile and desktop)

Two days ago I started reading about SignalR and today I started writing a simple application. I have written the code below so far, but I was wondering if you have some tips to improve my code. ...
4
votes
2answers
94 views

Gathering tokens from ASP.NET routes

This is one of the (many) utilitarian classes I have that I use with my ASP.NET sites. The basis of this one is to make gathering certain tokens that I use periodically, to make URL's more friendly. ...
2
votes
0answers
61 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 ...