Ask a Question related to ASP.NET Building Controls, Design and Development.
-
John Saunders #1
Re: Sending Client Side Event ?
"Genival" <geniobr@hotmail.com> wrote in message
news:e1x0bIOdDHA.2804@TK2MSFTNGP11.phx.gbl...You can't quite do this. The only thing your control can do is to send data> Hello Folks...
> From my control i need notify client side script about some events occurs.
> Any idea ?
(usually HTML) to the client.
Now, you may be able to send some HTML to the client which will cause some
client script to execute. For instance, you could have a control called
Alarm which would take its "Text" property and render script as follows:
protected override void OnPreRender(EventArgs e)
{
const scriptStart = "<script language=JavaScript>alert('";
const scriptEnd = "');</script>";
this.Page.RegisterStartupScript(this.UniqueID, scriptStart + this.Text +
scriptEnd);
}
This script would execute once the page was loaded, because it will be
emitted right before the closing </form> tag. You can also emit script right
after the opening <form> tag with Page.RegisterClientScriptBlock.
--
John Saunders
Internet Engineer
[email]john.saunders@surfcontrol.com[/email]
John Saunders Guest
-
Stopping client side event validation
Hi all, I've been trying unsuccessfully to stop client side event validation. I've created a simple page with a text box, a required field... -
Client side event for datagrid control
This is probably a simple one, but I cannot seem to find an example. I have a datagrid with each row containing Checkbox | Textbox |... -
client side event for grid
This is probably a simple one, but I cannot seem to find an example. I have a datagrid with each row containing Checkbox | Textbox |... -
client side checkbox event
This is probably a simple one, but I cannot seem to find an example. I have a datagrid with each row containing Checkbox | Textbox |... -
running client side script after an <asp:ButtonColumn> click event
"z. f." wrote Get a reference to the delete button in the ItemCreated event of your datagrid, then use: btnDelete.Attributes.Add("onclick",... -
Genival #2
Re: Sending Client Side Event ?
Thank John..
Another question : Is possible to put my script inside <HEAD>...</HEAD>
block ?
Regards
Genival Carvalho.
"John Saunders" <john.saunders@surfcontrol.com> escreveu na mensagem
news:OL$RpqYdDHA.828@TK2MSFTNGP11.phx.gbl...occurs.> "Genival" <geniobr@hotmail.com> wrote in message
> news:e1x0bIOdDHA.2804@TK2MSFTNGP11.phx.gbl...> > Hello Folks...
> > From my control i need notify client side script about some eventsdata>> > Any idea ?
> You can't quite do this. The only thing your control can do is to send+> (usually HTML) to the client.
>
> Now, you may be able to send some HTML to the client which will cause some
> client script to execute. For instance, you could have a control called
> Alarm which would take its "Text" property and render script as follows:
>
> protected override void OnPreRender(EventArgs e)
> {
> const scriptStart = "<script language=JavaScript>alert('";
> const scriptEnd = "');</script>";
>
> this.Page.RegisterStartupScript(this.UniqueID, scriptStart + this.Textright> scriptEnd);
> }
>
> This script would execute once the page was loaded, because it will be
> emitted right before the closing </form> tag. You can also emit script> after the opening <form> tag with Page.RegisterClientScriptBlock.
> --
> John Saunders
> Internet Engineer
> [email]john.saunders@surfcontrol.com[/email]
>
>
Genival Guest
-
Jimmy [Used-Disks] #3
Re: Sending Client Side Event ?
"Genival" <geniobr@hotmail.com> wrote in message
news:Oqa0tOZdDHA.3464@TK2MSFTNGP11.phx.gbl...Though it may be possible, why would you do it?> Thank John..
> Another question : Is possible to put my script inside <HEAD>...</HEAD>
> block ?
--
-Jimmy
Used-Disks:
[url]http://www.used-disks.com/[/url]
Jimmy [Used-Disks] Guest



Reply With Quote

