Tag Info

New answers tagged

1

In general you might want to establish in your architecture, a rule of thumb that controls in your design will not know about other control(s). If they do, you can end up with spaghetti and cross-referencing difficulties. Consider introducing a Mediator, where only the Mediator knows about all the controls. If a control wants to talk to another control, it ...


1

I'd do it this way: A user can hold a number of Roles within your application (including none). These will be retrieved from an external data store. Any control within your application is available to any number of Roles. These might be statically defined or loaded from an external data store. A Control becomes "available" when the current User's ...


4

I suspect that if you introduce threading to the export-to-Excel process that you'll now have two problems on your hands instead of just one. You need to take a deep look into the export code, and preferably run it through a profiler so you can see where time is being spent. Once you know where the bottlenecks are, you can apply the right technology to ...


0

It is actually pretty easy. All you need to do is to Extract the logic from Code behind/beside into Presenter class. All ASP.NET specific code should stay in code behind abstracted by View interface, that will be manipulated from Presenter. There is many examples on Model-View-Presenter pattern. Eg. ...


1

Your understanding is incorrect. Both the App_Code and aspx files are compiled just once and then cached. Individual files are only compiled when used (at least that's the most common case). There is a performance hit when a page is first hit, as it has to be compiled, if this is a problem web sites may not be for you. See Understanding ASP.NET Dynamic ...


3

.aspx files, compared to corresponding .aspx.cs code-behind files) are expected to contain minimum programming code, i.e. large chunks of HTML with here and there the calls to variables, eventually with straightforward loops and conditions. This means that you will rarely find unit tests for .aspx files, since there are no complicated algorithms or business ...


0

You can use JQuery. In this example, you can't enter 'w' into the text box. <input type='text' id='t' value='texttext' /> $("#t").keypress(function(e) { if (e.which === "w".charCodeAt(0)) { e.preventDefault(); } });


-1

I agree this was a broad question - if it's worth anything in the future, check the connection strings too. I forgot ASP.net would be connecting to most of these datasources on startup. This/bad error handling was the issue in my case.


1

risks for SQL injection everywhere That's your chance. Exploit this and show your boss, how easy it is for any stranger to read the whole database, including your boss's password. Then ask him, on how many web sites he personally uses the same password. After he answered this, it's time to explain, what salted hashes in your web app can do for his ...


-1

If you're dead set on being able to recover "the" password, I'd be tempted to try and give your users a tiny amount of security by hashing the passwords in such a way as to make it trivial to create a password that hashes to the same value without necessarily being the same password. (Remember, a high percentage of your users will be using the same password ...


0

If you want a request sent after a confirmation dialog is shown it's up to you, via client code, to do that. The browser will not take any initiatives for you there. On its own it only can tell it must send a request when a form is submitted, a link is clicked or a new address or search query is submitted. That's it. Other than that, it never knows. So the ...


0

IIS has an annoying (sometimes) feature for low traffic websites. It recycles unused worker processes – which cause the first user to the site; sometimes extremely long delay (30+ seconds). http://dotnettimes.wordpress.com/2014/03/24/fixing-slow-initial-load-for-iis-web-site/


1

Monitoring is a tricky solution to get right for sure -- one solution just doesn't cut it, especially in the world of public facing web apps where many things can go wrong externally that are just as bad as someone clicking a 500. This is what we do: real time ASP.NET health monitoring alerts that catch internal exceptions (your http 500 scenario); an ...



Top 50 recent answers are included