.NET
It turns out that creating a custom server control that uses dynamic
controls (controls added at runtime) is a huge pain in the ass. Add to
that INamingContainer, which is virtually a necessity when making a
composite control (it lets you have more than one copy of the server
control on the page by guaranteeing that the child controls have unique
id's) completely screws around with control's life-cycle, and you have
one frustrated developer..
It's taken me entirely too long to create my data-paging server
control, which simply creates the buttons you need to page through data
(First, Prev, 1, 2, 3, Next, Last - etc) and provides an...
Brendan Tompkins has written up some instructions on how to modify your .Text 0.95 to use FreeTextBox 3.0.
I'll have to check it out and see how it differs from my implementation (which probably isn't the greatest).
Brad Abrams has given us a taste of Microsoft by showing us their
internal coding guidelines. There are some interesting things, and
overall it answers a lot of questions that new developers my face. For
the record here are my personal coding habits, which by default are my
companies coding standards.
namespace Company.Product.Component {
public class Test {
private int _myInt;
private string _myString;
public int MyInt {
get { return _myInt; }
set {
_myInt = value; }
}
public string MyString {
get { return _myString; }
set {
_myString = value; }
}
public
Test() {
}
public void...
Since I switched over to Firefox a couple of months ago, it's been more
and more painful to switch back to IE just to get the nice FreeTextBox
controls to update my blog. FreeTextBox (irononically not entirely free
anymore) has supported non-IE browsers for a while now, but .Text was
built against an early version. So I grabbed the source code for .Text 0.95 from gotdotnet, which is the last version publically released from Scott Watermasysk, since he rolled .Text into Telligent Systems' Community Server
(which has a lot more features, but may or may not have a more restrictive liscense, which is
perhaps why so...
I posted this Visual Studio error the other day, which shows up when you uninstall a VS add-in that tries to take a few critical dll's with it (which seems to be about half of the add-ins I've tried). Pete Davis explains what to you can do to try to fix this problem, without reinstalling all of Visual Studio.
I should point out one minor difference I noticed. In my copy of Visual Studio 2003, extensibility.dll and VSLangProj.dll were both located in C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\PublicAssemblies rather than C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\.
...Please stop. Now. I'm really tired of dealing with
when I uninstall your crappy add-in.
Thanks.
Thanks to my new phone I am now a web surfing fool (or perhaps just a regular fool). However I've had one problem... I can't surf Amazon.com too well. While I occasionaly shop at Amazon.com I usually perfer to use it as a research tool too look up reviews of products I'm interested in, or just sometimes price compare. But I've not had much luck so far on my phone. The main site is too design heavy and slow to be practical on a phone. The PDA version doesn't render correctly on mobile explorer for some reason and the phone version is just way to limited and doesn't...
Though it is available as part of Windows XP service Pack 2 Reail CD, you can download the Microsoft Framework 1.1 Service Pack 1 separately if you are so inclined.
Thanks again Scott.
Ian Griffiths points out that Microsoft is planning on releasing their new gui code-named Avalon along with the rest of WinFX to Windows XP and Windows 2003 users.
I find it an odd strategy by Microsoft since those are the core elements of what makes Longhorn interesting to me as a user and a developer. But the faster these new technologies spread the sooner I can use and develop for them.
Scott Hanselman posted a tip he found on Developer.com on how to set the default button to trigger when hitting the enter key on a web form:
Imagine you've created an ASP.NET Web page with a search button. The user taps a phrase into a text box and presses Enter. On most regular Web pages (think: Google), the form would be submitted and the results returned. In other words, the search button is automatically "clicked" for you.
However on an ASP.NET Web page, pressing Enter resubmits the form to the server, but actually does nothing... which is pretty useless, really.
So, how do you set...
Holy crap! Microsoft has put out public beta's of the Whidbey IDE in the form of several smaller packages called Express Editions. This could be great for those of us who don't have MSDN accounts (yet) and haven't been exposed to Whidbey directly.
You have to jump through a few hoops to get them (Passport account and a survey), but they are otherwise free for now.
I'm downloading them now, I'll post my impressions later.
I have a asp.net page that allows a user to upload a file. In order to guarantee a user can't overwrite another user's file that happens to be named the same I rename the files as I upload them to be unique (for instance SessionId + DateTime.Ticks). On another page, users get a link to the file for download. Having a unqiqeuly named file may be conveinent for the server, but it's not very good for the user so I had to come up with a way to return the file to the browser with the original file name. I...
Kudzu (Chad Z.) has some really thoughtful things to say regarding software and piracy. He says what I have felt for a long time, but does it much better than I could.
As software developers, piracy is something that affects us all. If you are a software developer that works for a big company, you do not see it directly but you still have an interest in who is using your company's software. If you are in small company or a developer who sells software, piracy hits a bit closer to home.
However the conventional wisdom, which often equates to the "knee jerk" reaction, is not...
I just found out that you can CTRL-ALT-BREAK to go full screen when connecting to a computer using Remote Desktop Connection in Windows XP. Thats always been a pet peeve of mine since maximizing the window goes full screen when connecting to a computer that is running Terminal Services. I figured they took it out for some reason, but it turns out they just buried the command - just a little too deeply if you ask me.
Edit: I guess you could just do options->display->full screen, but who checks there anyway? Besides, whatever happened to good ol' ALT-ENTER?
Paschal L posts about adding CSS2 Intellisense support into Visual Studio .Net.
Alex Papadimoulis
wrote a cool little vs
addin called "Smart Paster" that gives you some great pasting options.
Definatly worth checking out.
I missed this from a few days ago, but Gaston Milano packaged up a few new features from Whidbey and made them available for Visual Stuido. NET 2003. Simple, but really cool stuff:
Close All but this ( Close all document windows but this)
Copy Full Path ( Copy the full path of the active document to the clipboard )
Show File In Explorer
I found this via Sanjay's Coding Tips
Mikhail Arkhipov details, once again explains why the existing Visual Studio html formatting bug cannot be fixed (or why Microsoft doesn't want to bother).
I'm sorry, but I'm not drinking the Koo-laid. Yes, there are valid reasons for the terrible formatting behavior, but COME ON. It's a bug that's been around for at least 3 products! And it's not just some annoying little bug, it's a productivity killing bug that mangles code and prevents us from using many features the html designer provides. I haven't dragged and dropped a single thing onto a web page in a year because it will reformat...
Earlier this week I was fortunate enough to get a day off of work to attend the Microsoft Security Summit in St. Louis, MO. It was my first technical convention, though I don't know if it really counts since it was only a day and free, but hey, it was good to see that St. Louis has some other developers. I often feel rather isolated at my company since I'm currently the only developer.
If you've never been to one of these events, you start off with a keynote speech, where they announced the new Microsoft Update, which will replace Windows Update...
Dan Crevier points out that you can now script to iTunes via a COM interface (on windows) and provides some examples. Maybe now someone will write a winamp-like hotkeys system (if there isn't one already), or maybe I'll write one sometime. Pretty cool stuff.
Josh Ledgard also brings up the Visual Studio.Net loading problems that I mentioned earlier. In addition to the earlier tips, he also recommends disabling anti-virus software to see if that's the culprit. Incidentally, he is also the author of the VSTweak Powertoy. Cool stuff.
When learning about Object Oriented programming in .net and specifically C#, we are taught to always use public properties with accessors to expose a particular variable:
private string _myVar;public string MyVar{ get { return _myVar; } set { _myVar = value; }}
Which is normally the beginning and the end of the conversation. However, you can also use accessors (getters/setters) to encapsulate complex or receptive logic for private variables as well. This is especially useful in ASP.NET programming where you often have to deal with state management. For example to retrieve a value from the QueryString you would write something like:
int myVar;
if...
I've been dealing with a very slow loading Visual Studio.Net for a while now, which has been driving me nuts since vs.net loads instantly on my laptop, which is slower than my development machine. I've even reinstalled and nothing worked, but I finally came across the answer to my woes thanks to Alex Chang who provides the solution. Basically vs.net keeps a Most Recently Used list of opened files/projects and if one of those is on a network share or removed it can cause vs.net to load very slowly. I used VSTweak to clear my MRU list and it worked like a charm (although I...
The calendar control, while useful has one undesirable behavior: it re-hides when changing the visible month. Fortunatly it's an easy fix using the calendar's VisibleMonthChanged event handler. If you have visual studio you can click on the calendar in design view, the click on the 'Events' (lightning bolt) icon and double click on 'VisibleMonthChanged' under 'Action' or add the following line to the InitializeComponent() method in CalendarPopup.ascx.cs :
this.calendar.VisibleMonthChanged += new MonthChangedEventHandler(this.calendar_VisibleMonthChanged);
To make the calendar remain visible after the postback, we need to set it's display attribute to auto (a blank attribute will work as well):
private void calendar_VisibleMonthChanged(object sender, MonthChangedEventArgs e) {
calendarDiv.Style.Add("display", "auto");
}
Now the...
I came across this cool little article on creating a dropdown calendar control recently. It basically uses dhtml to popup an asp.net calendar control when you need it, rather than opening up a new window. While it's useful, it's dhtml is IE specific, so I made a few quick changes and came up with:
CalendarControl.ascx:
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="CalendarControl.ascx.cs"
Inherits="CalendarControl.CalendarControl" %>
<asp:textbox runat="server" id="calendarDateBox" />
<input type="button" value="..." onclick="<%=calendarDiv.ClientID%>_ToggleCalendar()">
<div runat="server" id="calendarDiv" style="display:none;position:absolute;">
<asp:Calendar backcolor="#ffffff" id="calendar" runat="server"></asp:Calendar>
</div>
<script language="javascript">
function <%=calendarDiv.ClientID%>_ToggleCalendar(){ var cal = document.getElementById('<%=calendarDiv.ClientID%>'); if ( cal.style.display == "none") { cal.style.display = ""; } else { cal.style.display = "none"; ...
I'm pretty particular when it comes to how visual studio (vs) handles my project files so how it handles asp.net irks me to no end, but with a little extra work and a few tried and true tricks you can have things your way. These tricks have been around a while, but if you missed them the first time around, here's another chance. I like having my project files all in one place, it just makes it easier to copy or backup projects (not to mention source control). however, by default vs will create the solution files in one place and the web...
Hello, my name is Michael Cook and I'm am currently an asp.net developer in St. Louis for a company called Mozaic Ltd. I've been lurking on the Internet for quite some time now, and after a few half-hearted attempts, I figured it was about time to really get something going. So welcome to my little corner of the web.
My blog will be mostly tech oriented, but I'll try to spice things up with a little personal gossip from time to time. If you don't like it (or like it more than anything else), you can use the category links on the left to filter...