Re: ASP.NET Causing execution of JavaScript on the client side
From: Shailesh Ratadia (shaileshdr_at_hotmail.com)
Date: 05/19/04
- Next message: Jeff Tolman: "Copy Project Issue"
- Previous message: Henri: "Prevent tag properties automaticaly generated by ASP.NET"
- In reply to: Alex Maghen: "ASP.NET Causing execution of JavaScript on the client side"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 19 May 2004 16:36:06 -0700
Hi Alex,
I am not sure what is the most elegant way of doing this. However, one of
the ways I can think of doing this is:
When you meet the condition where you need to execute the client side
script, you can redirect to your page with some parameter in the url. Then,
in your client side script, see if that parameter exists in the url
(document.url), you can execute your script.
Hope that helps.
-Shailesh
"Alex Maghen" <alex@maghen.com> wrote in message
news:45720015-43A5-46C4-B6B2-A75272B23F90@microsoft.com...
> I have an ASPX with a code-behind page. The ASPX has a client-side script
block with a JavaScript function defined in it. I need to be able to write
.CS code in my code-behind file that will, under certain circumstances,
cause the client-side JavaScript function to execute when the page loads.
>
> I can think of some bizarre ways of doing this such as somehow editing the
<BODY> tag in ASP.NET to inser the OnLoad Attribute when I do want the
JavaScript function to execute (though I don't know quite how to do this -
do I have to set the BODY tag as runat="server" and then how to I access
that "object" from the code-behind?).
>
> Or is there a more elegant way that ASP.NET has to support server-side
"control" of client-side scripting.
>
> Help?
>
> Alex
- Next message: Jeff Tolman: "Copy Project Issue"
- Previous message: Henri: "Prevent tag properties automaticaly generated by ASP.NET"
- In reply to: Alex Maghen: "ASP.NET Causing execution of JavaScript on the client side"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|