Archive for 'Code'

Preventing a LinkButton from Posting Twice During a Double Click

Apperently, you can’t count on the users not double-clicking on a link. I found this during a Google search and it seems to be working fine. protected void Page_Load(object sender, EventArgs e) { this.LinkButton1.Attributes.Add("onclick", "this.disabled=true;" + ClientScript.GetPostBackEventReference(this.LinkButton1, "")); } This disabled the link on the first click, then postbacks the form via the __doPostBack Javascript [...]

When Environment.CurrentDirectory Isn’t

I have been using Environment.CurrentDirectory for years as a way to programatically access the folder the application is running out of.  In most cases, I was just displaying this information somewhere, or maybe defaulting a Save or Open File Dialog box. I my current project however, I wanted to Process.Start a batch file residing in [...]

Batch Files Revisited

The network at my company is locked down pretty tight, (I would say waaaaay too tight) so I am not able to do certain things like connect to CodePlex via Team Client or Subversion. Normally not a big deal, except that I am working on BookShelf during my lunch break (when I take a lunch [...]