473,473 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using Javascript ScrollIntoView method on a web form

I have a web form that contains a repeater control that is designed to ask
like a check book register. Clicking on a certain transaction takes the user
to a different .aspx page where it can be edited and then saved. Currently,
after saving the edited transaction and returning to the check register, the
repeater control table returns to the bottom. I would like the edited
transaction to appear in the table instead. I know that a JavaScript
ScrollIntoView method on the check register .aspx page controls whether the
table scroll defaults to the top or bottom, but I don't know enough about
this method to know what I need to do to use it to scroll to a certain
transaction. Furthermore, I know I'd need to pass some type of parameter
indicating which transaction had been edited, which I imagine would have to
be done through the code-behind page, and I'm not certain how to do this.
Any advice? The code from the check register .aspx page is pasted below.
Thanks!

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="TransactionLog.aspx.vb" Inherits="IAMVFO_DEV.TransactionLog"
enableviewstate=true%>
<%@ Register TagPrefix="ici" Namespace="ICIValidators"
Assembly="ICIValidators" %>
<%@ OutputCache Location="None" Duration="1" VaryByParam="None" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>TransactionLog</title>
<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="Styles.css" type="text/css" rel="stylesheet">
</HEAD>
<body onresize="return Height();" onload="return Height();"
class="background" bottomMargin="0" leftMargin="0" topMargin="0"
rightMargin="0">
<form id="frmTransaction" runat="server">
<input type="hidden" name="hTrueFalse">
<p><asp:validationsummary id="ValidSum" runat="server" HeaderText="The
following errors were found with your input:" Font-Size="X-Small"
ShowSummary="True"></asp:validationsummary></p>
<TABLE id="Table1" height="30" cellSpacing="0" cellPadding="0"
width="100%" border="0">
<TR>
<TD class="Account_HeaderColor" style="FONT-WEIGHT: bold; FONT-SIZE:
12pt; HEIGHT: 30px">Bank
Register for
<asp:label id="lblAcctNm" Font-Size="Small"
Runat="server"></asp:label></TD>
</TR>
</TABLE>
<table id="tblReconcileHeader" width="100%" border="0" cellSpacing="1">
<COLGROUP>
<COL id="colReconcileHead1" align="middle">
<COL id="colReconcileHead2" align="middle">
<COL id="colReconcileHead3" align="middle">
<COL id="colReconcileHead4" align="middle">
<COL id="colReconcileHead5" align="middle">
<COL id="colReconcileHead6" align="middle">
</COLGROUP>
<tr class="ShadeColHeaderDark">
<td id="tblReconcileHeader2_1" style="FONT-SIZE: 10pt"
class="TableHeaders">Bank
Reconciliation Due By:
<asp:label id="lblRecDueDate" Font-Size="X-Small"
Runat="server"></asp:label>
<asp:linkbutton id="lnkOverdue" onclick="lnkOverdue_Click"
Runat="server" text="Overdue" Enabled="false" Visible="False"
ForeColor="Red">Overdue</asp:linkbutton></td>
<td id="tblReconcileHeader2_2" class="TableHeaders"><asp:button
id="btnFindTrans" Runat="server" Text="Find
Transaction"></asp:button><asp:button id="btnCorrectBal" Runat="server"
Text="Correct Balance"></asp:button></td>
</tr>
</table>
<asp:repeater id="rptTransaction" runat="server">
<HeaderTemplate>
<div id="divTransHeader" style="VISIBILITY: hidden">
<table id="tblTransHeader" cellspacing="0" border="0"
class="HeaderTable">
<colgroup class="ShadeColHeaderDark">
<col id="colHeader1" align="center">
<col id="colHeader2" align="center">
<col id="colHeader3" align="center">
<col id="colHeader4" align="center">
<col id="colHeader5" align="center">
<col id="colHeader6" align="center">
<col id="colHeader7" align="center">
<col id="colHeader8" align="center">
<col id="colHeader9" align="center">
<col width="*">
</colgroup>
<tr class="TableHeaders">
<td id="tblTransHeader1_0">
<asp:LinkButton id="lnkSortDate" OnCommand="SortData"
CommandArgument="date" text="Date" Runat="server"
ForeColor="#000000"></asp:LinkButton></td>
<td id="tblTransHeader1_1">
<asp:LinkButton id="lnkSortNumber" OnCommand="SortData"
CommandArgument="number" text="Number" Runat="server"
ForeColor="#000000"></asp:LinkButton></td>
<td id="tblTransHeader1_2" colspan="2">
<asp:LinkButton id="lnkSortDesc" OnCommand="SortData"
CommandArgument="description" text="Description" Runat="server"
ForeColor="#000000"></asp:LinkButton></td>
<td id="tblTransHeader1_3">
<asp:LinkButton id="lnkSortPayType" OnCommand="SortData"
CommandArgument="pay_type" text="Payment Type" Runat="server"
ForeColor="#000000"></asp:LinkButton></td>
<td id="tblTransHeader1_4">
<asp:LinkButton id="lnkSortReceipt" OnCommand="SortData"
CommandArgument="receipt" text="Deposit" Runat="server"
ForeColor="#000000"></asp:LinkButton></td>
<td id="tblTransHeader1_5">
<asp:LinkButton id="lnkSortStatus" OnCommand="SortData"
CommandArgument="Reconciled" text="R/C" Runat="server"
ForeColor="#000000"></asp:LinkButton></td>
<td id="tblTransHeader1_6">
<asp:LinkButton id="lnkSortDisburse" OnCommand="SortData"
CommandArgument="Disbursement" text="Disbursement" Runat="server"
ForeColor="#000000"></asp:LinkButton></td>
<td id="tblTransHeader1_7">Balance</td>
</tr>
<tr class="TableHeaders">
<td id="tblTransHeader2_0"></td>
<td id="tblTransHeader2_1"></td>
<td id="tblTransHeader2_2" style="BORDER-TOP: white 2px solid">
<asp:LinkButton id="lnkSortCat" OnCommand="SortData"
CommandArgument="category" text="Category" Runat="server"
ForeColor="#000000"></asp:LinkButton></td>
<td id="tblTransHeader2_3" style="BORDER-TOP: white 2px solid">
<asp:LinkButton id="lnkSortSubCat" OnCommand="SortData"
CommandArgument="sub_category" text="Sub-Category" Runat="server"
ForeColor="#000000"></asp:LinkButton></td>
<td id="tblTransHeader2_4"></td>
<td id="tblTransHeader2_5"></td>
<td id="tblTransHeader2_6"></td>
<td id="tblTransHeader2_7"></td>
<td id="tblTransHeader2_8"></td>
</tr>
</table>
</div>
<DIV id="divTransBody" style="VISIBILITY: hidden; OVERFLOW: auto;
WIDTH: 100%; HEIGHT: 130px">
<table border="0" cellspacing="0" id="tblTransBody" border="0"
width="100%">
<colgroup class="ShadeColHeaderDark">
<col width="66" id="tblTransBody1" align="center">
<col width="80" id="tblTransBody2" align="center">
<col width="115" id="tblTransBody3" align="center">
<col width="115" id="tblTransBody4" align="center">
<col width="60" id="tblTransBody5" align="center">
<col width="65" id="tblTransBody6" align="center">
<col width="64" id="tblTransBody7" align="center">
<col width="79" id="tblTransBody8" align="center">
<col width="51" id="tblTransBody9" align="center">
<col width="51" id="tblTransBody10" align="center">
</colgroup>
</HeaderTemplate>
<ItemTemplate>
<tr class="Shade_Trans_light" style="COLOR: black">
<td>
<asp:label ID="Label1" text='' runat="server" />
</td>
<td>
<asp:label text='<%# iif(len(trim(Container.DataItem("number") & ""))
0, Container.DataItem("pay_type") & " #" & Container.DataItem("number"),

"")%>' runat="server" ID="Label2"/></td>
<td colspan="2">
<asp:Label ID="lblTransDesc" text='<%#
Container.DataItem("description")%>' Runat=server ForeColor="#000000">
</asp:Label>
<asp:LinkButton ID="lnkTransDesc" text='<%#
Container.DataItem("description")%>' OnCommand="lnkTransDesc_Click"
CommandArgument='<%# Container.DataItem("id")%>' Runat="server"
ForeColor="#000000">
</asp:LinkButton>
</td>
<td>
<asp:Label ID=lblPayType text='<%# Container.DataItem("pay_type")%>'
Runat=server ForeColor="#000000">
</asp:Label>
<asp:LinkButton ID="lnkPayType" text='<%#
Container.DataItem("pay_type")%>' OnCommand="lnkPayType_Click"
CommandArgument='<%# Container.DataItem("id")%>' Runat="server"
ForeColor="#000000">
</asp:LinkButton>
</td>
<td align="right">
<asp:label text='<%# iif(cstr(Container.DataItem("receipt")) = "0",
"", format(Math.Abs(Container.DataItem("receipt")), "0.00"))%>'
runat="server" ID="Label3"/></td>
<td>
<asp:label text='<%# Container.DataItem("Reconciled")%>'
runat="server" ID="Label4"/></td>
<td align="right">
<asp:label text='<%# iif(cstr(Container.DataItem("Disbursement")) =
"0", "", Format(Container.DataItem("Disbursement") * -1, "0.00"))%>'
runat="server" ID="Label5"/></td>
<td align="right">
<asp:label ID="lblBalance" text='<%#
iif(cstr(Container.DataItem("Balance1")) = ".00", "0.00",
Format(Container.DataItem("Balance1"), "0.00;(0.00)"))%>'
runat="server"/></td>
</tr>
<tr class="Shade_Trans_dark" style="COLOR: black; BACKGROUND-COLOR:
gainsboro">
<td></td>
<td colspan="1">
<asp:label ID="lblPayroll" text="PAYROLL" Runat="server"
ForeColor="#0000ff"></asp:label>
<asp:LinkButton ID="lnkTransHistory" text="" CommandArgument='<%#
Container.DataItem("id")%>' OnCommand="lnkTransHistory_Click" Runat="server"
ForeColor="Black">
</asp:LinkButton>
<asp:Label ID="lblTransHistory" Runat="server"></asp:Label>
</td>
<td>
<asp:label ID="lblCategory" text='<%#
Container.DataItem("category")%>' runat="server" />
<asp:LinkButton ID="lnkViewSplit" text="Split"
OnCommand="lnkViewSplit_Click" CommandArgument='<%#
Container.DataItem("id")%>' Runat="server" ForeColor="#000000">
</asp:LinkButton>
</td>
<td>
<asp:label ID="Label7" text='<%#
Container.DataItem("sub_category")%>' runat="server" /></td>
<td colspan="2" align="left">
<asp:label ID="lblFunctionalCat" text='<%#
Container.DataItem("functional_category")%>' runat="server" /></td>
<td colspan="2" align="left">
<asp:LinkButton ID="lnkReturnToCash" text="Return To Cash"
OnCommand="lnkReturnToCash_Click" CommandArgument='<%#
Container.DataItem("id")%>' Runat="server" ForeColor=#0000ff >
</asp:LinkButton>
<asp:LinkButton ID="lnkEditTrans" text="Edit"
OnCommand="lnkEditTrans_Click" CommandArgument='<%#
Container.DataItem("id")%>' Runat="server" ForeColor=#0000ff >
</asp:LinkButton>
<asp:LinkButton ID="lnkViewDetails" text="View Details"
OnCommand="lnkViewDetails_Click" CommandArgument='<%#
Container.DataItem("id")%>' Runat="server" ForeColor=#0000ff >
</asp:LinkButton>
<asp:LinkButton ID="lnkAdjustTrans" text="Adjust"
OnCommand="lnkAdjustTrans_Click" CommandArgument='<%#
Container.DataItem("id")%>' Runat="server" ForeColor=#0000ff >
</asp:LinkButton>
<asp:LinkButton ID="lnkLodgeVoid" text="Void"
OnCommand="lnkLodgeVoid_Click" CommandArgument='<%#
Container.DataItem("id")%>' Runat="server" ForeColor=#0000ff >
</asp:LinkButton>
<asp:LinkButton ID="lnkLodgeUnVoid" text="Un-Void"
OnCommand="lnkLodgeUnVoid_Click" CommandArgument='<%#
Container.DataItem("id")%>' Runat="server" ForeColor=#0000ff >
</asp:LinkButton>
<asp:LinkButton ID="lnkAuditorVoid" text="Void"
OnCommand="lnkAuditorVoid_Click" CommandArgument='<%#
Container.DataItem("id")%>' Runat="server" ForeColor=#0000ff >
</asp:LinkButton>
<asp:LinkButton ID="lnkAuditorUnVoid" text="Un-Void"
OnCommand="lnkAuditorUnVoid_Click" CommandArgument='<%#
Container.DataItem("id")%>' Runat="server" ForeColor=#0000ff >
</asp:LinkButton>
</td>
<td></td>
</tr>
</ItemTemplate>
<SeparatorTemplate>
<tr>
<td colspan="10" height="2" bgcolor="#000000" style="BORDER-RIGHT:
white 1px solid; BORDER-LEFT: white 1px solid;"></td>
</tr>
</SeparatorTemplate>
<FooterTemplate>
</table> </div>
</FooterTemplate>
</asp:repeater>
<TABLE id="tblFooter" width="100%" border="0" cellSpacing="0"
cellPadding="1">
<TR class="ShadeColHeaderDark">
<TD align="middle" class="TableHeaders" style="HEIGHT: 2px">View:
<asp:dropdownlist id="ddlViewPrevious"
Runat="server"></asp:dropdownlist>
Or Enter Date Range From:
<asp:textbox id="txtFromDate" Runat="server"></asp:textbox> To:
<asp:textbox id="txtToDate" Runat="server"></asp:textbox>
<asp:button id="btnGo" Runat="server" Text="Go"></asp:button></TD>
</TR>
<TR class="ShadeColHeaderDark">
<TD align="right" class="Account_HeaderColor" style="HEIGHT:
20px"><asp:linkbutton id="lnkRecordsPrevious" Runat="server" Visible="False"
ForeColor="White" Font-Bold="True"></asp:linkbutton>
<asp:linkbutton id="lnkRecordsNext" Runat="server" Visible="False"
ForeColor="White" Font-Bold="True"></asp:linkbutton></TD>
</TR>
</TABLE>
<asp:label id="lblToday" Runat="server" Visible="False"
DESIGNTIMEDRAGDROP="250"></asp:label><asp:label id="lblAcctBalance"
Runat="server" Visible="False"></asp:label><asp:label id="lblAcctNum"
Runat="server" Visible="False"></asp:label><asp:label id="lblBankNm"
Runat="server" Visible="False"></asp:label><asp:label id="lblAcctType"
Runat="server" Visible="False"></asp:label><asp:label id="lblAcctStatus"
Runat="server" Visible="False"></asp:label><ici:datevalidator
id="dtv_txtFromDate" runat="server" Display="None" ErrorMessage="From Date"
ControlToValidate="txtFromDate"></ici:datevalidator><ici:datevalidator
id="dtv_txtToDate" runat="server" Display="None" ErrorMessage="To Date"
ControlToValidate="txtToDate"></ici:datevalidator><asp:customvalidator
id="cuv_DateRange" runat="server" Display="None" ErrorMessage="The From date
must be less than the To date"
EnableClientScript="False"></asp:customvalidator></form>
<SCRIPT language="javascript" src="AlignGridHeaders.js"></SCRIPT>
<SCRIPT language="javascript">
<!--
//AlignGridHeaders(tblHeaders,dg);
Resizecolumns(tblTransHeader, tblTransBody, divTransBody, 9);
divTransHeader.style.visibility = "visible";
divTransBody.style.visibility = "visible";

tblTransBody.scrollIntoView(false)
//-->
</SCRIPT>
<SCRIPT language="javascript">
function fnGo(){
return confirm ('The results returned more than 1000 records. Do you
wish to continue?');
}
<% if viewstate("iCount") = "greater" then%>
return confirm ('The results returned more than 1000 records. Do you
wish to continue?');
<% end if %>
</SCRIPT>
<script language="javascript">
<!--
//4/11/05-Wrote this function, and added the onload & onresize events
to the <body> tag,
// to resize the transaction log based on screen resolution.
function Height()
{if ((screen.width==1024) && (screen.height==768))
return divTransBody.style.height = 375;
else if ((screen.width==800) && (screen.height==600))
return divTransBody.style.height = 205;}
//-->
</script>
</body>
</HTML>

May 10 '06 #1
0 2154

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: bigbinc | last post by:
set scroll position in javascript. Is there a way to do this without using document.location, example. document.location = "#gohere" <a name="gohere">
3
by: cmay | last post by:
I am trying to use scrollIntoView to programatically scroll an area on one of my pages. It wors just like you would expect it to when the page itself doesn't have any scrolling (the page is...
2
by: Jeff Voigt | last post by:
I just need a few pointers from a few experts to help me finish this up. In a nutshell I want to return the user to where they left off on a page througout numerous postbacks. So far, and with...
0
by: Larry Brown | last post by:
Hi, I'm working on an ASP.NET 2 application, with framework 2.0 beta. I have a classic form, with a listbox. This field is in autopostback=true. When I change the selected value, the page is...
0
by: Keith | last post by:
I have a web form that contains a repeater control that is designed to ask like a check book register. Clicking on a certain transaction takes the user to a different .aspx page where it can be...
3
by: sylver | last post by:
Hi to all, I found out the you can use the scrollIntoView() method, to scroll an element (ie: a <divwith lots of content that it overflows) to its bottom / last line. But this only happens in...
1
by: amiparna | last post by:
There is two frame in my form.In d first frame there is a text box,and i give some word in the text box.I want to search the word from a file from the location(http://45.12.09.31...........) and if...
3
by: nigelesquire | last post by:
Please help! I'm trying to clone and delete multiple rows with JavaScript. I need two delete buttons that work...! I only have one for now, but it's not working properly, the output count is...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.