Tagged Questions
-2
votes
0answers
17 views
How can i find out post-string from another webpage asp.net [on hold]
i wanna make search page in my page from another website's page. Here is my code ;
...
1
vote
0answers
25 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 ...
12
votes
1answer
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 ...
3
votes
2answers
417 views
Accessing MySQL to make queries and scalars
I've developed my own class in ASP.NET project to access MySQL and make queries and scalars, and read the results from it.
I want you to review my class and tell me where I've made a mistake.
Here ...
9
votes
5answers
2k views
5
votes
5answers
401 views
Username, Password and UserType Validation
I have two tables in the database:
Credentials (userid, password, usertype)
Customer ...
2
votes
1answer
41 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
47 views
10
votes
2answers
10k 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
57 views
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 ...
5
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
95 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
93 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 ...
7
votes
3answers
638 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
169 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
348 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
81 views
Web service - getting data from SQL and adding to Object
I have created a class called CommandMessages
...
6
votes
2answers
245 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 ...
3
votes
1answer
158 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
575 views
Sending GET/POST requests in .NET
I have a RequestsExtensions class with two functions for sending GET/POST requests.
...
1
vote
2answers
44 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
335 views
4
votes
1answer
191 views
4
votes
1answer
110 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
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 ...
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
1k views
Truncate port number from absolute Uri
We had a requirement to remove the port number from the Request.Url.AbsoluteUr i.e
Actual:
...
2
votes
0answers
145 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
3answers
133 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
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
175 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 ...
6
votes
2answers
189 views
5
votes
1answer
118 views
3
votes
2answers
478 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
535 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
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 ...
4
votes
1answer
938 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
790 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 ...
8
votes
2answers
8k views
Creating a TreeNode hierarchy in C#
The following function accepts a list of Topic entities, retrieved from a database using LINQ-to-Entities. Each Topic has an Id, ...
4
votes
2answers
428 views
OOP Methods/Functions that can return a value or an exception
Introduction
I'm currently working through a series of bugs in an application. Our application is written in C#/ASP.NET (on the server) and HTML/CSS/JavaScript (on the client). We are using ELMAH to ...
3
votes
1answer
437 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. ...
1
vote
2answers
240 views
Critique my database design and help me simplify my code
I wish to create a database for a webpage where users are able to add their own events to a timetable. Users will be able to decide if the events should be recurring (weekly) or not. Users should be ...
0
votes
1answer
2k views
How to re register dynamic scripts registered with ClientScriptManager in asp dot net using session was bad idea
Following the normal pattern of adding inline scripts to gridview row/s is a bad practice it used to work like below
...
1
vote
1answer
220 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
685 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:
...