Is it possible link javascript with C# on ASP.net form
ASP.NET
3
Posts
3
Posters
0
Views
1
Watching
-
If you mean how to use a js file in an aspx, it's the same as it's always been - use a tag. If you mean can a js file call an aspx method, then yes - but only through Ajax...the other way round (aspx "calling" js functions), then google for RegisterClientScriptBlock / RegisterStartupScript
"Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox
-
Of course, yes. This is the javascript. function sample(fieldId, title) { if (title == "") title = "Long Description"; document.Form1.submit(); } Code behind: this.btnSubmit.Attributes.Add("OnClick", "javascript:sample()"); rmr
rmr