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
89 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
44 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? ...
0
votes
0answers
25 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. ...
-1
votes
0answers
42 views

how to reduce calculation time in foreach loop

How can I improve this code to reduce the calculation time using a foreach loop? The problem is that it take more time to calculate answers. ...
2
votes
1answer
51 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
60 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
42 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 ...
2
votes
1answer
210 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
49 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
55 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
101 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
74 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
95 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
192 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
175 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
154 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
118 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 ...
1
vote
1answer
107 views

Account view with MVC and paging

My Model ...
5
votes
4answers
2k views

Return a list of values from a single column in a DataTable

I have this code that I was asked to maintain, it is a notification system for a third party application event system (a lot more involved than that but for the sake of this question...) The Code ...
3
votes
2answers
299 views

Generic method for HTTP GET/POST parameter conversion

I just made a method that should handle GET and POST parameters (primitive types) sent by AJAX requests to the server: ...
2
votes
1answer
117 views

Why is loading images taking so long?

When Page_Load is executed I assign the ImageUrl which is a IHTTPHandler: ...
3
votes
3answers
513 views

Code optimzation by constant if-structure iteration removal

Below you will find the specific code that I am attempting to optimize. I have a method previous to called getCount() which, based on similar parameters as below, ...
-1
votes
1answer
1k views

When a radio button is clicked, disable some search fields

The table has 4 search types and 4 radio buttons; when one radio button is clicked, other fields should be disabled. The JavaScript code seems repetitive. How can I improve it? JavaScript ...
0
votes
1answer
82 views

Binding controls to properties in ASP.Net WebForms

In my application, we have a number of pages which provide an advanced search capability, with a large number of potential search options (some pages have as few as 3, some as many as 150). The HTML ...
4
votes
2answers
57 views

Formatting checks against a session

This is the current code that gets put into a option box, is there a way to make this code more efficient and use less code ...
5
votes
1answer
249 views

Function to run MySQL SELECT queries with no leaks

I am upgrading an old massive website that is a Classic ASP \ ASP.NET hybrid. I still have a long way to MVC. Right now I want to convert all code that uses ODBC to the mysql connector specific code. ...
4
votes
1answer
143 views

WebAPI controller

It return an object with WebAPI by proving some data. Is this a good approach? ...
5
votes
1answer
117 views

Displaying a row of buttons

There must be a better way to display this code. Does anyone have any ideas? What the code does is displays a row of buttons and when you click on a button it changes the session so you can see if ...
1
vote
1answer
152 views

Make a “Web-Proxy” - step-by-step

My problem with links is solved. Text challenge is to copy pictures on remote page to my own host, then replace the links in source code. Any idea? I started creating a web proxy. I decided to ...
3
votes
1answer
84 views

Portfolio website

I'm making a portfolio website right now with Visual Studio 2013 and ASP.NET 3.5 because my free hosting only supports 3.5. Are there any bad practices in my code at the moment? What would you change ...
2
votes
2answers
1k views

Method for getting the DataTable when having connection ID and the SQL command

I am quite new to C# and to the ASP.NET programming. When maintaining the legacy code, I have found rather terrible implementation of the method that is used on many places to get the ...
4
votes
0answers
170 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 ...
3
votes
2answers
90 views

Better way to group elements?

this.Items is a list of products. Each product has a category (product.Attributes["category"]). I want to render a drop down ...
2
votes
1answer
104 views

Admin class for monitoring blog users

I have an admin class that controls when a user logs in and creates a new blog post. I am wondering if there is anything I can do to improve this class. Is there any way to reduce the code? Is there ...
0
votes
1answer
126 views

Simple Dal for Accessing Procedures

How could I improve this code? ...
0
votes
1answer
213 views

Handle concurrent HTTP requests with a generic .ashx

I have created a .ashx file that is able to handle concurrent http requests. Works great, but now I'd like to create a base class that does the common work in order to not repeat myself each time I ...
4
votes
3answers
255 views

Parsing dates from a webpage

I have two inputs (TextBox) on my front end. The following code parses them from their string representation to aDateTime object. If it fails, it then sets ...
3
votes
2answers
436 views

Abstract session value manager

I've been working in C# for a while, but I'm just recently starting to force myself to use better abstracted and generic code. I recently encountered a situation where I was juggling a lot of session ...
6
votes
5answers
2k views

Calling many web services asynchronously

I need to process a bunch of completed orders (thousands). To make it faster, I'm using a SemaphoreSlim to schedule a number of orders to be processed in parallel. ...
6
votes
2answers
587 views

Converting multiple query to use parameters to avoid SQL injection

I have some dropdownlist in my aspx page and I am using the choices from them in my SQL query: ...
2
votes
2answers
418 views

Is there any disadvantage of using MVC Razor Syntax codes inside a NoScript tag?

I'm creating a ASP.NET MVC Website that display blogs from the database by AJAX. The problem is - I have limit the results to only 10 by default and add a Load More button to display 10 more results ...
2
votes
1answer
64 views

Redirect browser

I've got a 'menu' within a Master page which include a number of image buttons with click events. Within each click event, I want to redirect the user to a specific page. However, if the user is ...
4
votes
1answer
222 views

Filling a table in code behind

I was wondering if there could be an easier or simpler way of filling a table with code behind. So far I have my html/asp.net table : ...
3
votes
1answer
465 views

Updating Related Data the MVC/EF Way

I have an ASP.NET MVC Controller, the relevant parts of which appear here: ...
2
votes
2answers
322 views

Different Approach to the following ASP.NET Web API Action

Maybe someone here can help me sort out this implementation and make it better. First the following constraints: 1 Controller & Action that accepts all post requests, these post requests will ...
3
votes
2answers
199 views

DataTable to given type T simple mapper

I threw this together and would love any suggestions on how to improve on this simple DataTable to given Type T mapper. Anything ...
3
votes
1answer
169 views

Is this a sensible way to throttle duplicate requests in a HttpModule?

I'm writing a method to throttle duplicate requests taking place within multiple HttpModule instances within a web application. Currently I have the following ...
5
votes
2answers
2k views

Set default value for NULL in datatable

I have the following codes, which I created as extension for datatable in my project. It actually worked. Just wonder if there is any optimization can be made through. Thanks. =) ...
2
votes
1answer
112 views

Long list of SQL parameters and audits

Say I have the following code. What are your thoughts on questions 1-4 below? I think it's way too long when I have to list out most of the fields. Is there any better way of doing this? I build up ...
3
votes
1answer
208 views

TextBox rendered as Label

I have created a custom web server control that will have a bool property 'RenderAsLabel' so that I can convert TextBoxes to Labels, for read-only forms. I was wondering if there is any reason why ...