Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HTML/JScript in WebForms?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Divers
Thread ID:
00761405
Message ID:
00765747
Vues:
16
Sebastian

You can execute javascript code to run when the page is posted back. Here is an example of having another window popup when the page is returned:
Dim sUrl As String = "MyHelp.aspx"
Dim sFeatures As String = "'height=320;width=160;left=100;top=50'"

' Create a client script to open the window
Dim sScript As String
sScript &= "<script language=javascript>"
sScript &= "window.open('" & sUrl & "',''," & sFeatures & ");"
sScript &= "</script>"

' Write it into the output stream for immediate execution
Response.Write(sScript)
>Hi, Cathi!
>
>>>
>For sample code on how to do this look at message #710745
><<
>
>I've tried the given issues - and it works great!
>
>But now I've an additional question about the Attributes stuff:
>
>I can use code like
> Button1.Attributes.Add("onClick", "JavaScript:Button1_onClick()")
>to add the OnClick stuff to Button1.
>
>I tried also
> Page.Attributes.Add("onLoad", "JavaScript:onClick()")???
>
>This line of code doesn't work because there is no Page.attributes collection!!!
>
>Is there any way to do the same thing with Page attributes like button attributes?
>
>TIA
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform