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
19 views

Is there a method to add multiple properties to HtmlTextWriterStyle?

I am creating new elements for a webpage at run-time and I have code like this: var dynDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("Div") {ID = "dynDiv"}; ...
0
votes
0answers
19 views

ASP.Net caching helper

I'm willing to simplify the use of the ASP.Net cache. I wrote this helper class : public static class CacheHelper { public static T GetCached<T>(string key, Func<T> initializer, ...
1
vote
0answers
37 views

Best practices in implementing service methods

Consider the following architecture: ASP.NET MVC Application having controllers which depend on service classes (MembershipService, EmailService etc.) which in turn depend on data access context ...
2
votes
3answers
80 views

Using Linq to select the first and last values

I want to get just the first and last values in a date range. I have the following code: using (var myEntities = new dataEntities()) { var myValues = (from values in myEntities.PointValues ...
2
votes
2answers
48 views

Building Session-Variables from a sql stored procedure

I have been advised to submit my code here by a fellow Stack contributer as it was suggested the code could be further improved; Calling Code and attempt at building session variables: DataTable ...
-2
votes
0answers
23 views

Is it a good Idea to upload Image after encoding it to base64 to enable fileUpload via Ajax? [closed]

I want to upload different files via Ajax post to my asp WebService. Is it a good idea to convert the file into base64 encoding and send it to Asp and convert it back again to byte array?
1
vote
2answers
31 views

MVC : Does code to save data is session or cache belongs in controller?

I'm a bit confused if saving the information to session code below, belongs in the controller action as shown below or should it be part of my Model? I would add that I have other controller methods ...
1
vote
2answers
54 views

Insert Selected item in listbox using Ado.net and stor proc

I create this class method to Enter Selected Items Form CheckboxList to associated resource I use ADO.net & store Proc to insert data can someone help me to improve it and make to so clean instead ...
1
vote
1answer
53 views

Truncate port number from absolute Uri

We had a requirement to remove the port number from the Request.Url.AbsoluteUr i.e Actual: https://mysitename:443/Home/Index Excepted: https://mysitename/Home/Index The code I used for ...
2
votes
0answers
56 views

Display progress bar to show async. request status using JQuery

Instead of using ProgressBar plugin, I've below script to display the progress bar for async. requests on the page. Could anyone provide any feedback on this esp. if there will be any issues like ...
1
vote
0answers
35 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 ...
1
vote
2answers
62 views

MySQL GEAR, C# class for ASP.NET project

I've developed my own class in ASP.NET project to access MySQL and make queries, scalars and read the result from it. I want you to review my class and tell me where did I make a mistake, thanks! ...
2
votes
1answer
54 views

Cropping and combining two images on server

I've coded following two methods to combine images that are HTTP POSTed to the server: // Crops two squares out of two separate images // And then combines them into single image that's returned as ...
4
votes
2answers
161 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 ...
1
vote
2answers
64 views

Is there a simpler way to write a row from one table to another?

I have the following code: const String sqlSelect = "SELECT * FROM UserPasswords WHERE username='System Administrator';"; const String sqlInsert = "INSERT INTO UserPasswords VALUES ...

1 2 3 4 5 10
15 30 50 per page