Re: Javascript code

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bruno Sirianni (brunosirianni_at_virgilio.it)
Date: 04/03/04


Date: Sat, 3 Apr 2004 12:29:01 +0200

On serverside you cannot debug clientside script.
Make script in Html and then turn it into String on server can be a
solution. This string on server can be changed dinamically for accept
parameters.

RegisterClientScriptBlock MSDN remark:
The client-side script is emitted just after the opening tag of the Page
object's <form runat= server> element. The script block is emitted as the
object that renders the output is defined, so you must include both tags of
the <script> element.

RegisterStartupScript MSDN remark:

Similar to the RegisterClientScriptBlock method, this method emits the
script just before the closing tag of the Page object's <form runat= server>
element. The script block is emitted as the object that renders the page is
defined, so you must include both tags of the <script> element.

Brun

"Shaul Feldman" <sfeldman@writeme.com> wrote in message
news:uTyVodVGEHA.712@tk2msftngp13.phx.gbl...
> Thank you for help,
> the problem is when you write
> >> htmlInput.Attributes["OnChange"] = "doSomething();"
> the "doSomething();" is a string, and I can't debug it on the server side,
> only accept client-side errors.
> Is there any efficient way to write that "doSomething();" than a simple
> string object, in order to debug?
> Or I should first write it in regular html file and only after that turn
> into String on server-side?
> Also would you be so kind to stay on the differences between those two
> methods you wrote, "RegisterClientScriptBlock" and
"RegisterStartupScript" -
> what are differences?
> Thanks a lot again :)
>
> --
> With the best wishes,
> Shaul Feldman
>
>
> "Bruno Sirianni" <brunosirianni@virgilio.it> wrote in message
> news:zxubc.12749$rM4.500302@news4.tin.it...
> > With ASP.NET javascript generate serverside is very simple.
> > You can use RegisterClientScriptBlock or RegisterStartupScript method.
> > For Javascript fired by html element you can make this element runat
> server
> > and write code similar this :
> > htmlInput.Attributes["OnChange"] = "doSomething();"
> >
> > Brun
> >
> >
> > "Shaul Feldman" <sfeldman@writeme.com> wrote in message
> > news:e8T$0PUGEHA.624@TK2MSFTNGP10.phx.gbl...
> > > Hello,
> > > I'm trying to figure out what's the most convinient way to write
> > JavaScript
> > > code in ASP.Net, espacially when JavaScript code has to recieve
certain
> > > values from server side. In classic ASP it was quiet simple, here I
get
> in
> > > trouble. Thank you for your help.
> > >
> > > S. Feldman
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script Runs perfectly fine from the command prompt. ... # This is the main Apache HTTP server configuration file. ... LoadModule actions_module modules/mod_actions.so ...
    (perl.beginners)
  • Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)
  • Re: Regarding a selection for mobile code/scripting language
    ... Client Side scripting, so the server can send script commands to the client. ... I decided they should be scripted and mobile code. ...
    (Vuln-Dev)
  • Re: HTTPSConnection script fails, but only on some servers (long)
    ... (HTTP/CONNECT + switch to HTTPS) ... wget and my python script. ... >>The python script works with server A, ... the problem seems to depend on both the client ...
    (comp.lang.python)