Re: Question: maintaining focus between pages

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Mike Newton (MNewton_at_discussions.microsoft.com)
Date: 08/06/04


Date: Fri, 06 Aug 2004 15:54:23 -0500

No, there isn't a way to do it with the framework.

Use Page.RegisterClientScriptBlock to place the javascript in the page,
technically you're still writing it on the server. :-) Use the ID's as
references, since they are the same on the client side as they are on
the server side.

As for a pointer for info, use msdn. http://msdn.microsoft.com/library
is a good place to start. Under the Web Development tree....

Web Development->HTML and Dynamic HTML->SDK Documentation->Reference
will have everything that you basically need. There's an overview of
all things that appear in the HTML DOM, all properties, methods, and
yada. There is also some example scripting, but javascript is very
similar to typical server-side programming.

Mike wrote:

> Figured as much. This particular app. is for external users, but is a
> management app. (not many users), not the main customer-facing application.
> Basically there was an edict of "client code only when necessary" -- and
> also laziness on my part. But basically, you're right.
> So, any pointers to the preferred way to do this? (Figured there'd be a
> declaritive way to do this and have the framework handle it, even if it
> generated client scripting - but maybe not.)
>
> thanks
>
> "Raterus" <moc.liamtoh@suretar.reverse> wrote in message
> news:ueZCgC$eEHA.3632@TK2MSFTNGP09.phx.gbl...
> Not to question you as I'm sure you have a good reason, but why are you
> trying to avoid client-side code in this situation? Doesn't this problem
> beg for it?
>
> To answer your question, no, you can't maintain scroll/focus w/o writing
> client-side code. Sure you can write code to do it on the server, but it is
> still going to be clientside code. I'd try to avoid the postback as much as
> possible, unless this is an intranet app and nobody will ever notice.
>
> --Michael
>
> "Mike" <vimakefile@yahoo.com> wrote in message
> news:e$EEF0%23eEHA.2848@TK2MSFTNGP10.phx.gbl...
>
>>I have a few textbox controls that have autopostback so that when they
>
> loose
>
>>focus they update a label control that shows the count of characters in
>>their respective text control. This works fine, except that after the
>>postback, the page is shown reset -- scrolled to the top and with no
>
> control
>
>>having focus. Can I maintain scroll/focus w/o writing client-side
>>scripting?
>>
>>thanks
>>
>>
>
>
>



Relevant Pages

  • Re: Client side jscript issue
    ... I am trying to have my server side vb code construct a file name ... for use with my client side JavaScript code to then save the file to the ... I can read a HTMLInputText control in the asp:content page so long as it is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Pattern based test isnt working, but it works elsewhere
    ... including a drop down select control which has ... Now, the function test_nws, when used in a static web page with a much ... and no data is submitted to the server. ... there (I used the third edition of "JavaScript: ...
    (comp.lang.javascript)
  • Re: Web User Control - fire function from client side
    ... client (i.e. javascript) or on the server (i.e. inside the form control). ... postback from javascript and integrating it with a user control. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: problem when using Confirmation box in ASP.NET program
    ... javascript is to emit it from the control. ... Derive the Asp.Net server side button and override the appropriate ... methods to insert a Javascript that produces the Confirm Dialogue Box. ... I still have a problem when using Confirmation box in ASP.NET program. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Client side jscript issue
    ... I am trying to have my server side vb code construct a file name ... for use with my client side JavaScript code to then save the file to the ... I can read a HTMLInputText control in the asp:content page so long as it is ... TextBox1 are not render in clict side with name TextBox1...you will ...
    (microsoft.public.dotnet.framework.aspnet)