Blog Home  Home Feed your aggregator (RSS 2.0)  
My DasBlog! - Thursday, April 28, 2005
newtelligence powered
 
# Thursday, April 28, 2005

I expect that there are a lot of people who already wrote some knowlegde article about this. But it never hurts to explain it again. When you use Response.Transmitfile for transmitting a file to the client it gets the name of the current aspx file.

So how do you set the default name of the file which is downloaded to the client? It is actually very easy. The following code downloads a word file "rapport.doc" to the client:

string pathFileName = @"c:\documents\rapport.doc";
string fileName = System.IO.Path.GetFileName(pathFileName);

Response.ContentType = "application/msword";
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
Response.TransmitFile(pathFileName);

Thursday, April 28, 2005 3:41:31 PM (GMT Daylight Time, UTC+01:00)  #    Comments [3]   ASP.NET | C#  | 
# Saturday, April 23, 2005
I like to use singletons in my applications, especially when i don't want to initialise a class all the time when i need it. The idea behind a singleton class is to get an instance by calling a static member method and not be able to instantiate the class yourself. In that way there will only be one instance of the class during the run of the application...
Saturday, April 23, 2005 5:20:55 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   ASP.NET | C#  | 
# Friday, April 22, 2005

Mart Muller wrote a great tip about creating alerts programatically:

In some cases you want a user to automatically create alerts on particular lists, for example an action list. It's very easy to achieve that:

SPWeb thisWeb = SPControl.GetContextWeb(Context);
thisWeb.AllowUnsafeUpdates = true;
SPList myList = thisWeb.Lists["ListName"];

// in this case a daily alert on all list actions
thisWeb.CurrentUser.Alerts.Add( myList,SPEventType.All,SPAlertFrequency.Daily);
thisWeb.CurrentUser.Update();

The same way, alerts can be added for list items.

Friday, April 22, 2005 12:51:24 PM (GMT Daylight Time, UTC+01:00)  #    Comments [2]   SharePoint  | 
Some weeks ago i wrote an article about creating a birthday webpart. The problem with that webpart is that the list every time has to be updated to refresh the coming birthdays. This is an example of a custom webpart which retrieves its information from a ContactList...


The BirthDay WebPart version 1 is now downloadable. Follow the link:

TamTam_BirthDay_WebPart.msi (132 KB)
Friday, April 22, 2005 11:49:49 AM (GMT Daylight Time, UTC+01:00)  #    Comments [10]   SharePoint  | 
A SPQuery can be used to retrieve some SPListItems from a SPListItemCollection. The following code is an example which shows how to do a DateTime comparison. It is very important to use a correct date format as the value in the inner xml of the where clause...
Friday, April 22, 2005 11:31:09 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SharePoint  | 
# Thursday, April 21, 2005
I needed some tool to look for keywords, texts or other things by searching through all fields of all columns of all tables of a specific database.
Thursday, April 21, 2005 1:28:42 PM (GMT Daylight Time, UTC+01:00)  #    Comments [1]   SQL Server  | 
# Tuesday, April 12, 2005
I got a request from the customer to change the background color of a WSS / Portal page depending on the login rights. This example delivers an example which will do this. But the same example can be used to override any other style defined in SPS.css and OWS.css.
Tuesday, April 12, 2005 1:30:00 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   C# | SharePoint  | 
As we know every database is build from two files on disk. The first file contains all data and the second file contains the log of the database. The log file grows and grows and grows...
Tuesday, April 12, 2005 6:58:14 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Databases  | 
# Tuesday, April 05, 2005

I like to write all my code in C# and therefore i sometimes have to rewrite some examples written in VB.NET. This website is a quick reference guide to highlight some key syntactical differences between VB.NET and C#. Thanks to Tom Shelton, Fergus Cooney and others.

http://www.harding.edu/USER/fmccown/WWW/vbnet_csharp_comparison.html

 

Tuesday, April 05, 2005 8:37:04 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   .NET | C#  | 
# Monday, April 04, 2005
I was looking for a solution to remove the link "my site" from the top banner. After googling i found the following solution by Mark Beecham at Ted's SharePoint blog...
Monday, April 04, 2005 7:42:20 AM (GMT Daylight Time, UTC+01:00)  #    Comments [1]   SharePoint  | 
Copyright © 2012 Alexander Meijers. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: