Sep 9

Blame it on those dumb hidden fields:

<input type="text" name="__spDummyText1" style="display:none;" size=1/> <input type="text" name="__spDummyText2" style="display:none;" size=1/>

Place them between

and after “PlaceHolderMain”.

I spent hours trying to figure out the cause of this on Firefox, even tried writing some custom JS but in the end all i needed to do was include these in my master page!

Jul 9

I recently had to work with Akamai Secure Flash Sreaming for on-demand videos and wanted to share some notes on how we got this to work.

You’ll need 2 zip files from Akamai:

  1. Akamai Flash Media Kit
  2. Akamai Secure Token Generator

Inside the Akmai Flash Media Kit you will have to open CS3SampleOnDemand.fla in Flash and edit the ActionScript. First declare a constant for the token:

CONNECTION_AUTH_PARAMS=”THEVALUEFROMYOURFLASHVARS_TOKEN”;

Then you will pass the autorization token to the Akamai object like this:

ak.authParams = CONNECTION_AUTH_PARAMS;

I also have a DLL with using the Type D Authentication from Akamai, please email me if you need it.

Jul 1

Sometimes some projects visually hide the SharePoint navigation links so I wanted to list some here because I can never remember them:

  • Site Content and Structure - sitemanager.aspx
    All Site Content - viewlsts.aspx
    Site Content Type Gallery - mngctype.aspx
    Site Features - ManageFeatures.aspx
  • More to come…

    Jun 30

    It’s a small change, but I always forget how to do this so I’m blogging it! Locate the siteMapPath control in the Master Page and add a PathSeperator attribute shown in the example below:

    
    <asp:SiteMapPath ID="siteMapPath" Runat="server" SiteMapProvider="CurrentNavSiteMapProviderNoEncode" RenderCurrentNodeAsLink="false" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" PathSeparator=" / "/>
    
    

    Jan 21

    Everyone knows you can check traffic off of Google Maps built into your iPhone, but what if you don’t have 2 fingers available to pinch-out and see all the traffic conditions? My answer is the simple Traffic Checker (alpha) http://ragingminds.com/iphone/traffic which simply lists out traffic conditions within an area.

    Just something I whipped up real quick for fun, I need to add some error handling and the ability to search by “city” and/or “state”. It’s using Yahoo Traffic Webservice and the ASP.NET 2.0 XmlDataSource. Please feel free to use it and provide some helpful feedback for the next version!

    Mar 20

    Overview

    This example will explain how to use the Prototype.js Javascript library to perform a simple Ajax call from an html page to an ASP.NET page with dynamic info. In this example the dynamic ASP.NET page is getting the current date and time, in a real-world example an ASP.NET page could parse RSS feeds, show stocks quotes, lookup weather, etc.

    Requirements

    Let’s code!

    1. Create a web form called ShowTime.aspx (ShowTime.cs will be auto created) in Visual Studio 2005 and add a label control as shown below:
      <asp:label id="lblDateTime" runat="server" />
    2. Open up ShowTime.cs and declare a DateTime type variable and set it to display the current date and time:
      DateTime dtRightNow = DateTime.Now;
    3. Inside the Page_Load set the page to not cache itself with the following code:
      Response.CacheControl = "no-cache";
    4. Assign the current date and time to the lblDateTime control:
      this.lblDateTime.Text = String.Format("{0:d}", dtRightNow) + " @ " + String.Format("{0:T}", dtRightNow);
    5. Now let’s create ShowTime.html. This page will call the Prototype.js and contain some Javascript to make an Ajax call to ShowTime.aspx
    6. Between the <head></head> tags, reference the Prototype.js Javascript library like this: <script type="text/javascript" src="js/prototype.js" />.
    7. Now we will write the Javascript that uses Ajax.Updater from Prototype.js. Below is the code that declares the page containing the dynamic content and the element to output the data when the link is clicked (you could also include the snippet below in a seperate Javascript file).
      <script type="text/javascript">
              function clickShowTime() {
                  var url = "ShowTime.aspx";
                  var display = "output";
                  
                  $('showtimelink').onclick = function() { 
                      return ajax(url, display); 
                      };
                  }
              
              function ajax(url, display) {
                  new Ajax.Updater(display, url, {asynchronous:true, evalScripts:true});
                  return false;
                  }
                  
              window.onload = function() {
                  clickShowTime();
                  };
          </script>
    8. We’re almost done! Just need to ad add a few more things between the <body></body> tags. We will add a link with an ID called showtimelink and a <div> with the ID of output.
      <div><a href="#" id="showtimelink">Click this link to show current date & time</a></div>;
      <div id="output"></div>;
      
    9. That’s it! View the demo.

    Download

    Mar 20

    Log4net is part of the Apache Logging Services Project. It’s a tool to help ASP.net developers log message to a text file, xml file, email or database.

    1. Add log4net.Config.XmlConfigurator.Configure(); to Global.asax in the Application_Start method.
    2. In your code-behind or BasePage.cs, declare protected static readonly ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
    3. Web.config has all the magic. <configSection>, <log4net>, <appender> and <root>

    To be continued…

    Feb 12

    In this tutorial I will show how to write C# code that handles the FileUpload control. We will use the RegularExpressionValidator control for client-side validation and introduce server-side validation methods when uploading specific file types.

    coming soon…