Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Geoff Davis #1
Controls with a client side onLoad function or seting a cursor server side
Is there any way to create a web control that calls a client side
onLoad function?
Its diffucilt since you are not able to access the form or body tags
in the control.
I inherit from:
System.Web.UI.WebControls.WebControl
What I'm really trying to do is set a cursor, i haven't been able to
set it server side only in JavaScript.
Any help would be great.
Geoff Davis Guest
-
flashcom: client side cant access server side
hi all, i hav install the flash com on the PC. It work well, on the server PC, i can access and log in to the 'chat room'.. however, if im... -
Is PHP client-side or server-side?
I'd like to take a look at PHP but the problem is that this far, i've used Java because it doesn't require anything else from the server it's... -
Client side and server side scripting problem
Hiya I have a problem with using some client side and server side scripting together in an ASP. I'm using VBScript. What I'm trying to achieve... -
server-side ASP w/ client -side component
Hello good folks! I need your advice on a project that i am working on. I am integrating a signature pad, a client-side web browser, and my... -
button evet ---- server side - client side ???
I want to use button. My question is that How can use server side and client site event at the same time. That is: I want to use button : when... -
Geoff Davis #2
Re: Controls with a client side onLoad function or seting a cursor server side
I worked it out.
By overiding Render, calling base.Render(output) and then adding to
the HTML output stream i can run a script after the control had been
rendered. Previously i could only run a script before it was rendered
and that meant the control didn't exist yet.
//In custom control (which is a composite control)
protected override void Render(HtmlTextWriter output)
{
//add HTML components to the output stream
base.Render(output);
StringWriter s = new StringWriter();s.WriteLine(@"
<script language='JavaScript'>
document.getElementById('MyControl').style.cursor = 'newCursor.cur';
</script>");
output.WriteLine(s.ToString());
}
[email]geoffrey.davis@csiro.au[/email] (Geoff Davis) wrote in message news:<6dfb2422.0401122159.41c4816f@posting.google. com>...> Is there any way to create a web control that calls a client side
> onLoad function?
>
> Its diffucilt since you are not able to access the form or body tags
> in the control.
>
> I inherit from:
> System.Web.UI.WebControls.WebControl
>
> What I'm really trying to do is set a cursor, i haven't been able to
> set it server side only in JavaScript.
>
> Any help would be great.Geoff Davis Guest
-
Jiho Han #3
Re: Controls with a client side onLoad function or seting a cursor server side
Although that approach is valid, the recommended approach is to use
Page.RegisterStartUpScript method.
Look it up in the SDK doc.
"Geoff Davis" <geoffrey.davis@csiro.au> wrote in message
news:6dfb2422.0401131549.7b421e00@posting.google.c om...news:<6dfb2422.0401122159.41c4816f@posting.google. com>...> I worked it out.
>
> By overiding Render, calling base.Render(output) and then adding to
> the HTML output stream i can run a script after the control had been
> rendered. Previously i could only run a script before it was rendered
> and that meant the control didn't exist yet.
>
> //In custom control (which is a composite control)
> protected override void Render(HtmlTextWriter output)
> {
> //add HTML components to the output stream
> base.Render(output);
>
> StringWriter s = new StringWriter();s.WriteLine(@"
> <script language='JavaScript'>
> document.getElementById('MyControl').style.cursor = 'newCursor.cur';
> </script>");
> output.WriteLine(s.ToString());
> }
>
> [email]geoffrey.davis@csiro.au[/email] (Geoff Davis) wrote in message> > Is there any way to create a web control that calls a client side
> > onLoad function?
> >
> > Its diffucilt since you are not able to access the form or body tags
> > in the control.
> >
> > I inherit from:
> > System.Web.UI.WebControls.WebControl
> >
> > What I'm really trying to do is set a cursor, i haven't been able to
> > set it server side only in JavaScript.
> >
> > Any help would be great.
Jiho Han Guest
-
Geoff Davis #4
Re: Controls with a client side onLoad function or seting a cursor server side
Thanks, I gave it a go,
I wasn't sure if you could register more than one start up script.
I didn't want to make it so I remove the ability for someone using my
control to be able to register a start up script.
but you can register many if you want to.
thanks.
"Jiho Han" <jiho.han@infinityinfo.com> wrote in message news:<eIrPm6q2DHA.2184@TK2MSFTNGP12.phx.gbl>...> Although that approach is valid, the recommended approach is to use
> Page.RegisterStartUpScript method.
> Look it up in the SDK doc.Geoff Davis Guest



Reply With Quote

