hide show
Setting up Context.Rewrite for GoDaddy (Painful)
6/23/2009
Oh what a pain it was to get Context.Rewrite to work properly with GoDaddy. The problem is that GoDaddy returns the 404 page and response prior to the Application_BeginRequest is executed. I am not quite sure why, but that is what the behavior appears to be.

So to get around this, I had to parse the 404 string again before rewriting the new URL. Will probably need a line like the following:
new Uri(Request.Url.ToString().Substring(Request.Url.ToString().LastIndexOf(';') + 1)).PathAndQuery
How to Redirect WWW to non-WWW (C#, ASP.NET)
6/22/2009
Place the following code into your code-behind page, preferably your master page:

string Host = Request.Url.ToString().ToLower();

if (Host.IndexOf("http://www.") == 0)
{
  Host = Host.Replace("http://www.", "http://");
  Host = Host.Replace("/default.aspx", "/");
  Response.Status = "301 Moved Permanently";
  Response.AddHeader("Location", Host);
}
Meta Tag Description and Keywords
5/14/2009
Meta Tag Description is used by Google to provide the default summary description found in its organic search results. Thus it appears that Google does use the meta tag description in its page rank calculations. There is greater affect to page rank when terms in the description meta tag is also found within the content of the page. I have not found any evidence whether Google does include use the Keywords Meta Tag. Although nothing direct, I would assume that Google uses it in combination to the trust level of the site.

Site trust still appears to be the greatest contributor to site ranks. This can be seen by searching for "data" and see that Wikipedia is the top page. Checking the source, data only appears in the keywords. There are no links from external sites that point to this page. The only two major contributions would be the word density and site trust. Because other sites also have word density, site trust must be a great contributor.

Margin/space/line appearing below HTML image
5/5/2009
The reason the space appears is because the image is interpreted as an inline object. This means the image will be interpreted like text and so will cause that extra space. To correct the issue, modify the image as a block object.

Stylesheet:
<style text="text/css">
  img { display:block; }
</style>

Inline:
<img src="" style="display:block;" alt="" />
Adding relative css file to nested master page
5/2/2009
Add the following code:
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Attributes.Add("href", "~/__css/Main.css");
Page.Header.Controls.Add(link);

Separating Global ASAX to Separate File
4/21/2009
xerratus
This site contains a useful tutorial to separate code from global.asax. This enables the VWD to use its intellisense.
Akamai - Flash applications with config file
3/25/2009
With the Akamai module which automatically modifies links to the Akamai address, Flash applications cannot load the config file located on the web server due to cross domain security. Unfortunately, the third party is unable to make the modification to load relative to flash location so had to use the Flash stored on the web server.
Setting Adobe Flash Video Behind Dropdown
4/11/2009
Key is the params, setting wmode to transparent.

    <script type="text/javascript">
    var flashvars = {
     initialURL: escape(document.location)
    }
    var params = {};
    params.wmode = "transparent";


    swfobject.embedSWF(
     "FlashFile.swf",
     "header",
     width,
     height,
     "8.0.0",
     "expressInstall.swf",
     flashvars,
     params
    );
    </script>
4/1/2009
An error occurs when adding a database which causes the db to not be created. Web Developer Express requires SqlExpress isntance of SqlExpress 2005 to be installed to work. A different instance name will not work. You have to connect to the database by attaching to the database connections.
onpageindexchanging
3/31/2009
GridView1.PageIndex = e.NewPageIndex;
GridView1.DataBind();
Modify GridView Sorting Event for DataTable/DataSet
3/29/2009
When the GridView is bound to a DataSet (not bound to a database), the sorting and paging events are required when enabling GridView AllowSorting or AllowPaging. Otherwise, an error will be thrown: "The GridView 'GridView1' fired event PageIndexChanging which wasn't handled" or "The GridView 'GridView1' fired event Sorting which wasn't handled."

By default, the Event Arguments will only send an ascending sort direction. There is room for improvement here, but the method I chose to resolve this was by setting the DataTable's DefaultView Sort. I store the DataTable into Application or Session, and later recover the data in Page_Load. When handling the event, I change the sort direction stored within the object sender. To toggle the sort direction, I have created my own parsing logic to locate the column. I took it another step with the parsing logic by handling multiple columns so that it will handle multiple column sorts (eg Col1 DESC, Col2 DESC, Col3 ASC).
Background color for div within div
3/25/2009
When embedding a DIV within another DIV, the background color may not appear (in IE, not tested for other browsers). The resolution I found was to add the width size to the embedded DIV.
News
Coding
Press Release
Blog
Business Solutions
eMarketing
Data Integration
Careers
Data

© 2009 ID1337. All Rights Reserved.
ID1337 is a small business solutions provider specializing in digital marketing, internet marketing, and eMarketing.