473,395 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Getting window to open at top

Hello,

I have a set of functions that call a page from one frame (the menu) into an iframe and then spit the page up into a div on the current page (in the content section, NEXT to the menu). The only problem is if I call one page and then scroll down, then click on another page from the menu frame, it loads the new page scrolled down some. I can't seem to get it to load the new page at the top.

Any ideas? Perhaps some sort of onload command in the body tag of the new page to be called?

I tried setting an anchor in the body of the new page and then attaching the anchor to the hyperlink text in the javascript code of the menu (which calls the new page) but that doesn't have an effect.

Thanks for any insight!
-Rick
Apr 12 '07 #1
2 1107
tinvd
1
[quote=aricknophobia]Hello,

I tried :
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript" >
function login_Click()
{
var retVal = window.showModalDialog('default2.aspx');
var result = document.getElementById('Result');

result.innerHTML = retVal;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr >
<td >
<input type="button" id="login" value="Login" onclick="javascript:login_Click();"/>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Result" runat="server"></asp:Label>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Apr 13 '07 #2
acoder
16,027 Expert Mod 8TB
Try
Expand|Select|Wrap|Line Numbers
  1. window.scrollTo(0,0);
See link.
Apr 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: alikhome | last post by:
Hi! May be anybody knows... I want to open word file (or Excel) from IIS server (URL) without getting security window for input Username and password. I know Username, Password and Domain. I'm...
4
by: Don W. | last post by:
Is it possible to open a browser window from a javascript for the purpose of gathering user input on a form and then use data from the form in the javascript? How do you get the data from the form...
3
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
18
by: lawrence | last post by:
If I'm pretty sure there is just one form on the page, can i do this? var myForm = document.forms; If I'm not sure about the form, is it safer to do this? if (document.forms) { var myForm =...
2
by: Alex | last post by:
Hi all, I'm writing a small web application which searches a database based on a date field, and populates a datagrid control with the results. The datagrid control has selection buttons added...
1
by: neeraj | last post by:
Hi people's I developed one MDI application with one MDI form and 2 child forms, form. Border style of first child forms set as Fixed3D and Window State set as normal (like dialog Box) and...
4
by: Ravi Kishore | last post by:
Hi all, I have a problem while sending the data to and fro a JSP page. When i click a link on a JSP page(say parent.jsp), i have to open a diff page(say child.jsp), get the data from that page and...
1
by: iwdu15 | last post by:
hi, how can i get the icon associated with a certain file type? thanks -- -iwdu15
3
by: Ajay1 Kumar1 | last post by:
Hi, i m working on asp.net 2.0 I open a new window on a web page using hyperlink through javascript window.open("upload_image.aspx?vin=" + vin...
12
by: bnashenas1984 | last post by:
I have a page which opens a little popup to show recieved messages but when ever the page tries to open the popup the user should click on the yellow message on top of internet explorer and click on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.