Hello,
Here is what I need:
I need the focus and the cursor set to a textbox named txtGT, every time no matter if it is the first page load or whether it is a postback.
Here is the problem:
I am using AJAX and MasterPages as well as an update panel, the textbox is in a panel. I have tried to do it using different java scripts but I can't get it to work because I am not using asp forms, instead I am using Containers.
Here is my code:
<%@ Page Language="VB" MasterPageFile= "~/MasterPage.mast er" AutoEventWireup ="false" CodeFile="infco ntrol.aspx.vb" Inherits="order s_CutGroupAssig n" title="eKanban Ordenes Especiales" %>
<asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1" Runat="Server">
<script language=javasc ript>
function setFocus(ctl) {
if (document.forms[0][ctl] != null)
document.forms[0][ctl].focus();
}
setFocus("txtGT ")
</script>
<asp:UpdateProg ress ID="UpdPrgInf" runat="server" AssociatedUpdat ePanelID="Updat ePanel1"
DisplayAfter="1 ">
<ProgressTempla te>
<img src="../images/wait.gif" />
</ProgressTemplat e>
</asp:UpdateProgr ess>
<asp:UpdatePane l id="UpdatePanel 1" runat="server">
<contenttemplat e>
<asp:Label ID="lblTitleApp " runat="server" Font-Bold="True" Font-Size="Large" ForeColor="#FF8 000"
Text="Control de Infladores"></asp:Label><br />
<asp:SqlDataSou rce id="SqlDataSour ce2" runat="server" ConnectionStrin g="<%$ ConnectionStrin gs:ReceivingDBC onnectionString %>" SelectCommand=" eK_IW_GetOpenOr ders" SelectCommandTy pe="StoredProce dure">
<SelectParamete rs>
<asp:SessionPar ameter DefaultValue="I RS" Name="PlantID" SessionField="P lanta" Type="String" />
</SelectParameter s>
</asp:SqlDataSour ce> <asp:Panel id="pnlStatus" runat="server" Height="30px" Width="645px" BackColor="#E0E 0E0"><TABLE style="WIDTH: 640px"><TBODY>< TR><TD style="HEIGHT: 18px; width: 178px; text-align: right;">
<asp:Label id="Label1" runat="server" Font-Size="10pt" Text="Ordenes Pendientes de Surtir: " Width="175px"></asp:Label></TD><TD style="HEIGHT: 18px; width: 225px; text-align: left;"> <asp:DropDownLi st id="cboOrders" runat="server" DataSourceID="S qlDataSource2" OnSelectedIndex Changed="cboOrd ers_SelectedInd exChanged" AutoPostBack="T rue" DataTextField=" Ordernumber" DataValueField= "Ordernumbe r"></asp:DropDownLis t>
<asp:TextBox id="txtOrderSca n" runat="server" AutoPostBack="T rue" OnTextChanged=" txtOrderScan_Te xtChanged" Width="125px"></asp:TextBox></TD><TD style="HEIGHT: 18px; width: 78px; text-align: left;"> <asp:Label id="lblInvalidO rder" runat="server" Font-Bold="True" ForeColor="Red" Text="Orden Inválida" Visible="False" ></asp:Label></TD><TD style="WIDTH: 29px; HEIGHT: 18px; text-align: right;"> <asp:Button id="btnCancelOr der" runat="server" Text="Cancelar Orden" Visible="False" OnClick="btnCan celOrder_Click" ></asp:Button></TD></TR></TBODY></TABLE></asp:Panel> <BR /><asp:Label id="lblStatus" runat="server" Font-Bold="True" Font-Size="Medium" ForeColor="Roya lBlue" Width="568px" Text="Status Orden" Visible="False" ></asp:Label><BR />
<asp:Panel id="pnlSupply" runat="server" Width="650px">< SPAN style="FONT-SIZE: 10pt">Especifiq ue el numero de parte del material que va a surtir y la cantidad para esta orden:<BR /> </SPAN><TABLE style="WIDTH: 648px; HEIGHT: 1px"><TBODY><TR ><TD style="VERTICAL-ALIGN: top; WIDTH: 70px; HEIGHT: 41px; TEXT-ALIGN: right">Número de parte</TD><TD style="VERTICAL-ALIGN: top; WIDTH: 159px; HEIGHT: 41px"><asp:Text Box id="txtPartNumb er" runat="server" MaxLength="25"> </asp:TextBox><BR /><asp:RegularEx pressionValidat or id="RegularExpr essionValidator 2" runat="server" Width="120px" ControlToValida te="txtPartNumb er" ErrorMessage="M áximo 25 caracteres." ValidationExpre ssion=".{0,25}" Display="Dynami c" Font-Bold="False"></asp:RegularExpr essionValidator ></TD><TD style="VERTICAL-ALIGN: top; WIDTH: 328px; HEIGHT: 41px"><asp:Drop DownList id="cboPartNumb er" runat="server" DataSourceID="S qlDataSource3" OnSelectedIndex Changed="cboPar tNumber_Selecte dIndexChanged" AutoPostBack="T rue" DataTextField=" partnumber" DataValueField= "partnumber "></asp:DropDownLis t> <asp:La bel id="lblSelDescr iption" runat="server" Font-Bold="True" ForeColor="Blue " Width="184px"></asp:Label>  ;<BR /><asp:RequiredF ieldValidator id="RequiredFie ldValidator3" runat="server" Width="176px" ControlToValida te="txtPartNumb er" ErrorMessage="E l número de parte es requerido." Font-Bold="False"></asp:RequiredFie ldValidator></TD></TR><TR><TD style="VERTICAL-ALIGN: top; WIDTH: 70px; HEIGHT: 39px; TEXT-ALIGN: right">Cantidad </TD><TD style="VERTICAL-ALIGN: top; WIDTH: 159px; HEIGHT: 39px"><asp:Text Box id="txtQuantity " runat="server" Width="48px" MaxLength="7"></asp:TextBox>&nb sp;<asp:RangeVa lidator id="RangeValida tor1" runat="server" Width="96px" ControlToValida te="txtQuantity " ErrorMessage="C antidad inválida" Type="Double" MinimumValue=". 01" MaximumValue="1 000000" Font-Bold="False"></asp:RangeValida tor><BR /><asp:RequiredF ieldValidator id="RequiredFie ldValidator5" runat="server" Width="144px" ControlToValida te="txtQuantity " ErrorMessage="D ebe escribir una cantidad." Font-Bold="False"></asp:RequiredFie ldValidator></TD><TD style="VERTICAL-ALIGN: top; WIDTH: 328px; HEIGHT: 39px; TEXT-ALIGN: left">
<asp:Labe l id="lblPartNotF ound" runat="server" Font-Bold="True" Font-Size="Small" ForeColor="Red" Width="271px" Text="No se encontró el número de parte especificado." Visible="False" ></asp:Label></TD></TR><TR><TD style="VERTICAL-ALIGN: top; WIDTH: 70px; HEIGHT: 36px; TEXT-ALIGN: right">
GT</TD><TD style="WIDTH: 159px; HEIGHT: 36px; vertical-align: top;">
<asp:TextBox ID="txtGT" runat="server" AutoPostBack="T rue" MaxLength="12" OnTextChanged=" txtGT_TextChang ed"></asp:TextBox><as p:RegularExpres sionValidator
ID="GTValidator " runat="server" ControlToValida te="txtGT" Display="Dynami c" ErrorMessage="M áximo 12 caracteres."
ValidationExpre ssion=".{0,12}" Width="120px" Font-Bold="False"></asp:RegularExpr essionValidator ></TD><TD style="WIDTH: 328px; HEIGHT: 36px"><asp:Butt on id="btnAddSuppl y" onclick="btnAdd Supply_Click" runat="server" Text="Agregar"> </asp:Button>&nbs p;
<asp:SqlDataSou rce id="SqlDataSour ce3" runat="server" ConnectionStrin g="<%$ ConnectionStrin gs:ReceivingDBC onnectionString %>" SelectCommand=" eK_IW_GetOrderP NInfo" SelectCommandTy pe="StoredProce dure"><SelectPa rameters>
<asp:ControlPar ameter PropertyName="S electedValue" Type="String" Name="OrderNumb er" ControlID="cboO rders"></asp:ControlPara meter>
<asp:SessionPar ameter Name="PlantID" SessionField="P lanta" Type="String" />
</SelectParameter s>
</asp:SqlDataSour ce></TD></TR></TBODY></TABLE><asp:Grid View id="grdSupply" runat="server" ForeColor="Blac k" DataSourceID="S qlDataSource4" PageSize="5" AllowSorting="T rue" DataKeyNames="O rderNumber,Part Number" AutoGenerateCol umns="False" GridLines="Vert ical" CellPadding="3" BackColor="Whit e" BorderColor="#9 99999" BorderStyle="So lid" BorderWidth="1p x" OnSelectedIndex Changed="grdSup ply_SelectedInd exChanged">
<FooterStyle BackColor="#CCC CCC"></FooterStyle>
<Columns>
<asp:CommandFie ld ShowSelectButto n="True" SelectText="Det alle" />
<asp:BoundFie ld ReadOnly="True" DataField="Orde rNumber" SortExpression= "OrderNumbe r" HeaderText="N&# 250;mero de Orden"></asp:BoundField>
<asp:BoundFie ld ReadOnly="True" DataField="Part Number" SortExpression= "PartNumber " HeaderText="N&# 250;mero de Parte"></asp:BoundField>
<asp:BoundFie ld ReadOnly="True" DataField="desc ription" SortExpression= "descriptio n" HeaderText="Des cripción"> </asp:BoundField>
<asp:BoundFie ld DataField="Quan tity" SortExpression= "Quantity" HeaderText="Can tidad Requerida"></asp:BoundField>
<asp:BoundFie ld DataField="Supp lied" SortExpression= "Supplied" HeaderText="Can tidad Surtida"></asp:BoundField>
<asp:BoundFie ld DataField="Date LastMaint" SortExpression= "DateLastMa int" HeaderText="Fec ha"></asp:BoundField>
</Columns>
<SelectedRowSty le BackColor="#804 040" ForeColor="Whit e" Font-Bold="True"></SelectedRowStyl e>
<PagerStyle BackColor="Silv er" ForeColor="Blac k" HorizontalAlign ="Center"></PagerStyle>
<HeaderStyle BackColor="Blac k" ForeColor="Whit e" Font-Bold="True"></HeaderStyle>
<AlternatingRow Style BackColor="#E0E 0E0"></AlternatingRowS tyle>
</asp:GridView>
<br />
Detalle:<br />
<asp:GridView id="grdSupDetai ls" runat="server" ForeColor="Blac k" DataSourceID="s qlSupDetails" AutoGenerateDel eteButton="True " PageSize="5" AllowSorting="T rue" DataKeyNames="P artNumber,GTNum ber,Quantity" AutoGenerateCol umns="False" GridLines="Hori zontal" CellPadding="4" BackColor="Whit e" BorderColor="#C CCCCC" BorderStyle="No ne" BorderWidth="1p x" OnSelectedIndex Changed="grdSup ply_SelectedInd exChanged" Width="376px">
<FooterStyle BackColor="#CCC C99" ForeColor="Blac k" />
<Columns>
<asp:BoundFie ld DataField="Part Number" HeaderText="N&# 250;mero de Parte" SortExpression= "PartNumber " />
<asp:BoundFie ld DataField="GTNu mber" HeaderText="Gre enTag" SortExpression= "GTNumber" />
<asp:BoundFie ld DataField="Quan tity" HeaderText="Can tidad" SortExpression= "Quantity" />
</Columns>
<SelectedRowSty le BackColor="#CC3 333" Font-Bold="True" ForeColor="Whit e" />
<PagerStyle BackColor="Whit e" ForeColor="Blac k" HorizontalAlign ="Right" />
<HeaderStyle BackColor="#333 333" Font-Bold="True" ForeColor="Whit e" />
</asp:GridView>
<asp:SqlDataSou rce id="SqlDataSour ce4" runat="server" ConnectionStrin g="<%$ ConnectionStrin gs:ReceivingDBC onnectionString %>" SelectCommand=" eK_IW_GetOrderI nfoSupply" SelectCommandTy pe="StoredProce dure" DeleteCommand=" eK_IW_DelOrderS upply" DeleteCommandTy pe="StoredProce dure"><DeletePa rameters>
<asp:ControlPar ameter PropertyName="S electedValue" Type="String" Name="OrderNumb er" ControlID="grdS upply"></asp:ControlPara meter>
<asp:ControlPar ameter PropertyName="S electedValue" Type="String" Name="PartNumbe r" ControlID="grdS upply"></asp:ControlPara meter>
<asp:SessionPar ameter Name="PlantID" SessionField="P lanta" Type="String" />
<asp:SessionPar ameter Name="UserID" SessionField="u sername" Type="String" />
</DeleteParameter s>
<SelectParamete rs>
<asp:ControlPar ameter ControlID="cboO rders" Name="OrderNumb er" PropertyName="S electedValue"
Type="String" />
<asp:SessionPar ameter Name="PlantID" SessionField="P lanta" Type="String" />
</SelectParameter s>
</asp:SqlDataSour ce>
<asp:SqlDataSou rce ID="sqlSupDetai ls" runat="server" ConnectionStrin g="<%$ ConnectionStrin gs:ReceivingDBC onnectionString %>"
SelectCommand=" eK_IW_GetOrderS uppDetails" SelectCommandTy pe="StoredProce dure" DeleteCommand=" eK_IW_DelOrderS upplyDetail" DeleteCommandTy pe="StoredProce dure">
<SelectParamete rs>
<asp:ControlPar ameter ControlID="grdS upply" Name="OrderNumb er" PropertyName="S electedDataKey. Values[0]" Type="String" />
<asp:ControlPar ameter ControlID="grdS upply" Name="PartNumbe r" PropertyName="S electedDataKey. Values[1]" Type="String" />
<asp:SessionPar ameter Name="PlantID" SessionField="P lanta" Type="String" />
</SelectParameter s>
<DeleteParamete rs>
<asp:ControlPar ameter ControlID="grdS upply" Name="OrderNumb er" PropertyName="S electedDataKey. Values[0]"
Type="String" />
<asp:SessionPar ameter Name="PlantID" SessionField="P lanta" Type="String" />
<asp:ControlPar ameter ControlID="grdS upDetails" Name="PartNumbe r" PropertyName="S electedDataKey. Values[0]"
Type="String" />
<asp:SessionPar ameter Name="UserID" SessionField="u sername" Type="String" />
<asp:ControlPar ameter ControlID="grdS upDetails" Name="GTNumber" PropertyName="S electedDataKey. Values[1]"
Type="String" />
<asp:ControlPar ameter ControlID="grdS upDetails" Name="Quantity" PropertyName="S electedDataKey. Values[2]"
Type="Double" />
</DeleteParameter s>
</asp:SqlDataSour ce>
<BR /><asp:Button id="btnSupply" onclick="btnSup ply_Click" runat="server" Text="Surtir Material"></asp:Button></asp:Panel>  ;<BR /><BR /><BR /><asp:Panel style="DISPLAY: none; VERTICAL-ALIGN: middle; TEXT-ALIGN: center" id="pnlPopUpSup ply" runat="server" Height="88px" Width="320px" BorderStyle="Do uble" BorderColor="Ye llow" BackColor="Whit e" Visible="true"> <BR />¿Está seguro que desea surtir esta orden?<BR /><BR /><TABLE><TBODY> <TR><TD style="WIDTH: 3px; HEIGHT: 26px"><asp:Butt on id="btnOkSupply " onclick="btnOkS upply_Click" runat="server" Text="Sí estoy seguro"></asp:Button></TD><TD style="WIDTH: 3px; HEIGHT: 26px"></TD><TD style="WIDTH: 3px; HEIGHT: 26px"><asp:Butt on id="btnCancelSu pply" runat="server" Text="No, Regresar" UseSubmitBehavi or="False" OnClick="btnCan celSupply_Click "></asp:Button></TD></TR></TBODY></TABLE></asp:Panel> <ajaxToolkit:Mo dalPopupExtende r id="ModalPopupE xtender2" runat="server" TargetControlID ="btnSupply" PopupControlID= "pnlPopUpSupply " BackgroundCssCl ass="modalBackg round" DropShadow="tru e" CancelControlID ="btnCancelSupp ly">
</ajaxToolkit:Mod alPopupExtender > <BR /><asp:Panel style="DISPLAY: none; VERTICAL-ALIGN: middle; TEXT-ALIGN: center" id="pnlPopUpCan cel" runat="server" Height="88px" Width="320px" BorderStyle="Do uble" BorderColor="Re d" BackColor="Whit e" Visible="true" CssClass="modal Popup"><BR />¿Está seguro que desea cancelar la orden?<BR /><BR /><TABLE><TBODY> <TR><TD style="WIDTH: 3px; HEIGHT: 26px"><asp:Butt on id="btnOkCancel Order" onclick="btnOkC ancelOrder_Clic k" runat="server" Text="Sí estoy seguro"></asp:Button></TD><TD style="WIDTH: 3px; HEIGHT: 26px"></TD><TD style="WIDTH: 3px; HEIGHT: 26px"><asp:Butt on id="btnCancelCa ncelOrder" runat="server" Text="No, Regresar" UseSubmitBehavi or="False"></asp:Button></TD></TR></TBODY></TABLE></asp:Panel> <ajaxToolkit:Mo dalPopupExtende r id="ModalPopupE xtender6" runat="server" TargetControlID ="btnCancelOrde r" PopupControlID= "pnlPopUpCancel " BackgroundCssCl ass="modalBackg round" DropShadow="tru e" CancelControlID ="btnCancelCanc elOrder">
</ajaxToolkit:Mod alPopupExtender ><BR /><BR /><asp:Timer id="timAutoUpda te" runat="server" Enabled="False" Interval="2500" OnTick="timAuto Update_Tick"></asp:Timer>
</contenttemplate >
</asp:UpdatePanel >
</asp:Content>
Here is what I need:
I need the focus and the cursor set to a textbox named txtGT, every time no matter if it is the first page load or whether it is a postback.
Here is the problem:
I am using AJAX and MasterPages as well as an update panel, the textbox is in a panel. I have tried to do it using different java scripts but I can't get it to work because I am not using asp forms, instead I am using Containers.
Here is my code:
<%@ Page Language="VB" MasterPageFile= "~/MasterPage.mast er" AutoEventWireup ="false" CodeFile="infco ntrol.aspx.vb" Inherits="order s_CutGroupAssig n" title="eKanban Ordenes Especiales" %>
<asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1" Runat="Server">
<script language=javasc ript>
function setFocus(ctl) {
if (document.forms[0][ctl] != null)
document.forms[0][ctl].focus();
}
setFocus("txtGT ")
</script>
<asp:UpdateProg ress ID="UpdPrgInf" runat="server" AssociatedUpdat ePanelID="Updat ePanel1"
DisplayAfter="1 ">
<ProgressTempla te>
<img src="../images/wait.gif" />
</ProgressTemplat e>
</asp:UpdateProgr ess>
<asp:UpdatePane l id="UpdatePanel 1" runat="server">
<contenttemplat e>
<asp:Label ID="lblTitleApp " runat="server" Font-Bold="True" Font-Size="Large" ForeColor="#FF8 000"
Text="Control de Infladores"></asp:Label><br />
<asp:SqlDataSou rce id="SqlDataSour ce2" runat="server" ConnectionStrin g="<%$ ConnectionStrin gs:ReceivingDBC onnectionString %>" SelectCommand=" eK_IW_GetOpenOr ders" SelectCommandTy pe="StoredProce dure">
<SelectParamete rs>
<asp:SessionPar ameter DefaultValue="I RS" Name="PlantID" SessionField="P lanta" Type="String" />
</SelectParameter s>
</asp:SqlDataSour ce> <asp:Panel id="pnlStatus" runat="server" Height="30px" Width="645px" BackColor="#E0E 0E0"><TABLE style="WIDTH: 640px"><TBODY>< TR><TD style="HEIGHT: 18px; width: 178px; text-align: right;">
<asp:Label id="Label1" runat="server" Font-Size="10pt" Text="Ordenes Pendientes de Surtir: " Width="175px"></asp:Label></TD><TD style="HEIGHT: 18px; width: 225px; text-align: left;"> <asp:DropDownLi st id="cboOrders" runat="server" DataSourceID="S qlDataSource2" OnSelectedIndex Changed="cboOrd ers_SelectedInd exChanged" AutoPostBack="T rue" DataTextField=" Ordernumber" DataValueField= "Ordernumbe r"></asp:DropDownLis t>
<asp:TextBox id="txtOrderSca n" runat="server" AutoPostBack="T rue" OnTextChanged=" txtOrderScan_Te xtChanged" Width="125px"></asp:TextBox></TD><TD style="HEIGHT: 18px; width: 78px; text-align: left;"> <asp:Label id="lblInvalidO rder" runat="server" Font-Bold="True" ForeColor="Red" Text="Orden Inválida" Visible="False" ></asp:Label></TD><TD style="WIDTH: 29px; HEIGHT: 18px; text-align: right;"> <asp:Button id="btnCancelOr der" runat="server" Text="Cancelar Orden" Visible="False" OnClick="btnCan celOrder_Click" ></asp:Button></TD></TR></TBODY></TABLE></asp:Panel> <BR /><asp:Label id="lblStatus" runat="server" Font-Bold="True" Font-Size="Medium" ForeColor="Roya lBlue" Width="568px" Text="Status Orden" Visible="False" ></asp:Label><BR />
<asp:Panel id="pnlSupply" runat="server" Width="650px">< SPAN style="FONT-SIZE: 10pt">Especifiq ue el numero de parte del material que va a surtir y la cantidad para esta orden:<BR /> </SPAN><TABLE style="WIDTH: 648px; HEIGHT: 1px"><TBODY><TR ><TD style="VERTICAL-ALIGN: top; WIDTH: 70px; HEIGHT: 41px; TEXT-ALIGN: right">Número de parte</TD><TD style="VERTICAL-ALIGN: top; WIDTH: 159px; HEIGHT: 41px"><asp:Text Box id="txtPartNumb er" runat="server" MaxLength="25"> </asp:TextBox><BR /><asp:RegularEx pressionValidat or id="RegularExpr essionValidator 2" runat="server" Width="120px" ControlToValida te="txtPartNumb er" ErrorMessage="M áximo 25 caracteres." ValidationExpre ssion=".{0,25}" Display="Dynami c" Font-Bold="False"></asp:RegularExpr essionValidator ></TD><TD style="VERTICAL-ALIGN: top; WIDTH: 328px; HEIGHT: 41px"><asp:Drop DownList id="cboPartNumb er" runat="server" DataSourceID="S qlDataSource3" OnSelectedIndex Changed="cboPar tNumber_Selecte dIndexChanged" AutoPostBack="T rue" DataTextField=" partnumber" DataValueField= "partnumber "></asp:DropDownLis t> <asp:La bel id="lblSelDescr iption" runat="server" Font-Bold="True" ForeColor="Blue " Width="184px"></asp:Label>  ;<BR /><asp:RequiredF ieldValidator id="RequiredFie ldValidator3" runat="server" Width="176px" ControlToValida te="txtPartNumb er" ErrorMessage="E l número de parte es requerido." Font-Bold="False"></asp:RequiredFie ldValidator></TD></TR><TR><TD style="VERTICAL-ALIGN: top; WIDTH: 70px; HEIGHT: 39px; TEXT-ALIGN: right">Cantidad </TD><TD style="VERTICAL-ALIGN: top; WIDTH: 159px; HEIGHT: 39px"><asp:Text Box id="txtQuantity " runat="server" Width="48px" MaxLength="7"></asp:TextBox>&nb sp;<asp:RangeVa lidator id="RangeValida tor1" runat="server" Width="96px" ControlToValida te="txtQuantity " ErrorMessage="C antidad inválida" Type="Double" MinimumValue=". 01" MaximumValue="1 000000" Font-Bold="False"></asp:RangeValida tor><BR /><asp:RequiredF ieldValidator id="RequiredFie ldValidator5" runat="server" Width="144px" ControlToValida te="txtQuantity " ErrorMessage="D ebe escribir una cantidad." Font-Bold="False"></asp:RequiredFie ldValidator></TD><TD style="VERTICAL-ALIGN: top; WIDTH: 328px; HEIGHT: 39px; TEXT-ALIGN: left">
<asp:Labe l id="lblPartNotF ound" runat="server" Font-Bold="True" Font-Size="Small" ForeColor="Red" Width="271px" Text="No se encontró el número de parte especificado." Visible="False" ></asp:Label></TD></TR><TR><TD style="VERTICAL-ALIGN: top; WIDTH: 70px; HEIGHT: 36px; TEXT-ALIGN: right">
GT</TD><TD style="WIDTH: 159px; HEIGHT: 36px; vertical-align: top;">
<asp:TextBox ID="txtGT" runat="server" AutoPostBack="T rue" MaxLength="12" OnTextChanged=" txtGT_TextChang ed"></asp:TextBox><as p:RegularExpres sionValidator
ID="GTValidator " runat="server" ControlToValida te="txtGT" Display="Dynami c" ErrorMessage="M áximo 12 caracteres."
ValidationExpre ssion=".{0,12}" Width="120px" Font-Bold="False"></asp:RegularExpr essionValidator ></TD><TD style="WIDTH: 328px; HEIGHT: 36px"><asp:Butt on id="btnAddSuppl y" onclick="btnAdd Supply_Click" runat="server" Text="Agregar"> </asp:Button>&nbs p;
<asp:SqlDataSou rce id="SqlDataSour ce3" runat="server" ConnectionStrin g="<%$ ConnectionStrin gs:ReceivingDBC onnectionString %>" SelectCommand=" eK_IW_GetOrderP NInfo" SelectCommandTy pe="StoredProce dure"><SelectPa rameters>
<asp:ControlPar ameter PropertyName="S electedValue" Type="String" Name="OrderNumb er" ControlID="cboO rders"></asp:ControlPara meter>
<asp:SessionPar ameter Name="PlantID" SessionField="P lanta" Type="String" />
</SelectParameter s>
</asp:SqlDataSour ce></TD></TR></TBODY></TABLE><asp:Grid View id="grdSupply" runat="server" ForeColor="Blac k" DataSourceID="S qlDataSource4" PageSize="5" AllowSorting="T rue" DataKeyNames="O rderNumber,Part Number" AutoGenerateCol umns="False" GridLines="Vert ical" CellPadding="3" BackColor="Whit e" BorderColor="#9 99999" BorderStyle="So lid" BorderWidth="1p x" OnSelectedIndex Changed="grdSup ply_SelectedInd exChanged">
<FooterStyle BackColor="#CCC CCC"></FooterStyle>
<Columns>
<asp:CommandFie ld ShowSelectButto n="True" SelectText="Det alle" />
<asp:BoundFie ld ReadOnly="True" DataField="Orde rNumber" SortExpression= "OrderNumbe r" HeaderText="N&# 250;mero de Orden"></asp:BoundField>
<asp:BoundFie ld ReadOnly="True" DataField="Part Number" SortExpression= "PartNumber " HeaderText="N&# 250;mero de Parte"></asp:BoundField>
<asp:BoundFie ld ReadOnly="True" DataField="desc ription" SortExpression= "descriptio n" HeaderText="Des cripción"> </asp:BoundField>
<asp:BoundFie ld DataField="Quan tity" SortExpression= "Quantity" HeaderText="Can tidad Requerida"></asp:BoundField>
<asp:BoundFie ld DataField="Supp lied" SortExpression= "Supplied" HeaderText="Can tidad Surtida"></asp:BoundField>
<asp:BoundFie ld DataField="Date LastMaint" SortExpression= "DateLastMa int" HeaderText="Fec ha"></asp:BoundField>
</Columns>
<SelectedRowSty le BackColor="#804 040" ForeColor="Whit e" Font-Bold="True"></SelectedRowStyl e>
<PagerStyle BackColor="Silv er" ForeColor="Blac k" HorizontalAlign ="Center"></PagerStyle>
<HeaderStyle BackColor="Blac k" ForeColor="Whit e" Font-Bold="True"></HeaderStyle>
<AlternatingRow Style BackColor="#E0E 0E0"></AlternatingRowS tyle>
</asp:GridView>
<br />
Detalle:<br />
<asp:GridView id="grdSupDetai ls" runat="server" ForeColor="Blac k" DataSourceID="s qlSupDetails" AutoGenerateDel eteButton="True " PageSize="5" AllowSorting="T rue" DataKeyNames="P artNumber,GTNum ber,Quantity" AutoGenerateCol umns="False" GridLines="Hori zontal" CellPadding="4" BackColor="Whit e" BorderColor="#C CCCCC" BorderStyle="No ne" BorderWidth="1p x" OnSelectedIndex Changed="grdSup ply_SelectedInd exChanged" Width="376px">
<FooterStyle BackColor="#CCC C99" ForeColor="Blac k" />
<Columns>
<asp:BoundFie ld DataField="Part Number" HeaderText="N&# 250;mero de Parte" SortExpression= "PartNumber " />
<asp:BoundFie ld DataField="GTNu mber" HeaderText="Gre enTag" SortExpression= "GTNumber" />
<asp:BoundFie ld DataField="Quan tity" HeaderText="Can tidad" SortExpression= "Quantity" />
</Columns>
<SelectedRowSty le BackColor="#CC3 333" Font-Bold="True" ForeColor="Whit e" />
<PagerStyle BackColor="Whit e" ForeColor="Blac k" HorizontalAlign ="Right" />
<HeaderStyle BackColor="#333 333" Font-Bold="True" ForeColor="Whit e" />
</asp:GridView>
<asp:SqlDataSou rce id="SqlDataSour ce4" runat="server" ConnectionStrin g="<%$ ConnectionStrin gs:ReceivingDBC onnectionString %>" SelectCommand=" eK_IW_GetOrderI nfoSupply" SelectCommandTy pe="StoredProce dure" DeleteCommand=" eK_IW_DelOrderS upply" DeleteCommandTy pe="StoredProce dure"><DeletePa rameters>
<asp:ControlPar ameter PropertyName="S electedValue" Type="String" Name="OrderNumb er" ControlID="grdS upply"></asp:ControlPara meter>
<asp:ControlPar ameter PropertyName="S electedValue" Type="String" Name="PartNumbe r" ControlID="grdS upply"></asp:ControlPara meter>
<asp:SessionPar ameter Name="PlantID" SessionField="P lanta" Type="String" />
<asp:SessionPar ameter Name="UserID" SessionField="u sername" Type="String" />
</DeleteParameter s>
<SelectParamete rs>
<asp:ControlPar ameter ControlID="cboO rders" Name="OrderNumb er" PropertyName="S electedValue"
Type="String" />
<asp:SessionPar ameter Name="PlantID" SessionField="P lanta" Type="String" />
</SelectParameter s>
</asp:SqlDataSour ce>
<asp:SqlDataSou rce ID="sqlSupDetai ls" runat="server" ConnectionStrin g="<%$ ConnectionStrin gs:ReceivingDBC onnectionString %>"
SelectCommand=" eK_IW_GetOrderS uppDetails" SelectCommandTy pe="StoredProce dure" DeleteCommand=" eK_IW_DelOrderS upplyDetail" DeleteCommandTy pe="StoredProce dure">
<SelectParamete rs>
<asp:ControlPar ameter ControlID="grdS upply" Name="OrderNumb er" PropertyName="S electedDataKey. Values[0]" Type="String" />
<asp:ControlPar ameter ControlID="grdS upply" Name="PartNumbe r" PropertyName="S electedDataKey. Values[1]" Type="String" />
<asp:SessionPar ameter Name="PlantID" SessionField="P lanta" Type="String" />
</SelectParameter s>
<DeleteParamete rs>
<asp:ControlPar ameter ControlID="grdS upply" Name="OrderNumb er" PropertyName="S electedDataKey. Values[0]"
Type="String" />
<asp:SessionPar ameter Name="PlantID" SessionField="P lanta" Type="String" />
<asp:ControlPar ameter ControlID="grdS upDetails" Name="PartNumbe r" PropertyName="S electedDataKey. Values[0]"
Type="String" />
<asp:SessionPar ameter Name="UserID" SessionField="u sername" Type="String" />
<asp:ControlPar ameter ControlID="grdS upDetails" Name="GTNumber" PropertyName="S electedDataKey. Values[1]"
Type="String" />
<asp:ControlPar ameter ControlID="grdS upDetails" Name="Quantity" PropertyName="S electedDataKey. Values[2]"
Type="Double" />
</DeleteParameter s>
</asp:SqlDataSour ce>
<BR /><asp:Button id="btnSupply" onclick="btnSup ply_Click" runat="server" Text="Surtir Material"></asp:Button></asp:Panel>  ;<BR /><BR /><BR /><asp:Panel style="DISPLAY: none; VERTICAL-ALIGN: middle; TEXT-ALIGN: center" id="pnlPopUpSup ply" runat="server" Height="88px" Width="320px" BorderStyle="Do uble" BorderColor="Ye llow" BackColor="Whit e" Visible="true"> <BR />¿Está seguro que desea surtir esta orden?<BR /><BR /><TABLE><TBODY> <TR><TD style="WIDTH: 3px; HEIGHT: 26px"><asp:Butt on id="btnOkSupply " onclick="btnOkS upply_Click" runat="server" Text="Sí estoy seguro"></asp:Button></TD><TD style="WIDTH: 3px; HEIGHT: 26px"></TD><TD style="WIDTH: 3px; HEIGHT: 26px"><asp:Butt on id="btnCancelSu pply" runat="server" Text="No, Regresar" UseSubmitBehavi or="False" OnClick="btnCan celSupply_Click "></asp:Button></TD></TR></TBODY></TABLE></asp:Panel> <ajaxToolkit:Mo dalPopupExtende r id="ModalPopupE xtender2" runat="server" TargetControlID ="btnSupply" PopupControlID= "pnlPopUpSupply " BackgroundCssCl ass="modalBackg round" DropShadow="tru e" CancelControlID ="btnCancelSupp ly">
</ajaxToolkit:Mod alPopupExtender > <BR /><asp:Panel style="DISPLAY: none; VERTICAL-ALIGN: middle; TEXT-ALIGN: center" id="pnlPopUpCan cel" runat="server" Height="88px" Width="320px" BorderStyle="Do uble" BorderColor="Re d" BackColor="Whit e" Visible="true" CssClass="modal Popup"><BR />¿Está seguro que desea cancelar la orden?<BR /><BR /><TABLE><TBODY> <TR><TD style="WIDTH: 3px; HEIGHT: 26px"><asp:Butt on id="btnOkCancel Order" onclick="btnOkC ancelOrder_Clic k" runat="server" Text="Sí estoy seguro"></asp:Button></TD><TD style="WIDTH: 3px; HEIGHT: 26px"></TD><TD style="WIDTH: 3px; HEIGHT: 26px"><asp:Butt on id="btnCancelCa ncelOrder" runat="server" Text="No, Regresar" UseSubmitBehavi or="False"></asp:Button></TD></TR></TBODY></TABLE></asp:Panel> <ajaxToolkit:Mo dalPopupExtende r id="ModalPopupE xtender6" runat="server" TargetControlID ="btnCancelOrde r" PopupControlID= "pnlPopUpCancel " BackgroundCssCl ass="modalBackg round" DropShadow="tru e" CancelControlID ="btnCancelCanc elOrder">
</ajaxToolkit:Mod alPopupExtender ><BR /><BR /><asp:Timer id="timAutoUpda te" runat="server" Enabled="False" Interval="2500" OnTick="timAuto Update_Tick"></asp:Timer>
</contenttemplate >
</asp:UpdatePanel >
</asp:Content>
Comment