Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. javascript

javascript

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netdata-structurestutorial
10 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kirthikirthi
    wrote on last edited by
    #1

    HI Is it posible to call asp.net function in javascript Example - i have a javascript function in that i want to call the asp.net values var customarray=new Array('in this i want to call asp.net values' ); var custom2 = new Array('something','randomly','different'); Than Q Keerthi

    S C G M 4 Replies Last reply
    0
    • K kirthikirthi

      HI Is it posible to call asp.net function in javascript Example - i have a javascript function in that i want to call the asp.net values var customarray=new Array('in this i want to call asp.net values' ); var custom2 = new Array('something','randomly','different'); Than Q Keerthi

      S Offline
      S Offline
      Sun Rays
      wrote on last edited by
      #2

      Hi, clarify it.

      Thanks, Sun Rays To get something you must have to try once. My Articles

      1 Reply Last reply
      0
      • K kirthikirthi

        HI Is it posible to call asp.net function in javascript Example - i have a javascript function in that i want to call the asp.net values var customarray=new Array('in this i want to call asp.net values' ); var custom2 = new Array('something','randomly','different'); Than Q Keerthi

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        You can do this with AJAX, or you can write the values you want into the script as variables.

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        K 1 Reply Last reply
        0
        • C Christian Graus

          You can do this with AJAX, or you can write the values you want into the script as variables.

          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          K Offline
          K Offline
          kirthikirthi
          wrote on last edited by
          #4

          Thx For reply my need is i have a javascript array in that array i want put asp.net array values For Example : ------------------ in the place of 'an apple','alligator','elephant','pear' etc.. i want to put asp.net array values var customarray=new Array('an apple','alligator','elephant','pear','kingbird','kingbolt', 'kingcraft','kingcup','kingdom','kingfisher','kingpin'); var custom2 = new Array('something','randomly','different'); Keerthi

          C S 3 Replies Last reply
          0
          • K kirthikirthi

            Thx For reply my need is i have a javascript array in that array i want put asp.net array values For Example : ------------------ in the place of 'an apple','alligator','elephant','pear' etc.. i want to put asp.net array values var customarray=new Array('an apple','alligator','elephant','pear','kingbird','kingbolt', 'kingcraft','kingcup','kingdom','kingfisher','kingpin'); var custom2 = new Array('something','randomly','different'); Keerthi

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            OK, in this case, just write the values into your javascript from the code behind, no need to call it with AJAX, if the values are known, just pass them through.

            Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            1 Reply Last reply
            0
            • K kirthikirthi

              Thx For reply my need is i have a javascript array in that array i want put asp.net array values For Example : ------------------ in the place of 'an apple','alligator','elephant','pear' etc.. i want to put asp.net array values var customarray=new Array('an apple','alligator','elephant','pear','kingbird','kingbolt', 'kingcraft','kingcup','kingdom','kingfisher','kingpin'); var custom2 = new Array('something','randomly','different'); Keerthi

              S Offline
              S Offline
              sulabh2020
              wrote on last edited by
              #6

              Hi dear, It is Possible to call c# function through javascript. Please go through google, if again not able to find. plz write me at personalmail@mysampatti.com By

              Hello Forum Always be in touch to help about the topic ASP.NET

              1 Reply Last reply
              0
              • K kirthikirthi

                HI Is it posible to call asp.net function in javascript Example - i have a javascript function in that i want to call the asp.net values var customarray=new Array('in this i want to call asp.net values' ); var custom2 = new Array('something','randomly','different'); Than Q Keerthi

                G Offline
                G Offline
                Gandalf_TheWhite
                wrote on last edited by
                #7

                Hi Kirthi, It is possible To Do what u have asked : Just Look At The Example given Below. Here I have Passed The Values That I Get From TextBox This Code U have To Write In Ur ASPX Page var cal = new CalendarPopup(); cal.showNavigationDropdowns(); And This IsWhat i have written in my Saprate Javascript File This Is A Function function stepvalidation1(txtdate1,txtdate2,txtdatenow) { var flag=0; var dt1=document.getElementById(txtdate1); var dt2=document.getElementById(txtdate2); if (isDate(dt1.value)==false) { dt1.focus(); flag=1; } else { if(step3validation(txtdate1,0,txtdatenow)) { } else { flag=1; } } if (isDate(dt2.value)==false) { dt2.focus(); flag=1; } else { if(step3validation(txtdate2,0,txtdatenow)) { } else { flag=1; } } if(flag>0) { return false; } else { return true; } } and this is the line tht i have written in my .cs File btn_Update.Attributes.Add("onclick", "javascript:return stepvalidation1('" + date1.ClientID.ToString()+ "','" + date2.ClientID.ToString()+ "','" + System.DateTime.Now.ToShortDateString() + "');"); I think This Can Help If Any doubt on the above then Ask

                Just Do IT™ [Information Technology]™ :->

                K 1 Reply Last reply
                0
                • K kirthikirthi

                  Thx For reply my need is i have a javascript array in that array i want put asp.net array values For Example : ------------------ in the place of 'an apple','alligator','elephant','pear' etc.. i want to put asp.net array values var customarray=new Array('an apple','alligator','elephant','pear','kingbird','kingbolt', 'kingcraft','kingcup','kingdom','kingfisher','kingpin'); var custom2 = new Array('something','randomly','different'); Keerthi

                  S Offline
                  S Offline
                  sulabh2020
                  wrote on last edited by
                  #8

                  u van also try by this trick document.getElementbyId(HiddenButton).Click;

                  Hello Forum Always be in touch to help about the topic ASP.NET

                  1 Reply Last reply
                  0
                  • G Gandalf_TheWhite

                    Hi Kirthi, It is possible To Do what u have asked : Just Look At The Example given Below. Here I have Passed The Values That I Get From TextBox This Code U have To Write In Ur ASPX Page var cal = new CalendarPopup(); cal.showNavigationDropdowns(); And This IsWhat i have written in my Saprate Javascript File This Is A Function function stepvalidation1(txtdate1,txtdate2,txtdatenow) { var flag=0; var dt1=document.getElementById(txtdate1); var dt2=document.getElementById(txtdate2); if (isDate(dt1.value)==false) { dt1.focus(); flag=1; } else { if(step3validation(txtdate1,0,txtdatenow)) { } else { flag=1; } } if (isDate(dt2.value)==false) { dt2.focus(); flag=1; } else { if(step3validation(txtdate2,0,txtdatenow)) { } else { flag=1; } } if(flag>0) { return false; } else { return true; } } and this is the line tht i have written in my .cs File btn_Update.Attributes.Add("onclick", "javascript:return stepvalidation1('" + date1.ClientID.ToString()+ "','" + date2.ClientID.ToString()+ "','" + System.DateTime.Now.ToShortDateString() + "');"); I think This Can Help If Any doubt on the above then Ask

                    Just Do IT™ [Information Technology]™ :->

                    K Offline
                    K Offline
                    kirthikirthi
                    wrote on last edited by
                    #9

                    HI than Q it is working fine but in my web page i am binding values to a array. that array values i want to pass in javascript. var customarray=new Array(---- asp.net array values ------- + 'alligator','elephant','pear','kingbird','kingbolt', 'kingcraft','kingcup','kingdom','kingfisher','kingpin'); Keerthi

                    1 Reply Last reply
                    0
                    • K kirthikirthi

                      HI Is it posible to call asp.net function in javascript Example - i have a javascript function in that i want to call the asp.net values var customarray=new Array('in this i want to call asp.net values' ); var custom2 = new Array('something','randomly','different'); Than Q Keerthi

                      M Offline
                      M Offline
                      Manikandan net
                      wrote on last edited by
                      #10

                      Yes you can do this I assume that u have a method in code behind which returns string, write a logic to return string in following format Vaue1, value2, value3 SERVER Method(code behind): public string GetCommaSepratedUserNames() { //write u r logic here, instead of my sample return "'Manikandan.net, Prem.telecom, someName.Asp'"; } Here value1, value2, value3 are your desired values, which u want to return from server. Write the java script like bellow: <script> var customarray=new Array(<%=GetCommaSepratedUserNames()%>); var custom2 = new Array('something','randomly','different'); </script>

                      Manikandan.net [Coding is life]

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups