Hi CW,
AS for getting the new posted value in the textbox , here are some of my
suggestions:
Are you using the asp.net's TextBox server control or the HtmlInputText
control or
a normal <input type=text...> html element ? Anyway, we don't need to
manually post back the viewstate
I think we can check the following things:
1.If you're using the TExtBox server control <asp:TextBox ..> or
HtmlInputText control
<input type=text runat=server...>
we can directly access it via
id in the serverside code behind
2. if he is using normal <input type=text ...> html element, we can
access it's new postd value in the Request.Form collection
for example , if we have the following textbox in th form,
<input type=text name="username" >
Then,when the page is post back, we can use the Request.Form["username"] to
get its value.
#note that request.Form collection will identify the different items via
their "name" attribute in the html
In addition, make sure that the TextBox or <input type=text ..> are within
the <form > tag. And here is a simple test page which put some textboxes on
it and access their value when post back , you may also have a test:
=========aspx page=======================
<HTML>
<HEAD>
<title>postbackscript</title>
<script language="javascript">
function autopost()
{
window.setTimeout("document.forms[0].submit()",2000);
}
</script>
</HEAD>
<body onload="autopost();">
<form id="Form1" method="post" runat="server">
<table width="100%" align="center">
<tr>
<td height="21">
<asp:TextBox id="txtServer" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td><INPUT id="txtInputText" type="text" size="1" name="txtInputText"
runat="server"></td>
</tr>
<tr>
<td><INPUT id="txtNormalInput" type="text" name="txtNormalInput"></td>
</tr>
</table>
</form>
</body>
</HTML>
===============code behind==========================
public class postbackscript : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox txtServer;
protected System.Web.UI.HtmlControls.HtmlInputText txtInputText;
private void Page_Load(object sender, System.EventArgs e)
{
if(IsPostBack)
{
Response.Write("<br>Page is post back at: " +
DateTime.Now.ToLongTimeString());
Response.Write("<br>txtServer's post value is: " + txtServer.Text);
Response.Write("<br>txtInputText's post value is: " +
txtInputText.Value);
Response.Write("<br>txtNormalInput's post value is: " +
Request.Form["txtNormalInput"]);
}
}
.................................
}
==================================
Hope helps. If you still have anything unclear, please feel free to post
here. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)