473,394 Members | 1,752 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,394 software developers and data experts.

JScript / JavaScript Help

Hi,

Could someone tell how to force a mouse event using either jscript or
javascript? I simply want to allow users to scroll the page after
postbacks using the scroll button on either a mouse or the keyboard
without them having to click the page first.

Thx,
Roshawn
Nov 19 '05 #1
1 1184
Hi Roshawn,

The simplest way is to make sure that a control on the page has the focus
after the page is loaded. In the sample below, I give the textbox a tabindex
and in the codebehind, I emit the Javascript to cause the textbox to have
the focus.

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
Toronto

<form id="Form1" method="post" runat="server">
<p>
<asp:textbox TabIndex="0" id="TextBox1"
runat="server"></asp:textbox></p>
<p>
<asp:button id="Button1" runat="server"
Text="Button"></asp:button></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>
<asp:hyperlink id="HyperLink1"
runat="server">HyperLink</asp:hyperlink></p>
</form>

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Page.RegisterStartupScript("startup", _
"<script>TextBox1.focus();</script>")
End Sub

"Roshawn Dawson" <ud****@bellsouth.net> wrote in message
news:uh**************@tk2msftngp13.phx.gbl...
Hi,

Could someone tell how to force a mouse event using either jscript or
javascript? I simply want to allow users to scroll the page after
postbacks using the scroll button on either a mouse or the keyboard
without them having to click the page first.

Thx,
Roshawn


Nov 19 '05 #2

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

Similar topics

20
by: Harag | last post by:
Hi All. I'm stating out doing some web developing. I was wondering which of the server side languages should I concentrate on and learn. I Know CSS, HTML, T-SQL I can look at the client...
1
by: TopDawg044 | last post by:
I continue to lose Javascript functionality in any browser I use under WinXPPro...(IE6, Moz 1.4, NS 7.1...)it is now at the point where I'm unable to access my school sites which use jscript and...
7
by: Dr John Stockton | last post by:
The following DOS prompt command line, in a Win98 DOS box, cscript //nologo ~tmp.js executes file ~tmp.js as javascript/Jscript. The following batch file, similarly run, executes the same....
14
by: John Bentley | last post by:
Note this is crossposted to comp.lang.javacript and microsoft.public.dotnet.scripting. After some Googling and FAQing my understanding of these terms is, crudely: Javascript (3 different...
1
by: joe | last post by:
Hello, I have some code written in C that I want to transfer over to JScript so I can run within my project to "burn" my DSP code into EEPROM(Non-volatile RAM). I want to generate an .ldr file (a...
10
by: SergioT | last post by:
Hi I wanna to create a jscript function that sets the value of a textbox into a datagrid, But the problem is How can I obtain the name of the textbox and send it to my jscript function???? The...
6
by: RFS666 | last post by:
Hello, After I posted yesterday "using C# class in jscript", I have a new problem: I have a C# class - DBResult - that contains (and other variables) a string array (and other variables), that...
7
by: RFS666 | last post by:
Hello, I would like to use variables with a type in jscript.NET. I declare them as follows: var x : double = 5.03; This doesn't work in my script, that I write to the page in codebehind with...
4
by: Lando | last post by:
I'm a bit confused ...javascript and jscript are the same thing ? javascript and java are related.......... javascript in windows differs from javascript in linux....? Sorry,... if some question...
15
by: zz12 | last post by:
Hello, would anyone be able to confirm that 'jscript.dll' is a necessary file for an .asp page on IIS 5.0 to use the <script language="JavaScipt" runat="SERVER"code? It looks like the code in this...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...

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.