Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > JavaScript file

Reply
Thread Tools

JavaScript file

 
 
ruca
Guest
Posts: n/a
 
      03-04-2004
I have a JS file, where I have show_clock function to call. I calling
her like this<body onload="show_clock()">, but nothing happens. The clock
don't appear.

In your opinion what should I do? Use "RegisterClientScriptBlock" and/or
"RegisterStartupScript".? If yes, how can I use them?


--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca


 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      03-04-2004
I need to look at the documentation, but one of the two runs prior to the
HTML being written out. This is not the one you want to use. The other puts
the script at the end of the load, which is what you will want. I believe
the RegisterClientScriptBlock is the correct one to have it run after the
HTML is written out, but would have to check the docs to see.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"ruca" <> wrote in message
news:...
> I have a JS file, where I have show_clock function to call. I calling
> her like this<body onload="show_clock()">, but nothing happens. The clock
> don't appear.
>
> In your opinion what should I do? Use "RegisterClientScriptBlock" and/or
> "RegisterStartupScript".? If yes, how can I use them?
>
>
> --
>
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
>
>



 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      03-04-2004
RegisterClientScriptBlock() puts the script just after the <form> tag on the
page. RegisterStartupScript() puts the script just before the </form> tag in
the page.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Cowboy (Gregory A. Beamer)" <> wrote in
message news:...
> I need to look at the documentation, but one of the two runs prior to the
> HTML being written out. This is not the one you want to use. The other

puts
> the script at the end of the load, which is what you will want. I believe
> the RegisterClientScriptBlock is the correct one to have it run after the
> HTML is written out, but would have to check the docs to see.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ************************************************** ********************
> Think Outside the Box!
> ************************************************** ********************
> "ruca" <> wrote in message
> news:...
> > I have a JS file, where I have show_clock function to call. I calling
> > her like this<body onload="show_clock()">, but nothing happens. The

clock
> > don't appear.
> >
> > In your opinion what should I do? Use "RegisterClientScriptBlock" and/or
> > "RegisterStartupScript".? If yes, how can I use them?
> >
> >
> > --
> >
> > Thank's (if you try to help me)
> > Hope this help you (if I try to help you)
> > ruca
> >
> >

>
>



 
Reply With Quote
 
ruca
Guest
Posts: n/a
 
      03-05-2004
Right.
But I still don't know how and where to use one of them. Where should I call
them?



--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

"Kevin Spencer" <> escreveu na mensagem
news:...
> RegisterClientScriptBlock() puts the script just after the <form> tag on

the
> page. RegisterStartupScript() puts the script just before the </form> tag

in
> the page.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "Cowboy (Gregory A. Beamer)" <> wrote in
> message news:...
> > I need to look at the documentation, but one of the two runs prior to

the
> > HTML being written out. This is not the one you want to use. The other

> puts
> > the script at the end of the load, which is what you will want. I

believe
> > the RegisterClientScriptBlock is the correct one to have it run after

the
> > HTML is written out, but would have to check the docs to see.
> >
> > --
> > Gregory A. Beamer
> > MVP; MCP: +I, SE, SD, DBA
> >
> > ************************************************** ********************
> > Think Outside the Box!
> > ************************************************** ********************
> > "ruca" <> wrote in message
> > news:...
> > > I have a JS file, where I have show_clock function to call. I calling
> > > her like this<body onload="show_clock()">, but nothing happens. The

> clock
> > > don't appear.
> > >
> > > In your opinion what should I do? Use "RegisterClientScriptBlock"

and/or
> > > "RegisterStartupScript".? If yes, how can I use them?
> > >
> > >
> > > --
> > >
> > > Thank's (if you try to help me)
> > > Hope this help you (if I try to help you)
> > > ruca
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
ruca
Guest
Posts: n/a
 
      03-05-2004
Can you help me, please. I'm a litle urgency on that and I don't know what
to do.

Thanks
Ruca

"Kevin Spencer" <> escreveu na mensagem
news:...
> RegisterClientScriptBlock() puts the script just after the <form> tag on

the
> page. RegisterStartupScript() puts the script just before the </form> tag

in
> the page.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "Cowboy (Gregory A. Beamer)" <> wrote in
> message news:...
> > I need to look at the documentation, but one of the two runs prior to

the
> > HTML being written out. This is not the one you want to use. The other

> puts
> > the script at the end of the load, which is what you will want. I

believe
> > the RegisterClientScriptBlock is the correct one to have it run after

the
> > HTML is written out, but would have to check the docs to see.
> >
> > --
> > Gregory A. Beamer
> > MVP; MCP: +I, SE, SD, DBA
> >
> > ************************************************** ********************
> > Think Outside the Box!
> > ************************************************** ********************
> > "ruca" <> wrote in message
> > news:...
> > > I have a JS file, where I have show_clock function to call. I calling
> > > her like this<body onload="show_clock()">, but nothing happens. The

> clock
> > > don't appear.
> > >
> > > In your opinion what should I do? Use "RegisterClientScriptBlock"

and/or
> > > "RegisterStartupScript".? If yes, how can I use them?
> > >
> > >
> > > --
> > >
> > > Thank's (if you try to help me)
> > > Hope this help you (if I try to help you)
> > > ruca
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      03-05-2004
Here's a link to the freely downloadable Microsoft .Net SDK (Software
Development Kit), which documents these functions as well as the entire CLR
(Common Language Runtime Library), and includes examples, tutorials, and
articles to help you.

http://www.microsoft.com/downloads/d...displaylang=en

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"ruca" <> wrote in message
news:...
> Can you help me, please. I'm a litle urgency on that and I don't know what
> to do.
>
> Thanks
> Ruca
>
> "Kevin Spencer" <> escreveu na mensagem
> news:...
> > RegisterClientScriptBlock() puts the script just after the <form> tag on

> the
> > page. RegisterStartupScript() puts the script just before the </form>

tag
> in
> > the page.
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "Cowboy (Gregory A. Beamer)" <> wrote

in
> > message news:...
> > > I need to look at the documentation, but one of the two runs prior to

> the
> > > HTML being written out. This is not the one you want to use. The other

> > puts
> > > the script at the end of the load, which is what you will want. I

> believe
> > > the RegisterClientScriptBlock is the correct one to have it run after

> the
> > > HTML is written out, but would have to check the docs to see.
> > >
> > > --
> > > Gregory A. Beamer
> > > MVP; MCP: +I, SE, SD, DBA
> > >
> > > ************************************************** ********************
> > > Think Outside the Box!
> > > ************************************************** ********************
> > > "ruca" <> wrote in message
> > > news:...
> > > > I have a JS file, where I have show_clock function to call. I

calling
> > > > her like this<body onload="show_clock()">, but nothing happens. The

> > clock
> > > > don't appear.
> > > >
> > > > In your opinion what should I do? Use "RegisterClientScriptBlock"

> and/or
> > > > "RegisterStartupScript".? If yes, how can I use them?
> > > >
> > > >
> > > > --
> > > >
> > > > Thank's (if you try to help me)
> > > > Hope this help you (if I try to help you)
> > > > ruca
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      03-05-2004
Hi Ruca,

Two samples in one.
Needs a label1 on a page and a HTML textbox with the name HTMLtextbox1

Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim scriptString As String = "<script language=JavaScript>" & _
"function ShowText() {document.Form1.HTMLTextBox1.value " & _
"= 'I hope this helps?'}" & _
"</script>"
Page.RegisterClientScriptBlock("clientScript", scriptString)

Dim str As String = "<script language " & _
"=javascript>alert('I hope this helps a little bit?');</script>"
Page.RegisterStartupScript("Startup", str)
Me.Label1.Text = "Does this works<br>I hope"

End Sub
I hope this helps a little bit?

Cor


 
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
Disadvantage of including JavaScript files within a JavaScript file? vunet Javascript 2 07-08-2008 03:18 PM
How to read the BODY of HTML file from another HTML file using javascript? Dhanasankar S via DotNetMonster.com ASP .Net 1 02-28-2005 05:51 PM
How to read the BODY of HTML file from another HTML file using javascript? Dhanasankar S via DotNetMonster.com ASP .Net 0 02-26-2005 10:58 AM
trouble linking dynamically to javascript file in .master file Cold Filtered ASP .Net 0 02-18-2005 11:31 AM
Javascript of Google inside my javascript file Antonio Javascript 2 05-21-2004 02:41 PM



Advertisments