
- Forum
- Programming Talk
- Microsoft .NET
- Call javascript function in C#
Call javascript function in C#
This is a discussion on Call javascript function in C# within the Microsoft .NET forums, part of the Programming Talk category; How can i "Call JavaScript function in C# and C# function or objects id JavaScript"...
-
Call javascript function in C#
How can i "Call JavaScript function in C# and C# function or objects id JavaScript"
-
you can define on click event, then call java script function...
-
Calling Javascript method from Code behindYou can call Javascript functions as a script registered on the codebehind itself but i m not sure about your requirement. Dot net providesPage.RegisterStartupScript("key","value") method.Here, key is the name you want to give the script eg. "PageClose"value is the string .stringBuilder str = new StringBuilder()str.Append("")Then use this in the event handler you want to execute the scriptPage.RegisterStartUp("PageClose",str.ToString());This would place the javascript before the closing tag of the page thats renderedPage.ClientScriptBlock("PageClose",str.ToString());This would place the JS function after the opening
-
any more other ways
-
there are basically 3 methods..
the very basic is to write ur java script into response.write()..
if you want to attachthe script with a web control..then in page load function controlID.attributes.add("Event","script function")
or u can try
page.registerstartupscript()
hope it'll help u out..
All the best
-
Sponsored Ads
«
whats the Use of Storing Sessions external to InProc?
|
i want to upload bulk of files at a time
»

Reply With Quote





