Thursday, March 29, 2012

Newbie: Issue with postback

I think I may not understand postback. I thought when you first view page this is not postback, but then it is i.e everytime I hit F5.

This code doesn't appear to work (it always states that the page is not a postback:

<%@dotnet.itags.org.Page Language="VB"%>
<script runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
If Page.IsPostBack Then
Response.write("postback")
Else
Response.write("start")
End If
End Sub
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<html>
<head>
<title>Testing Postback</title>
</head
<body
<form action="postback.aspx">
<input type="submit" name="sub" value="go"/>
</form
</body>
</html
Also, isn't the source of the page supposed to show the encrypted viewstate hidden field. On my page this is not present.

I would be grateful for any tips on where I'm going wrong.

MHitting F5 or refresh DOES NOT cause a postback. If you click a button on the page, THEN you will get a postback.

0 comments:

Post a Comment