Problem with PostBack (ViewState lost?)

S

smamail

Hi, I have two servers that behave differently (WIn2003, WinXP), when I
open pages on both servers first time the button on the page appears with
it's caption set to "Test" and then after postback on one of servers
(WinXP) it appears with caption "Test" as it should do and on Win2K3-IIS6
it appears with caption "Button"

Can someone tell me what's the problem?

Here is my code (VS.NET2003-VB.NET Web Application)
<!-Global.asax.vb-->
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
Session("a") = 1
End Sub

<!--Webform1.aspx-->
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1"
enableSessionState=true%>
<body>
<%=Session("a")%>
<form id="Form1" method="post" runat="server">
<asp:Button id=Button1 runat="server" Text="Button"></asp:Button>
</form>
</body>
</HTML>

<!--Webform1.aspx.vb-->
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Session("a") += 1
If Not IsPostBack Then Button1.Text = "test"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top