Well, the only thing I changed for the text box is allow postback b/c I need to execute onChange event. I know the value is not being cached.
I create a new website and it still does not work. Below are a simple aspx and aspx.
vb code:
<%@ Page Language="
VB" AutoEventWireup="false" CodeFile="Default.aspx.
vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript" >
function cleartxt(txtBox)
{
document.getElementById(txtBox).value = "";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True"></asp:TextBox>
<input id="Button1" type="button" value="Clear" onclick="cleartxt('TextBox1');" /><br />
<asp:TextBox ID="TextBox2" runat="server" AutoPostBack="True"></asp:TextBox><input id="Button2" type="button"
value="Clear" onclick="cleartxt('TextBox2');"/><br />
<asp:Button ID="Button3" runat="server" Text="Add"/></div>
</form>
</body>
</html>
vb code:
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
'**do something and set new value
TextBox1.Text = "NEW VALUE1"
End Sub
Protected Sub TextBox2_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
'**do something and set new value
TextBox2.Text = "NEW VALUE2"
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
'**Peform some action with input values
Response.Write(TextBox1.Text)
End Sub
End Class
After I entered in both text box, I clear the first text box and click add and textbox1 is still not blank.
I'm not familiar with MS AJAX but I will take a look at it.
Thanks!
Peter