Wednesday, November 4, 2009

Publish Failed - No Errors?

Hi All

I have run a across this a few times in the past and it drove me crazy:

Ever Build – The build succeeds, then when you Publish, you get “Publish Failed” but you don’t see any errors as to why? (it happens so few and far between – usually it’s a missing file / dll)

I found this on the web…

http://forums.asp.net/p/1248620/2478095.aspx

Try opening your Output Window in VS2005 or 2008 THEN publishing. It will display the errors that are stopping you from Publishing.

GMWEBDEV was full and VS2005 was unable to publish to it but I was not seeing that error in the Error List – It was only displayed in the Output Window.

Wednesday, September 2, 2009

Hi all,
I found something useful for a change and thought I'd share. :) While trying to check the accuracy of a specific origin path of a file to be uploaded to a destination directory from a web page I found that some newer browsers handle this a bit differently. For example, if the user browses to the file C:\Docs\myfile.doc on their machine from a web page, from an input box with type "file", the .value property of the input box in the C# code will return C:\fakepath\myfile.doc in IE8 and some other newer browsers. This MSDN article tells you how to get around that, only it is up to the user to do so by manually changing a security setting in IE8.

Since I can control the browser type and settings of the users for this project it's no big deal. But unless someone can find a way to read the entire file path in IE8, all you can call is the file name via the code. I'm sure this isn't going to be a common occurance, but I thought it was worth noting.

Another example:
I have this code...

if (File1.Value != @"C:\KneeOA\Back_End\KneeOA_Back_End.mdb")

...which is checking the path of the file to be uploaded because it has to be very specific for this project. IE8 only returns "KneeOA_Back_End.mdb" for "File1.Value" which is not really helpful. IE7 and earlier do return the whole path and therefore can check it for accuracy without having to change an IE security setting.

Thursday, August 20, 2009

Page_LoadComplete

I have a page with a user control that has a dropdownlist for date. When the user control loads for the first time, I populate the year options using one of our toolbox methods. When the webform (the user control's host) loads for the first time, I also look in a database to see if there is a date stored that I should use to populate the date field. However, this latter thing was failing on the year field. Eventually I determined it is because the code to load the date from a database was running before the year field had any options - before the user control was fully loaded in other words.

I found these 2 articles that discuss the order of the page lifecycle, and list the lifecycle events:

ASP.NET Page Life Cycle Overview

Page Events in ASP.Net 2.0

I decided to use the LoadComplete() event, which also lets you test for PostBack, which I needed since I only wanted the databinding for the date to happen on first page load.

Just thought I'd mention this in case anyone else ever runs into a similar issue, and also to see whether anyone thinks a different event would have been better to hook into, like maybe Pag_PreRender.

Tuesday, August 18, 2009

Ever to find the table where a column is hiding in a giant DB?

I've been doing alot of this lately, being new to the CTSI db and such.

use this syntax, where 'yourcol' is the known column:

Select table_name from information_Schema.columns where column_name='yourCol'

or you can do a "like", like this:

Select table_name from information_Schema.columns where column_name like '%yourCol%'

Monday, August 17, 2009

accessing a control in a repeater's headertemplate or footertemplate

If you are trying to FindControl on the repeater's ItemDataBound or ItemCreated event it's pretty easy. However I needed to access a control from the repeater's PreRender event. This is when I discovered that "Only items bound to the data source are contained in the Items collection. The header, footer, and separator are not included in the collection." (from MSDN).

Therefore I had to use a line like this which apparently works because "all child controls must exist inside the Controls collection" ("In Search of ASP.NET Controls", from odetocode.com)


HtmlTableRow tr = (HtmlTableRow)rptIncomplForms.Controls[0].Controls[0].FindControl("trFoot");

Wednesday, August 12, 2009

adobe BrowserLab

After reading Layla's blog post earlier this week I spoke with a friend and he turned me on to Adobe BrowserLab. BrowserLab is a hosted web service that provides snapshots of your web site in multiple browsers. It is currently in a limited free preview for people to try out from adobe.com. The best part about ABL is that it can be integrated with Adobe Dreamweaver CS4. All you have to do is go to the link below and download two extensions from the site. You will also need to create an adobe account but its free and their really isn't much information required. Plus by creating an account you will get emails about more products like browserland. So try it out!

https://browserlab.adobe.com/index.html#

jk

Monday, August 10, 2009

mutliple IEs - a follow up

Frustrated by the fact that I still was not getting the standalone ie6 to work following the article I mentioned in this post, I did more digging and eventually unearthed this: http://finalbuilds.edskes.net/iecollection.htm Why was this so hard to find? Beats me. But I have installed it and so far it seems to be working. Right now I have IE8 as my 'real' browser and standalones of the rest. Note that the instructions caution you not to have IE as your default browser. As if!!!

It will install 2 different IE6s (actually it will install what you select, from like IE1 on, although IE1 wasn't compatible with my OD nor did I want it.) Turns out that one is the IE6 from XPSP1 and the other is SP2. If I had realized ahead of time I'm not sure I would have bothered with the first one.