Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Handling a Click Event
Message
 
À
22/11/2003 02:39:36
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00852578
Message ID:
00852613
Vues:
7
>James,
>
>You can't call a server side function from client-side javascript, and you can't call a client-side javascript function from the server. The reason is that all of the server side execution happens _before_ the HTML is sent to the browser.
>
>If you assign the OnClick attribute of an HTML or asp element, the server-side click event is not raised.
>
>What you can do is add your script code to the Response stream during the postback so that it is executed when the HTML is sent to the browser. You can do this with Response.Write or Page.RegisterClientStartupScript.

OK Its kinda what i thought for the state of things. So this line works fine.
e.Item.Attributes.Add("ondblclick", "Javascript:__doPostBack('myDblClick','" & e.Item.ItemIndex & "');")

two more newbie questions.
Is the "__EVENTARGUMENT" only a string or can it be the aurgument object?
e.Item.Attributes.Add("ondblclick", "Javascript:__doPostBack( e );")

I am not familiar with "Page.RegisterClientStartupScript" where can I find info on this?

thanks in advance.
- jim durkin

"The universe is a big place, perhaps the biggest." Kurt Vonnegut
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform