|
AJAX test with ASP.NET -- interpeo --
Hi everybody, I tried a simple test with AJAX in ASP.NET page, here is my code: ... | |||
| Insert a word | |||
|
-- "Zihotki --
You shoud use JS t get a value and pass it to server like this: function strToUppercase(){ var textbox = document.getElementById(TE_Word); Matteo.Web.AtlasMusicArchiver.Admin.Prova.StrToUppercase(textbox.value, strToUppercase_callback); } and in the .CS file of the aspx page: public string StrToUppercase(string text) { string _result = text+", hello from server"; return _result; } ASP.Net components are not accessible from AjaxPro methods because page life cycle is not occur. | |||
|
-- lawson law --
interpeo, just include a parameter for your strToUppercase() like this strToUppercase(TE_WordValue) Where TE_WordValue is the value for TE_Word. The trick is you should generate TE_WordValue in the Page_Load routine of your cs file. -- Js --- function strToUppercase(TE_WordValue){ Matteo.Web.AtlasMusicArchiver.Admin.Prova.StrToUppercase(TE_WordValue, strToUppercase_callback); } -- Web form | |||
| Insert a word | |||
| Insert a word | |||
|
-- interpeo --
ok Zihotki and Lawson thanks a lot, I'll try your suggests and will let u know. interpeo | |||
|
-- interpeo --
Hi, ok, I solved the issue with the following code, and it works! ====== .aspx file ... | |||
| Insert a word | onclick="strToUppercase()" /> |