Tuesday, April 13, 2010

Creating an MSDN OpenSearch connector for Windows 7

Scott Hanselman recently posted about a OpenSearch provider for MSDN so you can search the MSDN Library directly from within Windows itself. I couldn't see and reference to this provider, but it doesn't look too difficult to put together.

There is an osdx definition here for MSDN.

There are instruction here for installing the search connector into Windows 7.

Monday, April 12, 2010

Forums that discourage answers to older questions

I recently ran into an issue setting relative URLs in a UserControl that is used in several locations. I could think of several ways that could resolve the issue through explicit coding but was keen to find a solution that didn't require the user control to know about the page it was used on.

Naturally I did some Googling to see if someone had already found a solution. There was an almost identical post on the ASP.NET forums about the issue but no one had found an acceptable solution. I did some more searching and came across a possible solution which I posted back to the ASP.NET forums for the next person to find.

A couple of days later I was surprised to get a message back from the forums that my post had been deleted as it was an old thread (June 2008) and "there is no value in reviving it".

Fair enough, it's their forum and they can set whatever rules they want. The user who deleted it was much more active on the forum than I am so I'll defer to their judgement.

Still, it's unfortunate that the next person to come across the thread won't have direct access to the possible solution that I found. As a forum they don't really focus on answering questions, but rather having discussions they will ultimately be closed off after a certain period of time.

Taking that into account I posted the same question to a more appropriate site.

---------- Forwarded message ----------
From: ASP.NET Forums - Automated Email 
Date: Mon, Apr 12, 2010 at 9:05 AM
Subject: (ASP.NET Forums) Post Deleted: Re: relative url in hyperlinkfield
To: [myemailaddress]



Your post was deleted by [A forum user with a high level of Recognition].

Subject: Re: relative url in hyperlinkfield

Reason: Hello,

You attempted to submit the following post to the ASP.NET Forums:
________________________________________________________

Using Control.AppRelativeTemplateSourceDirectory you can change the URL that is used
to resolve a relative URL. You can use this to change how Case 2 resolves to a URL.
E.g. AppRelativeTemplateSourceDirectory = AppRelativeTemplateSourceDirectory.Replace("~/Controls/", "~/folder1/");
________________________________________________________

Your post was submitted as a reply to the following thread: http://forums.asp.net/thread/2449283.aspx

The thread to which you have attempted to reply is a very old thread, and there is
no value in reviving it. As a consequence, the above post has not been approved.
Replying to very old threads (aka Necro-Posting) is discouraged on the forums as it
moves those old threads ahead of the sites more recent threads. We ask all members
who are offerring answers to please stick to the site's more recent threads.

Thanks,
ASP.NET Forums team

Tuesday, March 30, 2010

Salesforce - Using a Custom Link Button to pass Multi-Record Selection Id's to an external URL

My objective is to allow the user to select Leads from a view using the check-boxes and then pass the Id's of these leads to a third party site.

The GETRECORDIDS(object_type) function is the key part but I can't get it to work in a URL. See GetRecordIds() with a custom button

So far the best solution I've found is to use Javascript (where GETRECORDIDS does work) with the custom link button to pass the Id's to a Visualforce page that uses a Custom Controller. The custom control reads the id's from the query string and then passes them on to an iframe in the visual force page.

See also: List Buttons with VisualForce

Tuesday, March 23, 2010

Salesforce API Calls Made Within Last 7 Days Report

Just received an email notification along the lines of:

Subject: Salesforce.com API usage exceeded threshold of 25% This is an automated notification sent to you at your request by salesforce.com. Your organization has made 1251 API calls within the last 24 hours. This is 25% of your organization's 24-hour API call limit of 5000 calls. You will receive this notice once every 24 hours until your organization's API usage drops below 25% of your 24-hour call limit (1250 calls). For more detail on your organization's API usage, please review the API Usage Report under the Reports tab. If you wish to review or change your notifications, the settings can be found in Setup under Administration Setup > Monitoring > View API Usage Notifications.

The report can be found here (you may need to change from the na5 server):
Reports > Administrative Reports > API Usage Last 7 Days

Thursday, March 18, 2010

Secure ASP.NET Session Cookies

How to check for insecure cookies

Install the Firecookie extension for Firebug so you can examine the cookie security settings.

Before

Set requireSSL to true.

  <system.web>
    <!-- ... -->
    <httpCookies requireSSL="true"/>
    <!-- ... -->
    <authentication mode="Forms">
      <forms name=".ASPXAUTH"
      loginUrl="~/Login.aspx"
      defaultUrl="~/Default.aspx"
      protection="All"
      timeout="30"
      path="/"
      requireSSL="true"
      slidingExpiration="true"
      cookieless="UseCookies"
      enableCrossAppRedirects="false" />
    </authentication>
    <!-- ... -->
  </system.web>

After

See Also:

Wednesday, March 17, 2010

Moving the ASP.NET Global.asax code from a script tag to a class

Global.asax

<%@ Application Language="C#" Inherits="Global" %>

Global.asax.cs

public class Global : System.Web.HttpApplication
    {

        void Application_Start(object sender, EventArgs e)
        {
                //...
        }
    }

See Also: