Archive

Archive for October, 2009

How To Generate a Fully Qualified URL in ASP.NET from Scott Mitchell

October 29th, 2009 No comments

Used this today, I was using an app config var in web.config to hold the fully qualified base URL for the application, but this blog by Scott Mitchell is a much cleaner and easier to maintain solution!

TIP: How To Generate a Fully Qualified URL in ASP.NET (E.g., http://www.yourserver.com/folder/file.aspx)

Imagine that you’ve got an ASP.NET page that is generating an email message that needs to include links back to the website. Perhaps you’re writing the next greatest online message board application and when someone replies to a thread you want to send out emails to the other thread participants indicating that a new message has been posted along with a link to view the just-posted message. You know that the URL to view a particular thread is, say, ~/Threads/View.aspx?ThreadId=threadId. But how do you turn that relative URL into an absolute URL like http://www.yourserver.com/Threads/View.aspx?ThreadId=threadId?

via Scott on Writing.

Tags:

How to include comments on WordPress Index.php Page

October 24th, 2009 No comments

I wanted comments to appear on this blog right after the post.

I thought I could just add: <?php comments_template();  ?> but I was wrong.

The correct syntax is:

<?php
$withcomments = 1;
comments_template();
?>

Also, after embedding the comments in the index page, I removed all the tabindex properties
from the comments form, because otherwise when the comments form is repeated, the tabbing
gets out of whack.

I embed it right after the <div class=”post”> tag.

Here’s a screen shot of the result:

Comments on Index Page

<?php

$withcomments

= 1;

comments_template();

?

Tags: ,

Test I.E. 6.0 against the Visual Studio ASP.NET Development Server

October 19th, 2009 No comments

I learned about this from Jim Wilson’s blog post www.pluralsight.com where he was trying to connect an iPhone to the Visual Studio ASP.NET Development Server.

I use the same technique he uses to fire up a virtual machine and test my site in IE 6.0.  He used the Microsoft Soap Toolkit 3.0 simply called “Trace Utility”. You can download the toolkit from here.

With that, you now have port-forwarding in place. Now on your device, enter the URL using the Trace Utility listen port, 8080, like this.

http://192.168.1.100:8080/MyWebSite/Default.aspx

See his site for more detailed instructions:

via Accessing the Visual Studio ASP.NET Development Server from iPhone – You Can Take it With You – Pluralsight Blogs .

jQuery 1.2 Cheat Sheet :: www.gscottolson.com/weblog/

October 18th, 2009 No comments

Another must have for JQuery development.  Used this today to verify that JQuery has a siblings function for finding dom elements.

Very Nice!  Thank you G. Scott Olson for creating it!  Also first heard about it from David Ward on the Polymorphic Podcast.

jQuery 1.2 Cheat Sheet

I’ve been looking for a solid cheat sheet ever since I started using jQuery. Download jQuery 1.2 Cheat Sheet v1.0 in PDF format

via jQuery 1.2 Cheat Sheet :: www.gscottolson.com/weblog/.

Tags:

Introducing SelectorGadget: point and click CSS selectors

October 17th, 2009 No comments

Selecting Nth Child

I installed this bookmarklet a while back after hearing about it on the polymorphic podcast from Dave Ward:  http://encosia.com/

I haven’t found it very useful until today.   This screenshot should some up how I used it:

I need a jquey selector to enable me to select the Contact (3rd) DropDown box.

First I clicked the 2 Contact Boxes making them green, then I removed the selection form the Filter By Role DropDown,

and SelectorGadget told me I needed to use the “select:nth-child(3) to get the Contact’s DropDown!  Very cool!

SelectorGadget is an open source bookmarklet that makes CSS selector generation and discovery on complicated sites a breeze.

via Introducing SelectorGadget: point and click CSS selectors.

Tags: ,

.Net SQL Client SQL Server Profiler Template

October 14th, 2009 No comments

I stumbled upon this template and it’s pretty sweet.
Filters out all request except those made by the .net sqlclient, and also
keeps it from displaying polling messages if you have sql cache dependencies enabled for you application: 

ScreenShot of Text Filter

 

Download DotNet Sql Client SQL Profiler Template File

Tags: ,

Explained: Forms Authentication in ASP.NET 2.0

October 13th, 2009 No comments

I needed to know this early today because I’m writing an auto-login
routine for our portal.  It’s good to know what the default values are and what they mean,
so I’m including this here as a quick reference for the future:

The default attribute values for forms authentication are shown in the following configuration-file fragment.

<system.web>
  <authentication mode="Forms">
    <forms loginUrl="Login.aspx"
           protection="All"
           timeout="30"
           name=".ASPXAUTH"
           path="/"
           requireSSL="false"
           slidingExpiration="true"
           defaultUrl="default.aspx"
           cookieless="UseDeviceProfile"
           enableCrossAppRedirects="false" />
  </authentication>
</system.web>

via Explained: Forms Authentication in ASP.NET 2.0 .

ASP.NET Cookies Overview

October 13th, 2009 No comments

I didn’t know most browsers only allow 20 cookies per site!

Browsers also impose limitations on how many cookies your site can store on the user’s computer. Most browsers allow only 20 cookies per site; if you try to store more, the oldest cookies are discarded. Some browsers also put an absolute limit, usually 300, on the number of cookies they will accept from all sites combined.

via ASP.NET Cookies Overview .

Tags: ,