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

5
votes
1answer
43 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 ...
1
vote
0answers
11 views

Reviewing LLBLGen code for dropdown databinding

I'm using a lookup table to store all my data for comboboxes (like gender male, female etc.), in order to give an easy management tool in my cms. I am using LLBLGen for my DAL. ...
1
vote
0answers
40 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? ...
7
votes
3answers
143 views

Parsing pipe delimited lines

I am parsing the following line of code via a specific format. Line is: S|111111|87654321|Bar UK|BCreace UK|GBP|24/08/2010| The Format is: ...
0
votes
1answer
62 views

Binding data in a TemplateField

This is my current RowDataBound function. I think this functionality is a bit horrrendous really and it winds up with an extreme amount of LINQ SQL queries being ...
4
votes
2answers
65 views

XML/HTML Read/Write

Edit 15 August: Many thanks for the two answers thus far! However, because they each address only a part of the solution, I'm going to refrain from marking either as correct for the time being. I am ...
1
vote
2answers
70 views

Float.Parse issue

I have telerik radgrid that has an SQL backend. What this function is doing is conditionally formatting the cells with in the radgrid. It checks each column to see if the min and max values are within ...
8
votes
3answers
106 views

Simple Google ReCaptcha validation

Linked: Google reCAPTCHA Validator: Iteration II I have also created a simple Google Recaptcha Validation class to handle verification. I used some code from CodingFusion's post Google New ...
6
votes
2answers
103 views

Google reCAPTCHA Validator: Iteration II

This is a follow-up to the other post I made (less than an hour ago) about my Google reCAPTCHA C# implementation: Google reCAPTCHA Validator This adds support for error messages, so that you can ...
1
vote
1answer
104 views

Listing users in Azure Active Directory

The code below is the Index Action from a User Controllers. Basically this code returns a list of users from Azure Active Directory using Azure Authentication Library (ADAL). However I need to show ...
2
votes
1answer
81 views

Global.asax singleton

Please help me decide whether this should be good or bad idea to declare a Singleton variable in Global.asax file. (It is not actually singleton pattern, I just want to make sure that only one ...
6
votes
1answer
1k views

Don't search for minors, it isn't allowed

I have a search form that doesn't require much in terms of input parameters, but the Date Of Birth is import for this particular search. I have been working on creating a way that the form can be ...
1
vote
1answer
38 views

Authentication management

I have the following code and I think it's almost impossible to read and to maintain. I prefer self-explaining and modular code where variable and function names tell what I'm trying to do, but I ...
3
votes
0answers
43 views

User Registration Form Layout

I am working on a site where I need to be able to accommodate frequent flyers but I am not so good at user interface design when I am given such a long leash. I am using ASP.NET (I am restricted by ...
6
votes
2answers
92 views

Zip Code to City, State for registration form

Took me a couple of days (in between working on other projects) to get the code working, but now that I do have it working I would like to know if there is a way that I could make it work better, or ...
6
votes
3answers
270 views

Generic getting single value from DB in C#

Few months ago I posted my code Getting a single value from the DB. I implemented suggested changes and this is how it looks like right now: ...
4
votes
0answers
56 views

Global Modal User Alerts in ASP.NET from masterpage

I'm working to implement global alerts by which they reside on the master page, and can be called from both content pages as well as user controls. I'm having an issue with the latter. The goal is to ...
2
votes
2answers
60 views

Basic survey app

I am learning MVC 5 .NET and this is a bit different than Rails activerecord when creating relations. I have created a basic survey app that has a Survey class and this relates to the questions and ...
2
votes
1answer
181 views

MVC Repository Insert Using async

This is practically my first time using async in my code. I read about dos-and-donts but I wanted to get some feedback on what I've written. I'm using a repository ...
1
vote
1answer
70 views

Converting table data into nested JSON

I'm new to C# (coming from a JavaScript background) and it seems like this code could be greatly improved. This SQL query: ...
7
votes
1answer
87 views

jQuery dialog for help popup

I used jQuery-UI and jQuery to create a dialog popup for help snippets on search form inputs. HTML (Calling Page) ...
2
votes
1answer
175 views

ASP.NET View Model / Identity Model

I'm working in MVC5/WebAPI using ASP.NET Identity, with a custom storage provider for my UserStore, custom ApplicationUser ...
6
votes
2answers
270 views

EF lookups and enums

I have a lookup table "RequestTypes" that has the following data: ...
2
votes
1answer
56 views

An extension method to get the current user [closed]

I think that everyone is familiar with the concept of a context (such as HttpContext in ASP.NET) where you can put some shared ...
4
votes
1answer
203 views

ASP.net Identity admin reset user password

I have an application which uses ASP.net Identity as for its user authentication. I do not wish for users to reset their own password (for reasons which are not relevant here), so I have developed ...
3
votes
2answers
58 views

Check whether all textboxes are filled

I'm doing some simple validations using jQuery to check if all textboxes are filled. ...
0
votes
0answers
158 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 ...
0
votes
1answer
30 views

Gridview cookies

On my web forms page, I have this huge GridView. I make it refresh every five minutes since the data has to be up to date. It has sort options, so upon every refresh, I use cookies through every ...
5
votes
4answers
461 views

Educational website using ASP.NET webforms

Our team is developing an educational website using ASP.NET webforms. We designed DAL & BAL classes and now I have some questions: Are DAL & BAL designed well? Would it be better using ORM ...
2
votes
3answers
637 views

Searching based on a query string and returning JSON ActionResult

Using a Select2, what's the best way to refactor multiple if statements. This code returns Json to a select2 based on what information it gets in the query. The action result is used in many places ...
3
votes
0answers
491 views

Unity Owin per request lifetime middleware

Having changed my website over to owin, I can no longer use Unity's PerRequestLifetimeManager. So I'm writing some middleware for owin in the style of Autofac's ...
3
votes
2answers
371 views

Authenticating user/password against Active Directory using ASP.NET Identity

I am trying to learn how to use ASP.NET Identity. My scenario is that I have to authenticate against Active Directory. For that purpose I am trying to use ...
4
votes
2answers
147 views

C# Method to determine database status

I have a task that I am trying to complete and would appreciate direction, to know which is the most efficient path to take for future requirements. Use Case: A background process that determines if ...
1
vote
2answers
118 views

Code separation in MVC

Firstly I am not a professional programmer and I am just learning C#, MVC and Web Development. Much of what I describe here is self taught and comes from lots of googling and posts on Stack Overflow. ...
3
votes
1answer
115 views

Using composition instead of inheritance

I have been using Entity Framework 6, AutoMapper, ASP.NET Web Api and hit a few problems along the way, each time it was recommended that I could change my code from Inheritance to use composition ...
3
votes
1answer
77 views

Getting a single value from the DB

This is supposed to get a single value from the DB. What should I consider next? How can I upgrade it? ...
1
vote
1answer
100 views

LINQ to Entities query of tests for my classes, with many subqueries

This MVC4 controller method, which uses EF6, is taking a long time to run (over 2 seconds). I've added verbose comments for the purpose of this post only. ...
2
votes
1answer
131 views

String extension method that truncates at sentence punctuation

I've received a request at work and the senior developer is away on vacation so I can't ask him. The request was to truncate lengthy article titles while maintaining readability. In other words, don't ...
1
vote
1answer
156 views

Using ASP.NET identity in a new app

I need code review for using ASP.NET Identity in a new app. Goals: Use int instead of GUID for IDs. Separate identity from view layer I need code review if I ...
2
votes
1answer
94 views

Implementing transaction method with invoking business methods in a one transaction

Because the ambient transaction isn't supported with informix, I pass the transaction and the connection through my methods. I ...
3
votes
1answer
1k views

Automating CRUD using Repository Pattern, Web API and TypeScript

I would like a review of the following application, esp with how I'm registering and selecting the controllers. First I defined a generic Repository interface and implementation using EF 6.1.2: ...
3
votes
2answers
64 views

Eager load additional data about some instructors

Below is a snippet of code of a little practice project. I am still pretty new to EF and I was wondering if there is a way to write the below statement so that all required data is eager loaded since ...
2
votes
2answers
65 views

Validate and Add Service Provider/Location in C#

I have a button that will validate the textbox for the service provider and the dropdown list for the locations. I have 3 tables: Locations, Service_Providers, and Service_Providers_Locations with a ...
0
votes
2answers
203 views

Questionnaire design puzzle

I am designing a small questionnaire web service application but however I would like if someone can look at my design and see if it good approach I am taking. The application has the following ...
4
votes
2answers
166 views

Best way to identify a computer in LAN C#

I have a web application to manage computers. Every registered computer is locally querying the latest information and updates the database with it in a 10 minute cycle. But the computer is only ...
5
votes
1answer
205 views

Genetically engineered doodle creatures selector combo

I have created an awesome cheat/fan page for the game Doodle Creatures with the help of some cool people in The 2nd Monitor. Is there anything I can do to improve this code? Here is my ASP.NET ...
1
vote
1answer
451 views

Dependency Injection With Unity in MVC 5 without repository and unit of work

I want to use dependency injection with Unity in my application. I am not following repository pattern and unit-of-work (and don't want to). I also have ViewModel in my controller action method. ...
9
votes
2answers
250 views

Photo gallery user control

I am trying to create something that is very reusable here so that I can use it in other sites for other pages etc. This code is for a simple photo gallery, I took the code from here, but I ...
2
votes
5answers
206 views

Avoid calling init method on each return method

I'm implementing a module system into one of mine ASP.NET MVC applications and I am currently writing a module helper which all the modules can use to get some basic information about itself. I'm ...
7
votes
1answer
132 views

Displaying a video player to eligible users

I posted this on Stack Overflow, but it was suggested that I move it over to Code Review. I would like some feedback on the way I decided to clean up code from the in a .NET project that had ...