JQuery Carosellite and cycle and parameter from c# -
I am using jquery Carosellite and Cycle to display images like frames. How to pass value to properties, such as speed, visual ect, codebehind (c #)
Pre-HTML code:
& lt; Script type = "text / javascript" language = "javascript" & gt; JCarouselLite ({btnNext: ".next", btnPrev: ".prev", View: 1, Scroll: 1, Speed: 1000});}) & Lt / Script>
Geeta.
if you The ASP mix does not like the .NET code. You can also mark-up your markup:
Markup:
& asp: HiddenField runat = "server" id = " Hfvisible "Value =" true "/> asp: HiddenField runat =" server "id =" hfSpeed "value =" 1000 "/>
javascript: />
$ (function () {$ (". Anyclass"). JCarouselLite ({btnNext: ".next", btnPrev: ".prev", visible: $ ('# HF Visual') .val (), scroll: 1, speed: $ ('# HFSPEd '). Val ();});});
Behind the code:
Safe override zero atel (EventArgs e) {hfVisible. Value = true; HfSpeed.Value = 1000;}
Note: If HideFields are on a UserControl, do not use id to reference elements, use Class instead , Or other features; Or to avoid this: Use RegisterHiddenField:
ClientScriptManager cs = Page.ClientScript; // Enter the hidden field with the page class. Cs.RegisterHiddenField ('hfVisible', "false"); Cs.RegisterHiddenField ('hfSpeed', "1000");
In this way, you do not need to declare hitfield in the markup.
Comments
Post a Comment