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. Events in ASP.NET Page

Events in ASP.NET Page

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-nettutorialquestion
6 Posts 3 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
    Kit Fisto
    wrote on last edited by
    #1

    Hi everyone. I'm building a web portal and i have a question. I want to add the content of two TextBoxes in one page and show the result in another textbox, but i don't want the textchange event to make postback because the page has a lot of controls and data. I think i have to make a javascript function for that but i dont know how to raise the events on the client side and i dont know how to pass the controls into the the javascript function so that i can some the values. Thanks programing brothers. :-D

    P G 2 Replies Last reply
    0
    • K Kit Fisto

      Hi everyone. I'm building a web portal and i have a question. I want to add the content of two TextBoxes in one page and show the result in another textbox, but i don't want the textchange event to make postback because the page has a lot of controls and data. I think i have to make a javascript function for that but i dont know how to raise the events on the client side and i dont know how to pass the controls into the the javascript function so that i can some the values. Thanks programing brothers. :-D

      P Offline
      P Offline
      Paddy Boyd
      wrote on last edited by
      #2

      So maybe a google for a javascript tutorial might be reasonable next step...

      K 1 Reply Last reply
      0
      • K Kit Fisto

        Hi everyone. I'm building a web portal and i have a question. I want to add the content of two TextBoxes in one page and show the result in another textbox, but i don't want the textchange event to make postback because the page has a lot of controls and data. I think i have to make a javascript function for that but i dont know how to raise the events on the client side and i dont know how to pass the controls into the the javascript function so that i can some the values. Thanks programing brothers. :-D

        G Offline
        G Offline
        Gaurav K Singh
        wrote on last edited by
        #3

        many option for your question. (1)If you want to add textboxes content on server: Make autopostback property of both the textbox is false. when you submit form the textchange event raise first then button click event raised. (2) If you want to add textbox content in client: Then you must write javascript like this. function add() { document.getElementbyId("Textbox3").value=document.getElementbyId("Textbox1").value + document.getElementbyId("Textbox2").value } you can call this function on lostFocus of textbox2. One thing note down, Asp.net changes the ID and name of the control specailly when master paged are used. Check control ID from output of the page from(view\pagesource)and use that id in place of textbox1 2 or 3.

        The miracle is this--the more we share, the more we have.

        K 1 Reply Last reply
        0
        • P Paddy Boyd

          So maybe a google for a javascript tutorial might be reasonable next step...

          K Offline
          K Offline
          Kit Fisto
          wrote on last edited by
          #4

          I have already done that reasonable step before i post my question here LOL. But i couldn't understand so i decided to ask you guys because i think that codeproject is one of the best sources of programming ideas and knowledge.

          1 Reply Last reply
          0
          • G Gaurav K Singh

            many option for your question. (1)If you want to add textboxes content on server: Make autopostback property of both the textbox is false. when you submit form the textchange event raise first then button click event raised. (2) If you want to add textbox content in client: Then you must write javascript like this. function add() { document.getElementbyId("Textbox3").value=document.getElementbyId("Textbox1").value + document.getElementbyId("Textbox2").value } you can call this function on lostFocus of textbox2. One thing note down, Asp.net changes the ID and name of the control specailly when master paged are used. Check control ID from output of the page from(view\pagesource)and use that id in place of textbox1 2 or 3.

            The miracle is this--the more we share, the more we have.

            K Offline
            K Offline
            Kit Fisto
            wrote on last edited by
            #5

            Cool i understood that thanks, but what about raise events in the client side? I don't want a postback to happen, I wish only to execute an action on the client-side when a textBox is changed. By the way, the textbox is in a FormView, within a UpdatePanel, on a page that has a MasterPage.

            G 1 Reply Last reply
            0
            • K Kit Fisto

              Cool i understood that thanks, but what about raise events in the client side? I don't want a postback to happen, I wish only to execute an action on the client-side when a textBox is changed. By the way, the textbox is in a FormView, within a UpdatePanel, on a page that has a MasterPage.

              G Offline
              G Offline
              Gaurav K Singh
              wrote on last edited by
              #6

              If you want to use javascript, my suggestion is use html textbox, menas make it run at server. Now you can find lots of event. You can use control and event like this If you use master pages, Update panels etc the again, first check the name of the control from (view\source)in IE.

              The miracle is this--the more we share, the more we have.

              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