Board index » Web Programming » stategically place javascript???

stategically place javascript???

Web Programming117
Is there any way to to build javascrip on the client and place it exactly

where I want it in the html?



--

Dave


-
 

Re:stategically place javascript???

this is all client stuff, why post to a server dev group?



Anyway, just put in a <span>or <div>tag and have the clientside code write

to that ID.



Please followup in a clientside/javascript group.



--

Curt Christianson

Owner/Lead Developer, DF-Software

Site: www.Darkfalz.com">www.Darkfalz.com

Blog: blog.Darkfalz.com">blog.Darkfalz.com





"DaveF" <dfetrow@geodecisions.com>wrote in message

Quote
Is there any way to to build javascrip on the client and place it exactly

where I want it in the html?



--

Dave









-

Re:stategically place javascript???

slap in a container and add your JavaScript as a LiteralControl. A panel is

as good an object as any (writes out as a <span>tag).



Panel1.Controls.Add(new LiteralControl("my javascript block");





--

Gregory A. Beamer

MVP; MCP: +I, SE, SD, DBA



************************************************

Think Outside the Box!

************************************************

"DaveF" <dfetrow@geodecisions.com>wrote in message

Quote
Is there any way to to build javascrip on the client and place it exactly

where I want it in the html?



--

Dave









-

Re:stategically place javascript???

RegisterClientScriptBlock: places the script right after the <form>

RegisterStartupScript: places the script before </form>(after all controls)



to place it anywhere else, use a placeholder control, say



<head runat=server id=header>

</head>



then using the generic control, add script:



HtmlGenericControl sc = new HtmlGenericControl("script");

sc.InnerHtml = javascriptCode;

header.Controls.Add(sc);





-- bruce (sqlwork.com)





"DaveF" <dfetrow@geodecisions.com>wrote in message

Quote
Is there any way to to build javascrip on the client and place it exactly

where I want it in the html?



--

Dave









-

Re:stategically place javascript???

Thanks for the ideas. Basically I am trying to build a Tree structure with

multiple branches. It has LOTS of data. It is a skills matrix. I am woried

about it being slow. What is the best practice to code this. It almost seems

like old asp do while would be faster?



--





David Fetrow

Helixpoint LLC.

www.helixpoint.com">www.helixpoint.com

davef@helixpoint.com

"bruce barker" <nospam_brubar@safeco.com>wrote in message

Quote
RegisterClientScriptBlock: places the script right after the <form>

RegisterStartupScript: places the script before </form>(after all

controls)



to place it anywhere else, use a placeholder control, say



<head runat=server id=header>

</head>



then using the generic control, add script:



HtmlGenericControl sc = new HtmlGenericControl("script");

sc.InnerHtml = javascriptCode;

header.Controls.Add(sc);





-- bruce (sqlwork.com)





"DaveF" <dfetrow@geodecisions.com>wrote in message

news:uzPduu0QEHA.2716@tk2msftngp13.phx.gbl...

>Is there any way to to build javascrip on the client and place it

exactly

>where I want it in the html?

>

>--

>Dave

>

>









-

Re:stategically place javascript???

I highly doubt ASP will be any faster - after all, it would be doing the

exact same thing, just in a different way maybe.



If you are sending tons of stuff to the client, that has tons of

javascript - then that will always be slow, the burden will be on the client

browser. I wouldn't worry about the actual act of writing javascript.



"DaveF" <dfetrow@geodecisions.com>wrote in message

Quote
Thanks for the ideas. Basically I am trying to build a Tree structure with

multiple branches. It has LOTS of data. It is a skills matrix. I am woried

about it being slow. What is the best practice to code this. It almost

seems

like old asp do while would be faster?



--





David Fetrow

Helixpoint LLC.

www.helixpoint.com">www.helixpoint.com

davef@helixpoint.com

"bruce barker" <nospam_brubar@safeco.com>wrote in message

news:%23lNa$A1QEHA.628@TK2MSFTNGP11.phx.gbl...

>RegisterClientScriptBlock: places the script right after the <form>

>RegisterStartupScript: places the script before </form>(after all

controls)

>

>to place it anywhere else, use a placeholder control, say

>

><head runat=server id=header>

></head>

>

>then using the generic control, add script:

>

>HtmlGenericControl sc = new HtmlGenericControl("script");

>sc.InnerHtml = javascriptCode;

>header.Controls.Add(sc);

>

>

>-- bruce (sqlwork.com)

>

>

>"DaveF" <dfetrow@geodecisions.com>wrote in message

>news:uzPduu0QEHA.2716@tk2msftngp13.phx.gbl...

>>Is there any way to to build javascrip on the client and place it

exactly

>>where I want it in the html?

>>

>>--

>>Dave

>>

>>

>

>









-