Hi everybody,
I tried a simple test with AJAX in ASP.NET page, here is my code:
...
<tr>
<td>Insert a word</td>
<td><asp:TextBox ID="TE_Word" runat="server"
Width="160px"></asp:TextBox></td>
<td><span id="resultText"></span></td>
</tr>
then the script block:
--- script type="text/javascript"
function strToUppercase(){
Matteo.Web.AtlasMusicArchiver.Admin.Prova.StrToUppercase(strToUppercase_callback);
}
function strToUppercase_callback(res)
{
if (res.value==null){
alert(res.error);
return;
}
var resultDiv = document.getElementById('resultText');
if (resultDiv.firstChild)
resultDiv.removeChild(resultDiv.firstChild);
resultDiv.appendChild(document.createTextNode(res.value));
}
--- /script
in the .CS file of the aspx page:
[AjaxPro.AjaxMethod]
public string StrToUppercase()
{
string _result = TE_Word.Text;
return _result;
}
Well, after invoking the function, into my <span> tag, it prints NULL.
So, is it possible to access a TextBox runat="server" (string _result =
TE_Word.Text;)
to get its value?
I hope it's all clear, thanks and regards
interpeo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---