AJAX problem [modified]
-
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 functionfunction 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, 2007All I ever wanted is what others have....
CrazySanker -
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 functionfunction 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, 2007All I ever wanted is what others have....
CrazySankerMake this document.getElementById("TxtName").value Instead of document.getElementById("TxtName").innerText
-
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 functionfunction 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, 2007All I ever wanted is what others have....
CrazySankerCan you clerify that method function callback_Show(res) fire or not ?
Parwej Ahamad g.parwez@gmail.com
-
Make this document.getElementById("TxtName").value Instead of document.getElementById("TxtName").innerText
-
Can you clerify that method function callback_Show(res) fire or not ?
Parwej Ahamad g.parwez@gmail.com
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