Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
'Page.RegisterClientScriptBlock("FrameRefresh", "<script language='javascript'>window.top.frames[2].location.reload(true);</script>")
If Not Page.IsPostBack Then
doDataBind()
cPrevious.Enabled = False
cFirst.Enabled = False
End If
End Sub
Sub doDataBind()
Dim objConn As New SqlConnection
Dim strsql As String
objConn = New SqlConnection(strConn)
Dim myCommand As New SqlDataAdapter("spContacts", objConn)
myDataset = New DataSet
myCommand.Fill(myDataset, "tContacts")
Dim dt As DataTable = myDataset.Tables("tContacts")
If dt.Rows.Count > 0 Then
If Session("FindContactID") > "" Then
Stop
Dim foundRows() As DataRow
' Use the Select method to find all rows matching the filter.
foundRows = dt.Select("ContactID >3")
cContacts.DataSource = foundRows
cContacts.DataBind()
Else
cContacts.DataSource = myDataset.Tables("tContacts").DefaultView
cContacts.DataBind()
End If
End If
Session("ContactID") = cContacts.DataKeys.Item(0)
Session("ContactName") = "Batten"
cRecordCount.Text = cContacts.CurrentPageIndex.ToString + 1 & " of " & dt.Rows.Count
objConn.Close()
End Sub
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="fContacts.aspx.vb" Inherits="RubiconArgo.fContacts"%>
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
<%@ Register TagPrefix="ie" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>fContacts</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="
name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<table style="Z-INDEX: 101; LEFT: 200px; WIDTH: 248px; POSITION: absolute; TOP: 16px; HEIGHT: 31px">
<TR>
<TD><asp:button id="cFirst" runat="server" Text="|<" Width="41px" ToolTip="First"></asp:button><asp:button id="cPrevious" runat="server" Text="<" Width="41px" ToolTip="Previous"></asp:button><asp:textbox id="cRecordCount" runat="server" Width="72px" BorderStyle="None" ReadOnly="True"
BorderWidth="0px"></asp:textbox><asp:button id="cNext" runat="server" Text=">" Width="41px" ToolTip="Next"></asp:button><asp:button id="cLast" runat="server" Text=">|" Width="41px" ToolTip="Next"></asp:button></TD>
</TR>
</table>
<asp:datagrid id="cContacts" style="Z-INDEX: 102; LEFT: 40px; POSITION: absolute; TOP: 40px" runat="server"
Width="592px" BorderStyle="None" DataKeyField="ContactID" Height="376px" AllowPaging="True"
PageSize="1" AutoGenerateColumns="False" GridLines="None">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<TABLE border="0">
<TR>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 72px; HEIGHT: 19px" align="right" ms_positioning="FlowLayout">Title</DIV>
</TD>
<TD width="25%">
<asp:dropdownlist id="cTitle" tabIndex="1" runat="server" Width="96px" Height="15px">
<asp:ListItem></asp:ListItem>
<asp:ListItem Value="Mr">Mr</asp:ListItem>
<asp:ListItem Value="Mrs">Mrs</asp:ListItem>
<asp:ListItem Value="Miss">Miss</asp:ListItem>
<asp:ListItem Value="Dr">Dr</asp:ListItem>
</asp:dropdownlist></TD>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 72px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout"></DIV>
</TD>
<TD width="25%">
<asp:textbox id="ContactID" tabIndex=2 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ContactID") %>' Width="176px">
</asp:textbox></TD>
</TR>
<TR>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 72px; HEIGHT: 19px" align="right" ms_positioning="FlowLayout">Forename</DIV>
</TD>
<TD width="25%">
<asp:textbox id=cForename tabIndex=2 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Forename") %>' Width="176px">
</asp:textbox></TD>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 72px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout">Address
1</DIV>
</TD>
<TD width="25%">
<asp:textbox id=cAddress1 tabIndex=9 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Address1") %>' Width="176px">
</asp:textbox></TD>
</TR>
<TR>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 72px; HEIGHT: 19px" align="right" ms_positioning="FlowLayout">Surname</DIV>
</TD>
<TD>
<asp:textbox id=cSurname tabIndex=3 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Surname") %>' Width="176px">
</asp:textbox></TD>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 72px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout">Address
2</DIV>
</TD>
<TD>
<asp:textbox id=cAddress2 tabIndex=10 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Address2") %>' Width="176px">
</asp:textbox></TD>
</TR>
<TR>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 19px" align="right" ms_positioning="FlowLayout">Tel:
Daytime</DIV>
</TD>
<TD>
<asp:textbox id=cTelDaytime tabIndex=4 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.DaytimeTel") %>' Width="176px">
</asp:textbox></TD>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout">Address 3</DIV>
</TD>
<TD>
<asp:textbox id=cAddress3 tabIndex=11 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Address3") %>' Width="176px">
</asp:textbox></TD>
</TR>
<TR>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 19px" align="right" ms_positioning="FlowLayout">Tel:
Evening</DIV>
</TD>
<TD>
<asp:textbox id=cTelEvening tabIndex=5 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.EveningTel") %>' Width="176px">
</asp:textbox></TD>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout">City</DIV>
</TD>
<TD>
<asp:textbox id=cCity tabIndex=12 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.City") %>' Width="176px">
</asp:textbox></TD>
</TR>
<TR>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 19px" align="right" ms_positioning="FlowLayout">Mobile</DIV>
</TD>
<TD>
<asp:textbox id=cMobile tabIndex=6 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.mobile") %>' Width="176px">
</asp:textbox></TD>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout">County</DIV>
</TD>
<TD>
<asp:textbox id=cCounty tabIndex=13 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.County") %>' Width="176px">
</asp:textbox></TD>
</TR>
<TR>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 19px" align="right" ms_positioning="FlowLayout">Fax</DIV>
</TD>
<TD>
<asp:textbox id=cFax tabIndex=7 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Fax") %>' Width="176px">
</asp:textbox></TD>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout">Postcode</DIV>
</TD>
<TD>
<asp:textbox id=cPostcode tabIndex=14 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Postcode") %>' Width="176px">
</asp:textbox></TD>
</TR>
<TR>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 19px" align="right" ms_positioning="FlowLayout">E-mail</DIV>
</TD>
<TD>
<asp:textbox id=cEmail tabIndex=8 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Email") %>' Width="176px">
</asp:textbox></TD>
</TD>
<TD align="right">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout">Country</DIV>
</TD>
<TD>
<asp:textbox id=cCountry tabIndex=15 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Country") %>' Width="176px">
</asp:textbox></TD>
</TR>
<TR>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 112px; HEIGHT: 24px" align="right" ms_positioning="FlowLayout">Lead
Create Date</DIV>
</TD>
<TD width="25%">
<asp:textbox id=cLeadCreateDate tabIndex=2 runat="server" Text='<%# left(DataBinder.Eval(Container, "DataItem.LeadCreateDate"),10) %>' Width="176px">
</asp:textbox></TD>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 72px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout"></DIV>
</TD>
<TD width="25%"></TD>
</TR>
<TR>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 24px" align="right" ms_positioning="FlowLayout">Lead
Source</DIV>
</TD>
<TD width="25%">
<asp:dropdownlist id="cLeadSource" tabIndex="1" runat="server" Width="176px" Height="15px"></asp:dropdownlist></TD>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 72px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout"></DIV>
</TD>
<TD width="25%"></TD>
</TR>
<TR>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 24px" align="right" ms_positioning="FlowLayout">Site
Interest</DIV>
</TD>
<TD width="25%">
<asp:dropdownlist id="cSiteInterest" tabIndex="1" runat="server" Width="176px" Height="15px"></asp:dropdownlist></TD>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 72px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout"></DIV>
</TD>
<TD width="25%"></TD>
</TR>
<TR>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 24px" align="right" ms_positioning="FlowLayout">Budget
</DIV>
</TD>
<TD width="25%">
<asp:dropdownlist id="cBudget" tabIndex="1" runat="server" Width="176px" Height="15px"></asp:dropdownlist></TD>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 72px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout"></DIV>
</TD>
<TD width="25%"></TD>
</TR>
<TR>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 80px; HEIGHT: 24px" align="right" ms_positioning="FlowLayout">Contact Stage
</DIV>
</TD>
<TD width="25%">
<asp:dropdownlist id="cContactStage" tabIndex="1" runat="server" Width="176px" Height="15px"></asp:dropdownlist></TD>
<TD align="right" width="25%">
<DIV style="DISPLAY: inline; WIDTH: 72px; HEIGHT: 16px" align="right" ms_positioning="FlowLayout"></DIV>
</TD>
<TD width="25%">
<asp:Button id="Button1" runat="server" Text="Button" Width="80px" CommandName="Update"></asp:Button></TD>
</TR>
</TABLE>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle Visible="False"></PagerStyle>
</asp:datagrid><ie:tabstrip id="ts1" style="Z-INDEX: 103; LEFT: 32px; POSITION: absolute; TOP: 432px" runat="server"
AutoPostBack="True" SepDefaultStyle="background-color:#FFFFFF;border-color:#AAAAAA;border-width:1px;border-style:solid;border-top:none;border-left:none;border-right:none"
TabSelectedStyle="color:#000000;background-color:#FFFFFF;border-bottom:none" TabHoverStyle="color:blue"
TabDefaultStyle="color:#aaaaaa;background-color:#EEEEEE;border-color:#AAAAAA;border-width:1px;border-style:Solid;font-weight:bold;font-family:Verdana;font-size:11px;height:21;width:79;text-align:center;">
<ie:Tab Text="Hold"></ie:Tab>
<ie:Tab Text="Sales"></ie:Tab>
<ie:Tab Text="Blah"></ie:Tab>
<ie:Tab Text="Blah"></ie:Tab>
<ie:Tab Text="Blah"></ie:Tab>
</ie:tabstrip><INPUT style="Z-INDEX: 104; LEFT: 32px; WIDTH: 104px; POSITION: absolute; TOP: 16px; HEIGHT: 32px"
onclick="window.open('fFindContacts.aspx','main1')" type="button" value="Contact Search">
</form>
</body>
</HTML>