Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dropdown control loose the value

Status
Not open for further replies.

arada1

MIS
Dec 3, 2006
47
US
hi all,
I am working with this project where the user select the operator like "<"...from the dropdown menu and also there is a text box for them to enter an interger (field vlaue is miles) to get the contracts that have been awarded. My question is when I click the submit button once I select the opertor the dropdown control gets blank lose all the operator.Any clue would be appreciated. attached my aspx and the code behind code
thank you



<%@ Page Language="VB" EnableViewState="true" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="financeRpt.aspx.vb" Inherits="financialRpt_financeRpt" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Operator"
Width="96px"></asp:Label>
<strong>Value</strong><br />
<asp:DropDownList ID="drOperator" runat="server" Width="96px" AppendDataBoundItems="True">
</asp:DropDownList>

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Font-Bold="True" Text="Submit..."
Width="112px" />

</asp:Content>







Partial Class financialRpt_financeRpt
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
OperatorSelector()
End If
End Sub

Sub OperatorSelector()
drOperator.Items.Insert(0, New ListItem("<", 0))
drOperator.Items.Insert(1, New ListItem("<=", 1))
drOperator.Items.Insert(2, New ListItem("<>", 2))
drOperator.Items.Insert(3, New ListItem("=", 3))
drOperator.Items.Insert(4, New ListItem(">", 4))
drOperator.Items.Insert(5, New ListItem(">=", 5))
drOperator.Items.Insert(6, New ListItem("Between", 6))
drOperator.Items.Insert(7, New ListItem("Like", 7))

End Sub


End Class
 
I would suspect there is some code in the master page that is causing the problem
 
thank you for your reply.I just donot know why this is happening. the only thing i have in the master page is horizontal menu, sitemappath and left side links. that is all i have. would that cause the problem? thanks again
 
jbenson001 as you suspect the problem was with the master page.the value for enableviewstate was false in the master page. I changed to true now it is fine.thank you for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top