Tuesday, May 31, 2011

Make IE7 open pop-ups in a new tab

Tabs are one of the best new features in Internet Explorer 7. I like them because they keep my task bar clean of extra Internet Explorer instances. The only problem I have is with pop-ups that are on my allow list such as when I write a new message in Outlook Web Access.

Follow these steps to configure Internet Explorer 7 to always open up pop-ups in a new tab instead of a new browser window:

1.While IE7 is running, click on Tools and select Internet Options.
2.On the General tab under the Tabs section hit Settings.
3.Under the When a pop-up is encountered section, select Always open pop-ups in a new tab. I also like using the Let Internet Explorer decide how pop-ups should open option because of some web sites I visit.
4.Hit OK and you are finished.


Display Images with IIS7 in Vista or Windows 2008

So, this may seem simple, but for an hour I wrestled with displaying images on IIS7 with vista. ASP.NET worked fine, but no static files, css, jpg’s, gif’s or anything. Just unformatted text.

Turns out when I added the web server in vista, I forgot to check the Static Content checkbox under World Wide Web Services / Common Http Features.

Hope this finds you if you are having the same problem.



















For other non-Vista users, here’s how you find that dialog:

Click Start -> Control Panel -> Programs and Features -> Turn Windows features on or off

Then drill down into IIS as shown in the image above.


Error code 2869 with Vista and Windows 2008

These are the steps to solve the above mentioned problems:

1) Copy the .MSI file to the root directory of your main hard drive (i.e. C:\).
2) Open Windows Notepad.
3) Copy this text into windows notepad:
msiexec /i C:\program_name.msi
(You can write the total path of your .msi file in the system, after msiexec /i.)
4) Replace the text "program_name" in the code that you copied with the actual name of the .MSI file.
5) Click File -> Save As...
Instead of saving it as a .txt file, change the file name to installer.bat.
Save the file to your desktop.
6) On your desktop, right click on the file and select Run as Administrator.


This will run the .msi file properly to install the application in the system.

Sunday, May 29, 2011

Gridview fixed header

<%@ Page Language="VB" AutoEventWireup="False"
EnableSessionState="true" EnableViewState="False" %&gt
<%@ Import Namespace="System.Data" %&gt
<%@ Import Namespace="System.Data.Odbc" %&gt
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt
<script language ="vbscript" runat ="server" &gt
</script&gt
<html xmlns="http://www.w3.org/1999/xhtml" &gt
<head runat="server"&gt
<title&gtUntitled Page</title&gt
<style type ="text/css" &gt
.gridHeader
{
POSITION: relative;
/*IE5+ only*/
top: expression(parentNode.parentNode.parentNode.parentNode.scrollTop-2);
left:expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
z-index: 99;
}
</style&gt
</head&gt
<body&gt
<form id="form1" runat="server"&gt
<div&gt
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringcountrystate %&gt"
ProviderName="<%$ ConnectionStrings:ConnectionStringcountrystate.ProviderName %&gt"
SelectCommand="select * from gd_master"&gt</asp:SqlDataSource&gt
<asp:Panel ID="Panel1" runat="server" Height="280px" Style="z-index: 100; left: -82px;
overflow: auto; position: absolute; top: 54px" Width="1537px"&gt
<asp:GridView ID="GridView2" runat="server" BackColor="#CCCCCC" BorderColor="#999999"
BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2"
DataSourceID="SqlDataSource1" ForeColor="Black" Height="210px"
Style="z-index: 135; left: 80px; position: absolute; top: -3px" Width="279px"&gt
<FooterStyle BackColor="#CCCCCC" /&gt
<Columns&gt
<asp:CommandField ShowSelectButton="True" /&gt
</Columns&gt
<RowStyle BackColor="White" /&gt
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" /&gt
<PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" /&gt
<HeaderStyle BackColor="Black" CssClass="gridHeader" Font-Bold="True" ForeColor="White" /&gt
</asp:GridView&gt
</asp:Panel&gt
</div&gt
</form&gt
</body&gt

</html&gt