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

1
vote
1answer
40 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 ...
2
votes
1answer
73 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 ...
4
votes
2answers
67 views

Searching through various PDF files

I'm just looking for advice on how I can get my code to operate faster. It's pretty quick right now with searching through 30 3-page PDFs, but I imagine once there gets to be thousands of files to ...
1
vote
0answers
35 views

HttpRuntime.Cache cache manager class

I am making code review of legacy class, which manages caching logic. Caching logic uses ASP.NET webforms HttpRuntime.Cache. I know class, that is posted below, is ...
3
votes
0answers
20 views

Better approach to online builder

I have a windows forms application which needs customized dll files to be built and for that I am using an online builder using asp.net. I am in no way a asp.net expert not even near a beginner but ...
5
votes
5answers
431 views

Username, Password and UserType Validation

I have two tables in the database: Credentials (userid, password, usertype) Customer ...
2
votes
1answer
59 views

Is my ObjectCache wrapper sound?

Wrapper: ...
3
votes
0answers
64 views

Unit of Work + Repository Pattern + Stored Procedures

I'm a beginner with ASP.NET Web API and the Unit of work + Repository design patterns. I've been reading a lot about ASP.NET Web API and I'm learning as much as I can so I can create a good web API. ...
2
votes
1answer
47 views

Schedule Global Task by using static System.Timers

I'm using System.Timers to schedule tasks. I find this working, but I'm not quite sure if it's ok to do it this way. ...
5
votes
2answers
99 views

Adding object to database, using linq or sql connection

I have a table called tblDelegates in my database which I need to populate with some data. I have created a class called Delegates which has various properties to ...
2
votes
2answers
49 views

Async operations in WebMethod

How can I improve this code, without to return async Task? ...
1
vote
1answer
111 views

Multi threading in ASP.Net to increase performance of processing data from entity framework using anonymous types

Intro I am trying to populate a Multi-column Combo-box with a large amount of records.Depending on the selection the user has taken there can be 1 - 50000 items in the Combo-box (I may not display ...
3
votes
3answers
63 views

Simplify ASP.Net StreamWriter for appendtext to file

Is there anyway to simplify this code so there aren't so many redundant w = File.AppendText(filePath) and w.flush() and ...
4
votes
1answer
350 views

Should I split code into smaller functions? Advice on layout

I have the following code. I was wondering if anyone can give me any pointers on how to make this more concise and neater? Should I be splitting this down into smaller functions? ...
2
votes
1answer
83 views

Web service - getting data from SQL and adding to Object

I have created a class called CommandMessages ...
6
votes
2answers
173 views

How to Make Strongly-typed References to Web.Config?

Let's say I have a configuration file with a property in it: <add key="LoadedCode" value="L" /> I know I can reference this using the ConfigurationManager: ...
6
votes
2answers
298 views

Web service getting value using LINQ from queue table in SQL database

As a test of my C# skills, I have been asked to create a simple web service which will take a message from a queue table in a SQL database and send it to a web application when a button is pressed on ...
4
votes
2answers
364 views

Can this combo box code be more compact and prettier?

I have 3 combo boxes with the same 3 selections in each. If the user picks the same selection a 2nd time, the first combo box resets. I have 3 other sections that will do the same with about 15 combo ...
5
votes
4answers
757 views

Sending GET/POST requests in .NET

I have a RequestsExtensions class with two functions for sending GET/POST requests. ...
1
vote
2answers
45 views

Database connection approach

We have recently started working in ASP.NET and starting a simple CRUD Web application in ASP.Net. Here is the approach we are following to connect to DB. Connection.cs ...
10
votes
3answers
396 views

ASP.Net caching manager

I have a Cache Helper Class. ...
4
votes
1answer
191 views

Can my code be made into one?

I've the following code: ...
4
votes
1answer
120 views

Using static management class to control db transactions through an EF6

I have the class below to manage my specific implementation of a membership system using entity framework 6.1 Is the use of static access correct in this case? as far as I understood that EF context ...
4
votes
1answer
68 views

Horrible nested if statement for changing CSS based on RadioButton selection

I'm writing away for this website, and I've come into a problem. I need to display only one td based on the corresponding radio button pressed. However, there are ...
4
votes
2answers
71 views

Server side validations and unit testing in MVP

We are following passive controller approach and when user clicks on submit, server side validations are fired. There are many other fields on the screen that needs to be validated. I would like to ...
1
vote
2answers
508 views

Is this use of Newtonsoft.Json.JsonConvert.SerializeObject secure?

Like many ASP.NET developers, I use the Newtonsoft library to convert C# objects into JSON. Is this use of Newtonsoft.Json.JsonConvert.SerializeObject secure? Here ...
3
votes
2answers
92 views

Using properties efficiently in inheritance

I have a class called Mailer which has some properties like this ...
2
votes
0answers
157 views

Generic Repository, UnitOfWork and IOC container

I am stuck to define a generic repository with AutoFac IOC container. I am keeping thing very simple and only showing relevent information. I have a BaseEntity ...
6
votes
1answer
66 views

Customized Template Login

While the MVC4 template provided by Microsoft is useful, I feel there are a few scenarios that should be covered to help out users trying to log in. Allow the user to log in with their email address ...
6
votes
3answers
138 views

Advice on “Factory” Pattern Implementation

I'm refactoring some code around a couple of ASP.NET Web Forms pages and decided to try out a variation of the Abstract Factory pattern of my own design. I need to create an implementer of an abstract ...
11
votes
3answers
174 views

Tracking sports statistics

I am designing a new application to track sports statistics with code-first migration. I have the bare minimum POCO setup. The problem is that I am not happy with the design specifically how the ...
0
votes
0answers
40 views

Adding viewstate based property and implication in future converstion to mvc in asp.net forms project

Suppostedly adding another viewstate based property in user control (riddled with similar properties) incur technical debt in future effort to convert projects to MVC (comment made by one of my ...
6
votes
2answers
192 views
3
votes
2answers
515 views

Where to databind a GridView?

Something that bothers me a lot when coding is best practice. I am completely self taught and I find it difficult to know whether I am doing things in the 'right way'. Let's say I have a Gridview on ...
3
votes
3answers
131 views

Cleaning if-statements in job applicant email system

I just wrote this and don't like how bulky it is, also given the fact I will have to add at least another if statement. I was going to switch it to a case ...
1
vote
1answer
40 views

Excel to SQL Upload

Aim: Import Excel to SQL Potential Issue: Wrong file type - this is handled in the 'upload' button by not allowing anything but *.xlsx files The wrong type of Excel file i.e. not 2003 onwards, ...
1
vote
0answers
1k views

Code First/Database First Entity Framework MVC [closed]

The following example is taken from the book Pro ASP.NET MVC 4 - Adam Freeman. This book does a good job going over the basics of the MVC framework. In it a ...
5
votes
1answer
121 views

Convert looping statement to linq mode

I have a model object class like this ...
6
votes
1answer
537 views

Is this nesting of partial views poor design?

I feel like using this many partial views where a view renders a partial that renders a partial is just digging a hole of poor design, so I'm looking for any suggestions or guidance as to if this is ...
5
votes
2answers
2k views

Using a BaseController in MVC asp.net to reuse the repository

I have a repository class that impliments a repository Interface. In my Controllers I want a way to access the repository without creating constructors each time in the controller. So now all my ...
4
votes
1answer
973 views

Entity Framework, code-first repository pattern review. Where to validate?

I've been iterating on my repository pattern implementation over the course of the past 4-5 months. In my new projects I choose to use this pattern and I try to improve upon what I learned in previous ...
1
vote
0answers
809 views

SignalR Chat + Navbar Implementation

I've been trying to ramp on SignalR. Here's the goal: Navbar connections to support navbar notifications like "someone poked you" Chat connections for when users are in the Chat page multi-tenant ...
4
votes
1answer
815 views

Thread-safe wrapper around WCF ServiceModel.ClientBase subclass

I have an ASP.NET application which uses a Service Reference to a (third-party, offsite) payment processor. The service reference class is generated automatically. Its implementation is a subclass of ...
3
votes
1answer
484 views

Is this password hashing acceptable for a custom MembershipProvider?

I'm creating a custom MembershipProvider for an ASP.NET MVC5 application and am wanting to know if this code is acceptable for creating hashed and salted passwords. ...
5
votes
1answer
87 views

SQL Join code check and peer review

I am still fairly green when it comes to SQL joins. The below code works but I want to check that I am doing it the best way before I copy and paste errors into other work in the future. The idea of ...
1
vote
1answer
233 views

Avoiding Duplicate Boilerplate Code in WCF Service

I'm responsible for maintaining a web service project in c#. I have one service class with a bunch of methods that look a lot like this: ...
4
votes
1answer
703 views

Implementing SOLID Principles with C# Asp.net

I have started learning about SOLID principles from yesterday. I've got a detailed explanation of SOLID principle here. After reading it and few other articles, I have tried to apply these principles ...
3
votes
3answers
139 views

How to make my code faster and easier?

This is my .cs part code where I am calling storeprocedure in LINQ to SQL: ...
3
votes
1answer
90 views

Retrieving statistics about URL clicks

I'm pretty new to ASP/MVC but have had some prior programming experience. I am trying to retrieve statistics about URL clicks - total clicks and unique clicks by IP address. I started with: ...
3
votes
2answers
97 views

3 layer design and multiple dataset

I'm new to C# and OO programing. I have an aspx page with 3 lists of checkboxes and I would like to generate them from the DB. how should I structure my code? Here is an example of what I did so far: ...