Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > JScript / JavaScript Help

Reply
Thread Tools

JScript / JavaScript Help

 
 
Roshawn Dawson
Guest
Posts: n/a
 
      03-18-2005
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
 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      03-18-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is Server-Side Jscript (not Jscript.NET)? Maxwell2006 ASP .Net 5 03-07-2006 05:28 AM
JScript.Net (JScript 7.0) is official documented language VK Javascript 4 01-12-2006 06:48 PM
script language = "js", "jscript", "javascript", "vj#" What to use =?Utf-8?B?UkZTNjY2?= ASP .Net 7 10-28-2005 11:52 AM
Porting from JScript to JScript.Net - compiler error Jon Maz ASP .Net 4 09-09-2004 10:24 AM
Which to Learn: Javascript, Jscript, JScript.NET, ECMA 262 (3rd ed)? John Bentley Javascript 14 02-05-2004 06:14 PM



Advertisments