More often than not when you are having problems with your newly built ASP.NET website or solution, the problem can be fixed by a simple rebuild.
To rebuild you solution just go into the build menu and choose rebuild. this can fix problems you may be having in your development envrionment as well as in your finished application.
So if something is not acting how you think it should, try a rebuild.
Monday, 17 August 2009
Rebuilding your ASP.NET soltuion
Sunday, 16 August 2009
GAC
GAC what do you mean GAC?
The GAC or Global Assebly Cache is the playground of anything .NET it is not language specific so whether you are a VB or C# bod your code used the GAC.
Put simply the GAC is where all the framework and links is stored for anything .NET, this is the reason why you build your website, to assemble all the bits into and from the GAC into the necessary .NET structure.
For example when you add an element to your page using the toolbox Visual Studio puts the necessary connections into the GAC to allow your Visual Studio UI to know about the control.
So if you have anytime not been able to see your control in the code side of Visual Studio, first try a rebuild and if that fails delete it from the source code and readd it using the Toolbox.
ASP.NET Buttons Not Firing
When adding a button to your asp.net website or application it is always best to add the button using the toolbox. The main reason for this that the GAC, as all .NET stuff lives and links in here. By using the toolbox Visual Studio will add all the necessary hidden code stuff to make the Visual Studio UI aware of your button. In fact this goes for any UI control.
Please do this an you will save yourself a ton of wasted time and unnecessary use of the FindControl code.
One other thing to remember is that ASP.NET is a validated language, and expects all elements to have some kind of processing. So remember that when you add your ASP.NET button to your page, you must include the following attributes for it to work. runat, id and CausesValidation.
So your new asp.net button would look like
Remember this simple rule and you should have no more button problems.
"ALWAYS ADD CAUSESVALIDATION TO YOUR ASP.NET BUTTON" even if it is set to false.


