Here is my Coding
I would like to hide "txtQtyOrder10" in if condition after clicking on SEARCH Button. when I'm trying to access from part.aspx.cs file it's show up error msg.
I don't have idea how can I get access to the text fields for hide.
Here is some coding for refer what i'm trying to do.
Any help will be appreciate.
part.aspx
<asp:GridView ID="gvOutput" runat="server" AutoGenerateColumns="False"
BackColor="Transparent" AllowSorting="True"
BorderColor="Navy" BorderWidth="2px" GridLines="None" OnSorting="OnSort"
OnRowCreated="OnRowCreated"
OnSelectedIndexChanging="gvOutputSelectedIndexChanging" CellPadding="2"
DataKeyNames="LineID"
AllowPaging="True" PageSize="50" OnPageIndexChanging="gvOutput_PageIndexChanging"
OnDataBound="OnDataBound" SelectedIndex="1">
<Columns>
<asp:TemplateField HeaderText="Select">
<HeaderTemplate>
<input id="chkAll" onclick="SelectAllCheckboxes(this);"
runat="server" type="checkbox" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server"
Checked='<%# Eval("[Select]") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField SortExpression="PROD80" HeaderText="Number">
<ItemTemplate>
<asp:LinkButton ID="lnkPart" runat="server" CommandName="Select"
Text='<%# Bind("PROD80") %>'></asp:LinkButton>
</ItemTemplate>
<ControlStyle CssClass="grid" />
</asp:TemplateField>
<asp:BoundField DataField="DESC80" HeaderText="Description"
SortExpression="DESC80" />
<asp:BoundField DataField="VEND80" HeaderText="Vendor"
SortExpression="VEND80" />
<asp:BoundField DataField="BUYE80" HeaderText="Planner"
SortExpression="BUYE80" />
<asp:BoundField DataField="PMIUM" HeaderText="UOM"
SortExpression="PMIUM" />
<asp:TemplateField HeaderText="Order 10">
<ItemTemplate>
<asp:TextBox ID="txtQtyOrder10" runat="server"
Text=<%#Bind("QTYORDER10")%> onfocus="this.select()"
CssClass="textbox" Height="13px" Width="60px" />
<ajaxToolkit:FilteredTextBoxExtender ID="ftbeQty10" runat="server"
TargetControlID="txtQtyOrder10" FilterType="Numbers">
</ajaxToolkit:FilteredTextBoxExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Order 50">
<ItemTemplate>
<asp:TextBox ID="txtQtyOrder50" runat="server"
Text=<%#Bind("QTYORDER50")%> onfocus="this.select()"
CssClass="textbox" Height="13px" Width="60px" />
<ajaxToolkit:FilteredTextBoxExtender ID="ftbeQty50" runat="server"
TargetControlID="txtQtyOrder50" FilterType="Numbers">
</ajaxToolkit:FilteredTextBoxExtender>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="gvOutputHeader" />
<RowStyle ForeColor="Navy" Height="15px" Font-Size="Small" />
<SelectedRowStyle BackColor="White" />
<PagerSettings Position="TopAndBottom" />
</asp:GridView>
part.aspx.cs
protected void cmdSearch_Click(object sender, EventArgs e)
{ //if user clicks on 'Below X Weeks' or 'Below X Weeks w/o PO',
//they must enter a value in txt box.
if ((!rdBelowXWeeks.Checked || txtWeek.Text != string.Empty) &&
(!rdBelowXWeeksWPO.Checked || txtWeek.Text != string.Empty))
{
try
{
//clear data of a previous search
ClearResultsScreen();
ClearDetailsScreen();
//get radio button value selected by user (default is all)
if (rdAll.Checked)
search.SearchType = rdAll.Value;
else if (rdBelowTrigger.Checked)
search.SearchType = rdBelowTrigger.Value;
else if (rdAboveTrigger.Checked)
search.SearchType = rdAboveTrigger.Value;
else if (rdBelowSafety.Checked)
search.SearchType = rdBelowSafety.Value;
else if (rdBelowXWeeksWPO.Checked)
search.SearchType = rdBelowXWeeksWPO.Value
//*****WOULD LIKE TO HIDE from HERE *************//
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
else
{
lblErrMessage.Text = "ERROR: Number of weeks is required";
lblErrMessage.Visible = true;
}
}//end cmdSearch_Click