Sebastian Wojciechowski’s WebLog

.NET Developer

Archive for the '.NET' Category

Recently I have been asked this question. Answer is that it cannot be null and will not be null, so you don’t have to:
.Text != null
Why? Because .Text property in base class does:
set
{
if (value == null)
[…]

Read Full Post »

I recently had this problem. I have a Windows Form that hosts a WebBrowser control. The page in the WebBrowser control closes itself using window.close and when it does that the Windows Form freezes up.
Found a solution here posted by Jeff Sanders on his blog (thanks man!)
The sample code is provided in VB.NET Below is […]

Read Full Post »

If you have this error and  you did all of those things:

reinstalled DLLs,
checked custom aspx if they reference any misspelled DLLs, 
removed one by one all the custom solutions,
ran the “SharePoint Products and Technologies Configuration Wizard”,
thought “Let’s go for a lunch and then reinstall this machine”

Check the web.config Best thing would be to take it from […]

Read Full Post »

If you set up HeaderImageUrl property in HyperLinkColumn, the text from HeaderText will not be shown.
Take this code for example:
<asp:HyperLinkColumn DataTextField=”urn:schemas-microsoft-com:office:office#Author”
DataNavigateUrlField=”urn:schemas-microsoft-com:office:office#Author”
DataNavigateUrlFormatString=”/MySite/Public.aspx?user={0}”
HeaderText=”Author” HeaderImageUrl=”/_layouts/images/imnhdr.gif”>
The “Author” text will not be shown in this column’s header. Only the icon will be visible. Well there is a simple way to solve
this:
<asp:HyperLinkColumn DataTextField=”urn:schemas-microsoft-com:office:office#Author”
DataNavigateUrlField=”urn:schemas-microsoft-com:office:office#Author”
DataNavigateUrlFormatString=”/MySite/Public.aspx?user={0}”
HeaderText=”<img src=’/_layouts/images/imnhdr.gif’/>Author”>
hey, it works

Read Full Post »

For SharePoint developers working with URL is a crucial thing. So probably many of us noticed that BasePath property of Uri class is private. Maybe it is something like property in .NET 1.0 (example in “Framework Designing Guidelines”) but I don’t think so.
So, how we can solve this? Well, in a SharePoint context I think […]

Read Full Post »

Are you tired of deploying applications with a millions of dll files?
for ex. Something.XML.dll, Something.DAL.dll, SomeControl.Something.dll
Now (well since 16 March 2005) you can merge those files into one single assembly and deploy just one file!
It is freely available for use from this page from “Other Tools & Utilities” section.
Best fo all - its license does […]

Read Full Post »

Convert.ToString() or Int32.ToString()?

Have you ever wondered if there is a performance difference between Convert.ToString() or Int32.ToString()? Yeah, me too.
Here is the answer.

Read Full Post »