Debugging in VC# Express 2008
September 17th, 2008Would you like to debug a windows service in Visual C# 2008 Express?
No fucking way – Microsoft removed all remote debugging features from Express edition. Shit :/
Would you like to debug a windows service in Visual C# 2008 Express?
No fucking way – Microsoft removed all remote debugging features from Express edition. Shit :/
Sometimes a programmer must do very weird things in his ASP.NET webapp. Among them, there is a postback initiated in custom javascript. Before .NET Framework 2.0, it was no good solution to achieve it. Fortunately it can be done without much effort nowadays.
There is an interface called IPostBackEventHandler which must be implemented by a page or a control. Then you must create javascript containing reference to postback function retrieved by ClientScriptManager.GetPostBackEventReference(...) method.
The sample web control's codebehind can look like below:
then we create javascript in aspx / ascx file:
Now, when a Test() function is called in a browser, our page will do a nice, clean postback
Every coder sometimes encounters a situation when a bug must be fixed. At the begining it looks for a very easy task... but the code reveals that it might be quite tricky
Here is one of most common antipattern - hardcoding mixed with magic numbers. Please fasten your seatbelts
Great feature of ASP.NET is that we are able to write a server control, pack it into assembly and use in many applications. However, it is quite hard to create one. On the other hand, user controls (ascx) are very easy to write but they're not so good to reuse because we must share our code.