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. AJAX problem [modified]

AJAX problem [modified]

Scheduled Pinned Locked Moved ASP.NET
helpcsharpquestionjavascript
5 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.
  • V Offline
    V Offline
    Vipin d
    wrote on last edited by
    #1

    hi Friends, I am developing one web application in MS.NET 2005 and using some AJAX with the help of Ajax.dll(download from this site http://ajax.schwarz-interactive.de/csharpsample/default.aspx) Also I am new to this AJAX wrold. my doubt is through ajax we can enable or hide panal or assign value to textbox control from c# code.?? Means I have a code behind function in c# like [Ajax.AjaxMethod] public string ChangeMe() { if (DrpDelMode.SelectedValue == "B") { Pnlcounter.Visible = false; PnlBankDet.Visible = true; TxtPaymentDetails.text="show bank" } else { Pnlcounter.Visible = true; PnlBankDet.Visible = false; TxtPaymentDetails. text="show Counter" } return "Hai Ajax"; } Onchange event of a dropdwon control i can invoke a JS function function showpanle() { alert('ha1'); showpanel.ChangeMe(callback_Show); } function callback_Show(res) { document.getElementById("TxtName").innerText = res.value ; } in this above piece of code alert wrking fine and document.getElementById("TxtPaymentDetails").innerText value is null and assign value to TxtPaymentDetails textbox and panle visiblity settings are also not wroking. how can i can solve this issue? or is it my Ajax.dll's probelm if I comment the IF Else section in ChangeMe() function it is working.Means " Hai Ajax" shown in TxtName textbox. -- modified at 2:54 Monday 17th September, 2007

    All I ever wanted is what others have....
    CrazySanker

    V P 2 Replies Last reply
    0
    • V Vipin d

      hi Friends, I am developing one web application in MS.NET 2005 and using some AJAX with the help of Ajax.dll(download from this site http://ajax.schwarz-interactive.de/csharpsample/default.aspx) Also I am new to this AJAX wrold. my doubt is through ajax we can enable or hide panal or assign value to textbox control from c# code.?? Means I have a code behind function in c# like [Ajax.AjaxMethod] public string ChangeMe() { if (DrpDelMode.SelectedValue == "B") { Pnlcounter.Visible = false; PnlBankDet.Visible = true; TxtPaymentDetails.text="show bank" } else { Pnlcounter.Visible = true; PnlBankDet.Visible = false; TxtPaymentDetails. text="show Counter" } return "Hai Ajax"; } Onchange event of a dropdwon control i can invoke a JS function function showpanle() { alert('ha1'); showpanel.ChangeMe(callback_Show); } function callback_Show(res) { document.getElementById("TxtName").innerText = res.value ; } in this above piece of code alert wrking fine and document.getElementById("TxtPaymentDetails").innerText value is null and assign value to TxtPaymentDetails textbox and panle visiblity settings are also not wroking. how can i can solve this issue? or is it my Ajax.dll's probelm if I comment the IF Else section in ChangeMe() function it is working.Means " Hai Ajax" shown in TxtName textbox. -- modified at 2:54 Monday 17th September, 2007

      All I ever wanted is what others have....
      CrazySanker

      V Offline
      V Offline
      varshavmane
      wrote on last edited by
      #2

      Make this document.getElementById("TxtName").value Instead of document.getElementById("TxtName").innerText

      V 1 Reply Last reply
      0
      • V Vipin d

        hi Friends, I am developing one web application in MS.NET 2005 and using some AJAX with the help of Ajax.dll(download from this site http://ajax.schwarz-interactive.de/csharpsample/default.aspx) Also I am new to this AJAX wrold. my doubt is through ajax we can enable or hide panal or assign value to textbox control from c# code.?? Means I have a code behind function in c# like [Ajax.AjaxMethod] public string ChangeMe() { if (DrpDelMode.SelectedValue == "B") { Pnlcounter.Visible = false; PnlBankDet.Visible = true; TxtPaymentDetails.text="show bank" } else { Pnlcounter.Visible = true; PnlBankDet.Visible = false; TxtPaymentDetails. text="show Counter" } return "Hai Ajax"; } Onchange event of a dropdwon control i can invoke a JS function function showpanle() { alert('ha1'); showpanel.ChangeMe(callback_Show); } function callback_Show(res) { document.getElementById("TxtName").innerText = res.value ; } in this above piece of code alert wrking fine and document.getElementById("TxtPaymentDetails").innerText value is null and assign value to TxtPaymentDetails textbox and panle visiblity settings are also not wroking. how can i can solve this issue? or is it my Ajax.dll's probelm if I comment the IF Else section in ChangeMe() function it is working.Means " Hai Ajax" shown in TxtName textbox. -- modified at 2:54 Monday 17th September, 2007

        All I ever wanted is what others have....
        CrazySanker

        P Offline
        P Offline
        Parwej Ahamad
        wrote on last edited by
        #3

        Can you clerify that method function callback_Show(res) fire or not ?

        Parwej Ahamad g.parwez@gmail.com

        V 1 Reply Last reply
        0
        • V varshavmane

          Make this document.getElementById("TxtName").value Instead of document.getElementById("TxtName").innerText

          V Offline
          V Offline
          Vipin d
          wrote on last edited by
          #4

          thankx for your kind reply. But visisblity seetings of the panel and assign value to TxtPaymentDetails is also not working!!

          All I ever wanted is what others have....
          CrazySanker

          1 Reply Last reply
          0
          • P Parwej Ahamad

            Can you clerify that method function callback_Show(res) fire or not ?

            Parwej Ahamad g.parwez@gmail.com

            V Offline
            V Offline
            Vipin d
            wrote on last edited by
            #5

            I think it is firing. why because in both case some value assigned to TxtName.TEXT textbox. Means if i comment the IF-Else condition section in ChangeMe()(c#code) function "Hai Ajax" value is assigning to TxtName otherwise NULL value came to it.

            All I ever wanted is what others have....
            CrazySanker

            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