ASP.NET is a web application framework developed by Microsoft to allow programmers to build dynamic web sites and web applications.
2
votes
1answer
32 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.
...
2
votes
2answers
43 views
8
votes
2answers
9k views
Is there a better way to consume an ASP.NET Web API call in an MVC controller?
In a new project I am creating for my work I am creating a fairly large ASP.NET Web API. The api will be in a separate visual studio solution that also contains all of my business logic and database ...
2
votes
1answer
52 views
1
vote
0answers
31 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
2answers
2k views
Tree node filtering with List<TreeNode>
I had a question about filtering tree view and returning just first match.
I've tried to create list<treenode> and change the code. Is it possible improve ...
4
votes
1answer
2k views
Web API and Stored Procedures
I am building a web service that gets data via Stored Procedures from a db and provides the result as JSON. The solution is built as a MVC 4 Web API project. I have to retrieve the data via Stored ...
5
votes
2answers
88 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 ...
1
vote
1answer
76 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
2answers
45 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 ...
7
votes
3answers
634 views
Stack Overflow like pager
I've been working on a Stack Overflow like pager for my personal use and I've gotten everything working pretty good. Some of my logic is a bit suspect though, especially the logic in the Pager class ...
6
votes
2answers
158 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:
...
4
votes
1answer
345 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
77 views
Web service - getting data from SQL and adding to Object
I have created a class called CommandMessages
...
6
votes
2answers
192 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
326 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 ...
3
votes
1answer
157 views
AsyncPages in ASP.NET 2.0
I'd like a review of this implementation of Async in ASP.NET 2.0 web form page below. Let me know if I am missing something.
AsyncPagesASPNET20.aspx
...
5
votes
4answers
444 views
Sending GET/POST requests in .NET
I have a RequestsExtensions class with two functions for sending GET/POST requests.
...
0
votes
2answers
38 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
297 views
4
votes
1answer
188 views
1
vote
2answers
370 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 ...
4
votes
1answer
104 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 ...
5
votes
2answers
1k 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 ...
3
votes
1answer
62 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
68 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 ...
3
votes
0answers
31 views
Stored Procedure variable column update
The purpose of the below code is to update a column based on the name of the field name sent from the .NET code. This allows one piece of code to handle multiple rows when a user is only ...
3
votes
2answers
91 views
Using properties efficiently in inheritance
I have a class called Mailer which has some properties like this
...
2
votes
2answers
987 views
Truncate port number from absolute Uri
We had a requirement to remove the port number from the Request.Url.AbsoluteUr i.e
Actual:
...
1
vote
0answers
131 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
63 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
127 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 ...
3
votes
0answers
1k views
Review my Generic ASP.net MVC controller that generates many pages?
I recently set out to create an open-source ASP.net MVC web development framework. Specifically, I wanted to automate some of the tasks associated with the creation of data-driven applications. I've ...
2
votes
0answers
46 views
Tracking sports statistics
I am designing a new application to track sports statistics. I am using code first migration. I have the bare minimum POCO setup. The problem is I am not happy with the design specifically how the ...
3
votes
2answers
2k views
Old-way of asynchronous programming in ASP.NET MVC 3
On ASP.NET MVC, I try to write an async Controller action with the old asynchronous programming model (actually, it is the current one, new one is still a CTP).
Here, I am trying to run 4 operations ...
5
votes
1answer
81 views
Sugestion on a better way to code this EF update?
I have a block of code that pulls the current menu position and compares it to what users selected, if the selection is different the database is updated with the new selection. As I am still new with ...
5
votes
1answer
174 views
optimize the pagination of repeater?
Hi I have some problem in my View.ascx.cs because I'm using reuse my code and modified it based on the situation for example I when I apply pagination I have efferent code in all place
just I wan to ...
10
votes
0answers
2k views
Fluent LinkedIn REST API client interface design
There is a handful of LinkedIn clients written in C# on the NuGet package library, but afaict most only do authentication via LinkedIn. I found a couple which offer a linkedin rest api interface. Of ...
0
votes
0answers
38 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
185 views
5
votes
1answer
115 views
3
votes
2answers
433 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 ...
1
vote
1answer
2k views
Basic GridView backed with a DataTable - am I doing it right and understanding it properly?
I need to add a list of names and (optional) links to my ASP.net page.
I learnt (hopefully) to use a GridView to do this, mostly working from the example given by this blog entry: ...
3
votes
3answers
129 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
515 views
Making a page update based on the progress of a process
Now this is something I've looked into, and while I have a "working" solution, I don't like it.
Background:
Through our intranet website, we want to run a process that copies a file from another ...
1
vote
1answer
39 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
993 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
415 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 ...
4
votes
1answer
883 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 ...
4
votes
1answer
751 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 ...