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

3
votes
1answer
37 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 ...
1
vote
0answers
32 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
204 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
117 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
138 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
25 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
66 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:...
0
votes
0answers
41 views

Simple repository for a small/medium sized asp.net mvc site. Using entity framework

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
72 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
70 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. ...
1
vote
1answer
100 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
90 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
39 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. ...
0
votes
0answers
92 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
22 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
703 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
51 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 ...
3
votes
1answer
274 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
362 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
35 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
165 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 ...
1
vote
1answer
70 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 ...
3
votes
1answer
197 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
91 views

Joining tables with EF

Here is my database: Here is my viewModel: ...
3
votes
1answer
72 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
94 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
698 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
88 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
39 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 ...
3
votes
1answer
175 views

Web API Interview Practical Test

A week ago, I applied for a 'Software Engineering Internship' at one of the company. Since I know C++, C#, Java well and have worked on couple of ASP.NET MVC projects with MS SQL server before, I knew ...
1
vote
1answer
80 views

Safe Login Standards [closed]

I'm really trying to wrap my head around application safety in some web pages. I'd like to mention some of the things I've done in the past and hear some critiques on how I can get better. ...
6
votes
1answer
2k views

Identity OAuth implementation with Owin

I am building an MVC 5 application using code-first Entity Framework 6 and a customised ASP.NET Identity model for authentication. I will only be authenticating against external OAuth providers (...
0
votes
1answer
46 views

Simple and reusable system for user registration and tracking and auto-updates - follow-up

This is a follow up question of this one. Since the original question was posted, it has turned out that in some cases I want the code to be synchronous and in others to be async. I have updated the ...
5
votes
1answer
196 views

Combating magic strings in a web application

I'm on a quest to combat all the magic strings which tends to pile up in an ASP.NET MVC application. All reviews will be highly appreciate but please note that: Some of the classes contains more (...
2
votes
2answers
81 views

Validating users with Roles

I am using the following to validate my user which works but i wish to incoperate roles so I used the reg iis to add the standard tables aspnet_UsersInRoles. What I basically want is the ability to ...
3
votes
1answer
201 views

Using the ConcurrentBag as an object pool for an ASP.NET application

Is there anything wrong with this implementation of an object pool that will be called from an ASP.NET application? The object I want to pool has extremely expensive initialization, so currently I ...
2
votes
2answers
130 views

Save data button

This is a commonly used format for our save button for a lot of our pages. I parameterized (to prevent SQL injection) a lot of this. For this page, there's a ton of textboxes and other stuff, so ...
-1
votes
1answer
144 views

WCF generic proxy caller

I have an ASP.NET web-client and many WCF services. I used it this way: ...
3
votes
3answers
114 views

Should I be using a stored procedure for this function in my code behind?

We typically do our saves and deletes for our asp.net pages (SQL Server as back-end) in the code behind. I've seen some reference the idea of creating a stored procedure for this purpose. Is this the ...
1
vote
1answer
133 views

Using custom negotiator and custom formatter in Web API 2

Here's my custom formatter which I want to use for "application/x.product" content type: ...
6
votes
2answers
290 views

Audit table queries for various combinations of search criteria

I've created a search page on a rather large Audit table (populated by triggers on every database). There are 4 fields you can search by (and I put each textbox next to each other): User ID, Table ID, ...
0
votes
1answer
34 views

Store TotalCount in ViewState

Is there a more concise way of doing this? ...
3
votes
1answer
68 views

Extracting SoftDelete from DbContext

I have a DbContext with a SoftDelete implementation inside it. To make it more clear and maintainable, I wanted to extract it to ...
3
votes
2answers
82 views

External application for the web application deployment

I need an external application that helps deployment of the web application. The application should create the aspnetdb database on the dedicated SQL server. Then ...
2
votes
2answers
197 views

Checking overlap ranges between two prices

I have a method (C#, .NET framework 4.0) to check overlapping ranges between two prices. I have a process, which will have one or more ...
3
votes
3answers
1k views

Master detail INSERT in Entity Framework 6 Database First MVC 5

I have a DB with a master table called "facturas" and another detail table "facturas_detalle." I would like to insert to them, so this is a "Database-First". I need some guidance or advise of best ...
4
votes
1answer
97 views

Resolve entity behaviour based on enumeration type

The core of this question is removing a Static Class smell from my Web-Api/MVC solution. It presently works but feels kind of dirty. Present Solution Standard solution with 6 projects: MVC Api Api....
2
votes
1answer
62 views

Refactored to use polymorphism in place of case statements

The purpose of the below code is to return different types of job objects based on an argument named "jobType." The original code for the below methods was implemented as a switch statement. I ...
5
votes
3answers
165 views

ASP MVC Controller Unit Test

So I've been writing a unit test using Rhino Mocks to a controller in my ASP MVC application. The test passes, but I'm interested in your opinion and if there's something I should be doing differently ...
5
votes
1answer
1k views

MVC app to associate users with roles

I'm a beginner to web programming and just started a MVC project from scratch. Because this will become a large project eventually, I would like to make sure that I'm doing things kind of right from ...