A
AlexC
Hi,
i have just read some threads about viewstate and wanted to test myself. But
there must be something i don't undertstand, because when i submit the form
with EnableViewState="false", i get the values back.
It seems that EnableViewState="false" has no influence because 'false' or
'true', it does not make any difference.
I thought that with 'false', i wouldn't get the values back.
Please look at the code here:
Thanks you
AlexC
<%@ Page Language="VB" EnableViewState="false" AutoEventWireup="false"
CodeFile="test.aspx.vb" Inherits="test" %>
<form id="frmViewState" runat="server">
Typ your name:
<asp:TextBox id="txtName" runat="server" />
Take a color:
<aspropDownList id="ddlColor" runat="server">
<asp:ListItem>Red</asp:ListItem>
<asp:ListItem>Blue</asp:ListItem>
<asp:ListItem>Yelowl</asp:ListItem>
</aspropDownList>
<asp:button id="btnSubmit" text="submit"
onClick="btnSubmit_Click" runat="server" />
</form>
the code is:
Sub btnSubmit_Click(ByVal Sender As Object, ByVal E As EventArgs)
lblSentence.Text = txtName.Text & " selecteerde " _
& ddlColor.SelectedItem.Text
End Sub
i have just read some threads about viewstate and wanted to test myself. But
there must be something i don't undertstand, because when i submit the form
with EnableViewState="false", i get the values back.
It seems that EnableViewState="false" has no influence because 'false' or
'true', it does not make any difference.
I thought that with 'false', i wouldn't get the values back.
Please look at the code here:
Thanks you
AlexC
<%@ Page Language="VB" EnableViewState="false" AutoEventWireup="false"
CodeFile="test.aspx.vb" Inherits="test" %>
<form id="frmViewState" runat="server">
Typ your name:
<asp:TextBox id="txtName" runat="server" />
Take a color:
<aspropDownList id="ddlColor" runat="server">
<asp:ListItem>Red</asp:ListItem>
<asp:ListItem>Blue</asp:ListItem>
<asp:ListItem>Yelowl</asp:ListItem>
</aspropDownList>
<asp:button id="btnSubmit" text="submit"
onClick="btnSubmit_Click" runat="server" />
</form>
the code is:
Sub btnSubmit_Click(ByVal Sender As Object, ByVal E As EventArgs)
lblSentence.Text = txtName.Text & " selecteerde " _
& ddlColor.SelectedItem.Text
End Sub