Question : Label is updated, textboxes are not?

Not sure what is going on. This is not a !Page.IsPostBack issue, it has to do with my object and updating textboxes with the properties of that object.

I have a label that shows my shipment Id, and that works fine. However, the remainder of the data I am returning to the textboxes is not showing up. I have debugged the hell out of this and the data is definitely being applied to the textbox.text correctly, but it is not there on the webpage.

I can change the backcolor, borders, etc. on the textboxes, but cannot make it show any text??

If I drop in a label I can assign anything to it and it shows up fine.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
<div class="lineLeft">
                                <div class="lineItemWide">
                                    <h3>
                                        Return Details</h3>
                                </div>
                                <div class="lineItemWide">
                                    <label>
                                        Shipment Id:
                                    </label>
                                    <asp:Label ID="lblShipmentId" runat="Server" Width="190px"></asp:Label>
                                </div>
                                <div class="lineItemWide">
                                    <label>
                                        Reason:
                                    </label>
                                    <asp:TextBox ID="txtReason" runat="Server" Width="190px"></asp:TextBox>
                                </div>
                                <div class="lineItemWide">
                                    <label>
                                        ERP:
                                    </label>
                                    <asp:TextBox ID="txtERP" runat="Server" Width="190px"></asp:TextBox>
                                </div>
                                <div class="lineItemWide">
                                    <label>
                                        Priority:
                                    </label>
                                    <asp:DropDownList ID="ddlPriority" runat="server" Width="195px" Height="16px">
                                        <asp:ListItem Value="" Text="- Select -" Selected="True" />
                                        <asp:ListItem Value="True" Text="Yes" />
                                        <asp:ListItem Value="False" Text="No" />
                                    </asp:DropDownList>
                                </div>
                                <div class="lineItemWide">
                                    <label>
                                        Carrier:
                                    </label>
                                    <asp:DropDownList ID="ddlCarrier" runat="server" Width="195px">
                                    </asp:DropDownList>
                                </div>
                                <div class="lineItemWide">
                                    <label>
                                        AWB:
                                    </label>
                                    <asp:TextBox ID="txtAWB" runat="Server" Width="190px"></asp:TextBox>
                                </div>
                            </div>





        private ShipmentItem[] MoveSelectedItemToShippingCart(int selectedItemId, ShipmentItem[] readyToShipList)
        {
            // add the selected item to the shipment cart
            ShipmentItem selectedItem = readyToShipList.SingleOrDefault(r => r.ShipmentItemId == selectedItemId);
            ShippingDataManager mgr = Session["ShippingDataManager"] as ShippingDataManager;

            if (selectedItem.ShipmentId == 0)
            {
                mgr.AddItemToShipment(selectedItem);
            }
            else
            {
               // ask the manager to load the new shipment
                mgr.LoadShipment(selectedItem.ShipmentId, selectedItem.ReturnType);

                // display the information
                this.txtAWB.Text = mgr.AWB;
                this.txtERP.Text = mgr.ERP;
                this.txtReason.Text = mgr.Reason;
                this.ddlCarrier.SelectedValue = mgr.ShipmentCarrier.CarrierId.ToString();
                this.ddlPriority.SelectedValue = mgr.IsPriority.ToString();          
            }

            if (mgr.ShipmentId == 0)
            {
                this.lblShipmentId.Text = "Unassigned";
            }
            else
            {
                this.lblShipmentId.Text = mgr.ShipmentId.ToString();
            }

            // set the shipment type
            this.SelectedShipType.Value = mgr.ShipmentReturnType.HasValue ? mgr.ShipmentReturnType.Value.ToString() : "";

            readyToShipPanel.ResponseScripts.Add(String.Format("$find('{0}').ajaxRequest();", ShipmentDetailsPanel.ClientID));

            // return remaining returns
            ShipmentItem[] remainingItemList = readyToShipList.Except(mgr.GetItemsToShip(), new ShipmentItemComparer()).ToArray();
            return remainingItemList;


        }

Answer : Label is updated, textboxes are not?

Had a typo.  Try this please.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
On Error Resume Next

Const ADS_SCOPE_SUBTREE = 2 ' Search target object and all sub levels


Dim objRootDSE : Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = Replace(Replace(objRootDSE.Get("defaultNamingContext"), ",DC=", "."), "DC=", "")

strADsPath = "LDAP://" & objRootDSE.Get("defaultNamingContext")

'Connect to Active Directory
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE

 
Dim objOU : Set objOU = GetObject("LDAP://" & TARGET_OU)
 
Dim objExcel : Set objExcel = CreateObject("Excel.Application")
Dim objWorkbook : Set objWorkbook = objExcel.Workbooks.Open(EXCEL_FILE)
 
' Start at Row 2, after the header.
Dim intRow : intRow = 2
 
Do Until objExcel.Cells(intRow, 1).Value = ""
		  
	Dim strUserName : strUserName = objExcel.Cells(intRow, 1).Value
	Dim strDisplayName : strDisplayName = objExcel.Cells(intRow, 2).Value
	Dim strFirstName : strFirstName = objExcel.Cells(intRow, 3).Value
	Dim strLastName : strLastName = objExcel.Cells(intRow, 4).Value
	Dim strDS : strDS = objExcel.Cells(intRow, 5).Value  
	'Dim strOffice : strOffice = objExcel.Cells(intRow, 6).Value
	Dim strPWD : strPWD = objExcel.Cells(intRow, 7).Value
			
	'Search AD Domain to verify user Common Name does not already exist
	objCommand.CommandText = "SELECT distinguishedName FROM '" & strADsPath & _
	"' WHERE objectCategory='user' AND cn='" & strDisplayName & "'"
	Set objRecordSet = objCommand.Execute
	If objRecordSet.EOF Then
					 
		Dim objUser : Set objUser = objOU.Create("user", "CN=" & strDisplayName)
		objUser.Put "sAMAccountName", strUserName
		objUser.Put "userPrincipalName", strUserName & "@" & strDNSDomain
		objUser.Put "displayName", strDisplayName
		objUser.Put "sn", strLastName
		objUser.Put "givenName", strFirstName
		objUser.Put "description", strDS
		'objUser.Put "physicalDeliveryOfficeName", strOffice
		objUser.Put "homeDrive", "X:"
		objUser.Put "homeDirectory", "\\shadowcom.local\system\profiles\" & strUsername
		objUser.SetInfo
		' Separat sektion til import af password til brugerne
		objUser.userAccountControl = 512
		objUser.SetPassword strPWD
		objUser.AccountDisabled = False
		objUser.SetInfo
	End If
		
	intRow = intRow + 1
Loop
 
objExcel.ActiveWorkbook.Save EXCEL_FILE
objExcel.ActiveWorkbook.Close
objExcel.Quit
Random Solutions  
 
programming4us programming4us