• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 491
  • Last Modified:

asp.net / c# /ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PurchaseOrderPartA.ascx.cs" Inherits="UI_PurchaseOrderPartA" %>
<%@ Register TagPrefix="obout" Namespace="Obout.ComboBox" Assembly="obout_ComboBox" %>
<%@ Register assembly="obout_Interface" namespace="Obout.Interface" tagprefix="cc1" %>
<style type="text/css">
        .payment-terms .ob_iCboICBC li
        {
            float: left;
            width: 105px;
        }
        
        .short-states .ob_iCboICBC li
        {
            float: left;
            width: 35px;
        }
        
        /* For IE6 */
        * HTML .payment-terms .ob_iCboICBC li
        {
            -width: 95px;
        }
        
        * HTML .short-states .ob_iCboICBC li
        {
            -width: 25px;
        }
        
        * HTML .ob_iCboICBC li i
        {
            -visibility: hidden;
        }
        /* End Combo Net Shipper */
        /* Begin:Combo Muli-Columns */
         .item
        {
            position: relative !important;
            display:-moz-inline-stack;
            display:inline-block;
            zoom:1;
            *display:inline;
            overflow: hidden;
            white-space: nowrap;
        }
        
        .header
        {
            margin-left: 2px;
        }
   
        .c1
        {
            width: 25px;
        }
        
        .c2
        {
            margin-left: 10px;
            width: 250px;
        }
        
        .c3
        {
            margin-left: 10px;
            width: 200px;
        }
        .c4
        {
            margin-left: 10px;
            width: 100px;
        }
        
        /* End: Combo Muli-Columns */
    </style>
<table cellpadding="0" cellspacing="0" class="PurchaseOrderTableMaster" width="100%"> 
<tr>
<td><strong>Confirmation No.</strong><br />
<cc1:OboutTextBox FolderStyle="../eHelpdesk/UIStyleControls/Obout/Interface/styles/premiere_blue/OboutTextBox" ID="TxtConfirmationNo" runat="server"></cc1:OboutTextBox></td>
<td>Referenece No.<br /><cc1:OboutTextBox ID="TxtReferenceNo" runat="server"></cc1:OboutTextBox></td>
<td>Buyer's Reference No.<br /><cc1:OboutTextBox ID="TxtBuyerReferenceNo" runat="server"></cc1:OboutTextBox></td>
<td><strong>Payment Terms:</strong><br />
<obout:ComboBox ID="DdlPaymentTerms" Width="150" MenuWidth="550"  
DataSourceID="SdsPaymentTermsList" DataTextField="Description" DataValueField="PaymentTermId"  runat="server"
FolderStyle="../eHelpdesk/UIStyleControls/Obout/ComboBox/styles/premiere_blue"
>
<CssSettings ItemsContainer="ob_iCboIC payment-terms" />
</obout:ComboBox></td></tr>
</table>
<table cellpadding="0" cellspacing="0" class="PurchaseOrderTableMaster"  width="100%">
<tr><td><strong>Shipper</strong><br />
<obout:ComboBox MenuWidth="700" Width="200" DataSourceID="SdsShipperList" DataTextField="WholeName" DataValueField="ShipperId" ID="DdlShipper" runat="server">
<HeaderTemplate>
<div class="header c1">ID</div>
<div class="header c2">Address</div>
<div class="header c3">Cit/State/Zip</div>
<div class="header c4">Phone No.</div>
</HeaderTemplate>
<ItemTemplate>
<div class="item c1"><%# Eval("ShipperId") %></div>
<div class="item c2"><%# Eval("Address1")%></div>
<div class="item c3"><%# Eval("City") %>&nbsp;<%# Eval("State") %>&nbsp;<%# Eval("Zip") %></div>
<div class="item c4"><%# Eval("PhoneNo") %></div>
</ItemTemplate>
<FooterTemplate>
Displaying <%# Container.ItemsCount %> Shippers
</FooterTemplate>
</obout:ComboBox>
</td><td><strong>Vender/Buyer</strong><br />
<obout:ComboBox MenuWidth="700" Width="200" DataSourceID="SdsVendorList" DataTextField="WholeName" DataValueField="VendorId" ID="DdlVendor" runat="server">
<HeaderTemplate>
<div class="header c1">ID</div>
<div class="header c2">Address</div>
<div class="header c3">Cit/State/Zip</div>
<div class="header c4">Phone No.</div>
</HeaderTemplate>
<ItemTemplate>
<div class="item c1"><%# Eval("VendorId") %></div>
<div class="item c2"><%# Eval("Address1")%></div>
<div class="item c3"><%# Eval("City") %>&nbsp;<%# Eval("State") %>&nbsp;<%# Eval("Zip") %></div>
<div class="item c4"><%# Eval("PhoneNo") %></div>
</ItemTemplate>
<FooterTemplate>
Displaying <%# Container.ItemsCount %> Vendors
</FooterTemplate>
</obout:ComboBox>
</td></tr>
<tr><td><strong>Consignee/Notify Party</strong><br />
<obout:ComboBox MenuWidth="700" Width="200" DataSourceID="SqlConsigneeList" DataTextField="WholeName" DataValueField="ConsigneeId" ID="DdlConsignee" runat="server">
<HeaderTemplate>
<div class="header c1">ID</div>
<div class="header c2">Address</div>
<div class="header c3">Cit/State/Zip</div>
<div class="header c4">Phone No.</div>
</HeaderTemplate>
<ItemTemplate>
<div class="item c1"><%# Eval("ConsigneeId") %></div>
<div class="item c2"><%# Eval("Address1")%></div>
<div class="item c3"><%# Eval("City") %>&nbsp;<%# Eval("State") %>&nbsp;<%# Eval("Zip") %></div>
<div class="item c4"><%# Eval("PhoneNo") %></div>
</ItemTemplate>
<FooterTemplate>
Displaying <%# Container.ItemsCount %> Consignee
</FooterTemplate>
</obout:ComboBox>
</td>
<td><strong>Ship To</strong><br />
<obout:ComboBox MenuWidth="700" Width="200" DataSourceID="SqlShipToList" DataTextField="WholeName" DataValueField="ShipToId" ID="DdlShipTo" runat="server">
<HeaderTemplate>
<div class="header c1">ID</div>
<div class="header c2">Address</div>
<div class="header c3">Cit/State/Zip</div>
<div class="header c4">Phone No.</div>
</HeaderTemplate>
<ItemTemplate>
<div class="item c1"><%# Eval("ShipToId")%></div>
<div class="item c2"><%# Eval("Address1")%></div>
<div class="item c3"><%# Eval("City") %>&nbsp;<%# Eval("State") %>&nbsp;<%# Eval("Zip") %></div>
<div class="item c4"><%# Eval("PhoneNo") %></div>
</ItemTemplate>
<FooterTemplate>
Displaying <%# Container.ItemsCount %> Receviers
</FooterTemplate>
</obout:ComboBox>
</td></tr>
</table>
<table cellpadding="0" cellspacing="0" class="PurchaseOrderTableMaster"  width="100%">
<tr>
<td><strong>Port of Loading</strong><br /><cc1:OboutTextBox ID="TxtPortofLoading" runat="server"></cc1:OboutTextBox></td>
<td><strong>Stowage</strong><br /><cc1:OboutTextBox ID="TxtStowage" runat="server"></cc1:OboutTextBox></td>
<td><strong>Shipping Date</strong><br /><cc1:OboutTextBox ID="TxtShippingDate" runat="server"></cc1:OboutTextBox></td>
<td><strong>Price Terms(USD)</strong><br /><cc1:OboutTextBox ID="TxtPriceTerms01" runat="server"></cc1:OboutTextBox></td>
<td>Price Terms(USD)<br /><cc1:OboutTextBox ID="TxtPriceTerms02" runat="server"></cc1:OboutTextBox></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" class="PurchaseOrderTableMaster" width="100%">
<tr><td><strong>Please choose total item Code:</strong>&nbsp;
<cc1:OboutDropDownList ID="DdlTotalItem"  
AutoPostBack="true"
FolderStyle="../eHelpDesk/UIStyleControls/Obout/Interface/styles/premiere_blue/OboutDropDownList"
runat="server" 
onselectedindexchanged="DdlTotalItem_SelectedIndexChanged">
<asp:ListItem Value="0" Text=""></asp:ListItem>
<asp:ListItem Value="1" Text="1"></asp:ListItem>
<asp:ListItem Value="2" Text="2"></asp:ListItem>
<asp:ListItem Value="3" Text="3"></asp:ListItem>
<asp:ListItem Value="4" Text="4"></asp:ListItem>
<asp:ListItem Value="5" Text="5"></asp:ListItem>
<asp:ListItem Value="25" Text="25"></asp:ListItem>
</cc1:OboutDropDownList>
</td></tr>
</table>
<div id="MasterListItem" runat="server" visible="false">
<table  visible="false" runat="server" id="MasterListItemTable" class="PurchaseOrderTableMaster" width="100%" cellpadding="0" cellspacing="0">
<tr><td><strong>Item Code</strong></td><td><strong>Description</strong></td><td><strong>Total Units</strong></td>
    <td><strong>Unit Measure</strong></td><td><strong>Quantity</strong></td><td><strong>Unit Price</strong></td><td><strong>Amount</strong></td></tr>
<tr>
<td><div class="LocationCityLength"  id="DivItemCode" runat="Server"></div></td>
<td><div class="LocationCityLength"  id="DivDescription" runat="server"></div></td>
<td><div class="LocationStateLength" id="DivTotalUnits" runat="server"></div></td>
<td><div class="LocationStateLength" id="DivUnitMeasure" runat="server"></div></td>
<td><div class="LocationStateLength" id="DivQuantity" runat="server"></div></td>
<td><div class="LocationStateLength" id="DivUnitPrice" runat="server"></div></td>
<td><div class="LocationStateLength" id="DivAmount" runat="server"></div></td>
</tr>
<tr><td colspan="7"><hr /></td></tr>
<tr><td colspan="4"></td>
<td><cc1:OboutTextBox ID="TxtTotalQuantity" Width="100" runat="server"></cc1:OboutTextBox></td>
<td><br /></td>
<td><cc1:OboutTextBox ID="TxtTotalAmount" Width="100" runat="server"></cc1:OboutTextBox></td>
</tr>
<tr><td colspan="7"><br /></td></tr>
</table>
</div>

<table cellpadding="0" cellspacing="0" class="PurchaseOrderTableMasterFooter"  width="100%">
<tr><td>Remarks:
<br /><cc1:OboutTextBox Width="684px" TextMode="MultiLine" 
        FolderStyle="../eHelpdesk/UIStyleControls/Obout/Interface/styles/premiere_blue/OboutTextBox" 
        ID="TxtRemarks" runat="server"></cc1:OboutTextBox>
</td>
<td align="center">
    <cc1:OboutButton  Text="Submit" ID="BtnSubmit"  
        FolderStyle="../eHelpdesk/UIStyleControls/Obout/Interface/styles/premiere_blue/OboutButton" 
        ToolTip="Add New PO" runat="server" onclick="BtnSubmit_Click">
    </cc1:OboutButton>
    <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
    <br />
    <asp:Label ID="Label2" runat="server" Text=""></asp:Label>

    </td>
</tr>
</table>
<asp:SqlDataSource ID="SdsPaymentTermsList" runat="server" ConnectionString="<%$ ConnectionStrings:SqlDataConnection %>" SelectCommand="SELECT [PaymentTermId], [Description] FROM [PaymentTermList] ORDER BY [PaymentTermId]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SdsShipperList" runat="server" ConnectionString="<%$ ConnectionStrings:SqlDataConnection %>" SelectCommand="SELECT [ShipperId], [WholeName], [Attn], [Address1], [City], [State], [Zip], [Country], [PhoneNo], [FaxNo], [ShipperStatus], [CreatedDate] FROM [Shipper] ORDER BY [WholeName]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SdsVendorList" runat="server" ConnectionString="<%$ ConnectionStrings:SqlDataConnection %>"  SelectCommand="SELECT [VendorId], [WholeName], [Attn], [Address1], [Address2], [City], [State], [Zip], [Country], [PhoneNo], [FaxNo], [BuyerStatus], [CreatedDate] FROM [Vendor] ORDER BY [WholeName]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlConsigneeList" runat="server" ConnectionString="<%$ ConnectionStrings:SqlDataConnection %>" SelectCommand="SELECT [ConsigneeId], [WholeName], [Attn], [Address1], [Address2], [City], [State], [Zip], [Country], [PhoneNo], [FaxNo], [ConsigneeStatus], [CreatedDate] FROM [Consignee] ORDER BY [WholeName]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlShipToList" runat="server" ConnectionString="<%$ ConnectionStrings:SqlDataConnection %>" SelectCommand="SELECT [ShipToId], [WholeName], [Attn], [Address1], [Address2], [City], [State], [Zip], [Country], [PhoneNo], [FaxNo], [ShipToStatus], [CreatedDate] FROM [ShipTo] order by WholeName"></asp:SqlDataSource>

Open in new window

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UI_PurchaseOrderPartA : System.Web.UI.UserControl
{
    //========================================================================
    public string ConfirmationNo { get { return TxtConfirmationNo.Text;}}
    public string ReferenceNo { get { return TxtReferenceNo.Text;}}
    public string BuyerReferenceNo { get { return TxtBuyerReferenceNo.Text;}}
    public int PaymentTerms { 
        get {
            if (!String.IsNullOrEmpty(DdlPaymentTerms.SelectedValue))
                    return int.Parse(DdlPaymentTerms.SelectedValue);
            else
                    return -1;
        }
    }
    public int ShipperId
    {
        get
        {
            if (!String.IsNullOrEmpty(DdlShipper.SelectedValue))
                return int.Parse(DdlShipper.SelectedValue);
            else
                return -1;
        }
    }
    public int VendorId
    {
        get
        {
            if (!String.IsNullOrEmpty(DdlVendor.SelectedValue))
                return int.Parse(DdlVendor.SelectedValue);
            else
                return -1;
        }
    }
    public int ConsigneeId
    {
        get
        {
            if (!String.IsNullOrEmpty(DdlConsignee.SelectedValue))
                return int.Parse(DdlConsignee.SelectedValue);
            else
                return -1;
        }
    }
    public int ShipToId
    {
        get
        {
            if (!String.IsNullOrEmpty(DdlShipTo.SelectedValue))
                return int.Parse(DdlShipTo.SelectedValue);
            else
                return -1;
        }
    }
    public string PortofLoading { get { return TxtPortofLoading.Text;}}
    public string Stowage { get { return TxtStowage.Text;}}
    public string ShippingDate { get { return TxtShippingDate.Text;}}
    public string PriceTerm01 { get { return TxtPriceTerms01.Text;}}
    public string PriceTerm02 { get { return TxtPriceTerms02.Text;}}
    public int TotalItem
    {
        get
        {
            if (!String.IsNullOrEmpty(DdlTotalItem.SelectedValue))
                return int.Parse(DdlTotalItem.SelectedValue);
            else
                return -1;
        }
    }
    public string Remark { get { return TxtRemarks.Text; } }
    //==========================================================================
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void CreateitemTextBoxes(int TotalItemCount)
    {
        for (int i = 0; i < TotalItemCount; i++)
        {
            Obout.Interface.OboutTextBox ItemTextBox = new Obout.Interface.OboutTextBox();
            ItemTextBox.ID = "TxtItem_" + i;
            ItemTextBox.Width = 150;

            Obout.Interface.OboutTextBox DescriptionTextBox = new Obout.Interface.OboutTextBox();
            DescriptionTextBox.ID = "TxtDescription_" + i;
            DescriptionTextBox.Width = 150;

            Obout.Interface.OboutTextBox TotalUnitsTextBox = new Obout.Interface.OboutTextBox();
            TotalUnitsTextBox.ID = "TxtTotalUnits_" + i;
            TotalUnitsTextBox.Width = 100;

            Obout.Interface.OboutTextBox UnitMeasureTextBox = new Obout.Interface.OboutTextBox();
            UnitMeasureTextBox.ID = "TxtMeasure_" + i;
            UnitMeasureTextBox.Width = 100;

            Obout.Interface.OboutTextBox QuantityTextBox = new Obout.Interface.OboutTextBox();
            QuantityTextBox.ID = "TxtQuantity_" + i;
            QuantityTextBox.Width = 100;

            Obout.Interface.OboutTextBox UnitPriceTextBox = new Obout.Interface.OboutTextBox();
            UnitPriceTextBox.ID = "TxtUnitPrice_" + i;
            UnitPriceTextBox.Width = 100;

            Obout.Interface.OboutTextBox AmountTextBox = new Obout.Interface.OboutTextBox();
            AmountTextBox.ID = "TxtAmount_" + i;
            AmountTextBox.Width = 100;

            DivItemCode.Controls.Add(ItemTextBox);
            DivDescription.Controls.Add(DescriptionTextBox);
            DivTotalUnits.Controls.Add(TotalUnitsTextBox);
            DivUnitMeasure.Controls.Add(UnitMeasureTextBox);
            DivQuantity.Controls.Add(QuantityTextBox);
            DivUnitPrice.Controls.Add(UnitPriceTextBox);
            DivAmount.Controls.Add(AmountTextBox);
        }

    }
    protected void DdlTotalItem_SelectedIndexChanged(object sender, EventArgs e)
    {
        int TotalItemCount = int.Parse(DdlTotalItem.SelectedValue);
        if (TotalItemCount >= 1)
        {
            // DdlTotalItem.Visible = true;
            MasterListItem.Visible = true;
            MasterListItemTable.Visible = true;
            CreateitemTextBoxes(TotalItemCount);
        }
        else
        {
            MasterListItem.Visible = false;
            MasterListItemTable.Visible = false;
        }
    }
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        // Begin: Add New PO =======================================
        TransactionAction NewTransaction = new TransactionAction();
        NewTransaction.ConfirmationNo = ConfirmationNo;
        NewTransaction.ReferenceNo = ReferenceNo;
        NewTransaction.BuyerReferenceNo = BuyerReferenceNo;
        NewTransaction.PaymentTerms = PaymentTerms;
        NewTransaction.ShipperId = ShipperId;
        NewTransaction.VendoerId = VendorId;
        NewTransaction.ConsigneeId = ConsigneeId;
        NewTransaction.ShipperId = ShipToId;
        NewTransaction.PortOfLoading = PortofLoading;
        NewTransaction.Stowage = Stowage;
        NewTransaction.ShippingDate = ShippingDate;
        NewTransaction.PriceTerm01 = PriceTerm01;
        NewTransaction.PriceTerm02 = PriceTerm02;
        NewTransaction.TotalItemNoCount = TotalItem;
        NewTransaction.Remarks = Remark;
        int NewPoId = NewTransaction.AddNewPO();
        if (NewPoId >= 1)
            Label1.Text = NewPoId.ToString();
        else
            Label1.Text = "";
        //End: Add New PO ==========================================
        //Begin: Add Item List =====================================
        for (int i = 0; i < TotalItem; i++)
        {
            Obout.Interface.OboutTextBox tb = (Obout.Interface.OboutTextBox)DivItemCode.FindControl("TxtItem_" + i);
            Label2.Text = tb.ToString();
        }
        //End Add Item List ========================================
    }
}

Open in new window


 protected void BtnSubmit_Click(object sender, EventArgs e)

for (int i = 0; i < TotalItem; i++)
        {
            Obout.Interface.OboutTextBox tb = (Obout.Interface.OboutTextBox)DivItemCode.FindControl("TxtItem_" + i);
            Label2.Text = tb.ToString();
        }

Just wonder why Label2.Text shown nothing. Everything is working fine to me.

Thanks,


0
Webboy2008
Asked:
Webboy2008
  • 11
  • 11
1 Solution
 
HainKurtSr. System AnalystCommented:
you loop something and keep assigning different values to  Label2.Text
logic seems wrong... it will keep the latest assigned value, and maybe it is empty...

try

Label2.Text = tb.ToString();
-->
Label2.Text = Label2.Text + " - " + i.ToString() + " : " + tb.ToString();

and see what happens...
0
 
Webboy2008Author Commented:
Same...

I researched a little bit. It may be because of that http://geekswithblogs.net/shahed/archive/2008/06/26/123391.aspx

I tried to add protected void Page_Init but it alerts that I have to different textbox id.
0
 
HainKurtSr. System AnalystCommented:
also try this

ItemTextBox.ID = "TxtItem_" + i;
-->
ItemTextBox.ID = "TxtItem_" + i;
ItemTextBox.Attributes("name","TxtItem_" + i);

and this

Obout.Interface.OboutTextBox tb = (Obout.Interface.OboutTextBox)DivItemCode.FindControl("TxtItem_" + i);
Label2.Text = tb.ToString();
-->
Label2.Text = Label2.Text + " - " + i.ToString() + " : " + Request("TxtItem_" + i.ToString());
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Webboy2008Author Commented:
ItemTextBox.Attributes - is alerted
'Non-invocable member 'System.Web.UI.WebControls.WebControl.Attributes' cannot be used like a method..
0
 
HainKurtSr. System AnalystCommented:
oops, we should use Add method

ItemTextBox.Attributes("name","TxtItem_" + i);
-->
ItemTextBox.Attributes.Add("name","TxtItem_" + i);
0
 
Webboy2008Author Commented:
Label2.Text = Label2.Text + "_" + i.ToString() + ":" + Request("TxtItem_" + i.ToString());

Request - is alerted to 'It does not exist in the current context'.
0
 
HainKurtSr. System AnalystCommented:
try this

Label2.Text = Label2.Text + "_" + i.ToString() + ":" + Request.Form["TxtItem_" + i.ToString()];
0
 
Webboy2008Author Commented:
No error, but it shows nothing/no value
0
 
HainKurtSr. System AnalystCommented:
you should debug and see what is the value for TotalItem & DdlTotalItem.SelectedValue

put a breakpoint on line 166, or this line

       for (int i = 0; i < TotalItem; i++)

and see what are the values (either mouse hover or or select right click and click "add watch")...
0
 
HainKurtSr. System AnalystCommented:
did you also add the name attributes? when you add those items with names, they should be available in Request.Form collection...
0
 
Webboy2008Author Commented:
I added it...


  for (int i = 0; i < TotalItemCount; i++)
        {
            Obout.Interface.OboutTextBox ItemTextBox = new Obout.Interface.OboutTextBox();
            ItemTextBox.ID = "TxtItem_" + i;
            ItemTextBox.Attributes.Add("name", "TxtItem_" + i);
            ItemTextBox.Width = 150;
}
0
 
Webboy2008Author Commented:
TotalItem value is there...
0
 
HainKurtSr. System AnalystCommented:
TotalItem value is there... and showing a value like 3,4,25, etc. and you changed your loop like this

        for (int i = 0; i < TotalItem; i++)
        {
            //Obout.Interface.OboutTextBox tb = (Obout.Interface.OboutTextBox)DivItemCode.FindControl("TxtItem_" + i);
            //Label2.Text = tb.ToString();
            Label2.Text = Label2.Text + "_" + i.ToString() + ":" + Request.Form["TxtItem_" + i.ToString()];
        }

and you get nothing? after breakpoint debug it (press F10 and see what it is doing)
0
 
Webboy2008Author Commented:
 for (int i = 0; i < TotalItem; i++)
        {
            //Obout.Interface.OboutTextBox tb = (Obout.Interface.OboutTextBox)DivItemCode.FindControl("TxtItem_" + i);
            //Label2.Text = Label2.Text + "_" + i.ToString() + ":" + Request.Form["TxtItem_" + i.ToString()];
            Label2.Text = Label2.Text + "_" + i.ToString() + ":" + Request.Form["TxtItem_" + i.ToString()];
        }

I still got nothing, no value at all.

0
 
HainKurtSr. System AnalystCommented:
on this line app stops

for (int i = 0; i < TotalItem; i++)

you check the TotalItem value and it shows a value, you loop in for (){...}

and Label2.Text is nothing? No error! if it does not go into loop, TotalItem should be -1, if it is > 0 then it should go into loop and Label2.Text should be something... at least like

_0:_1:_2:_3:_4:

if TotalItem is 5
0
 
Webboy2008Author Commented:
I know what you mean...What I mean nothing is I don't see the value from text box. Yes, you are right
when TotalItem has 1, it shows _0:

0
 
Webboy2008Author Commented:
Regardless, I still don't see the value from the textbox...
0
 
HainKurtSr. System AnalystCommented:
but I don't see any form element!

put all your aspx code in form

<form name=Form1 runat=server>
... all your aspx code here
</form>

if you have form, check the html source before clicking the button, do you see lements with name=TxtItem_1, name=TxtItem_2 etc...
0
 
Webboy2008Author Commented:
This is ascx, and it is located in masterpage which already included ,<form

TotalItem is actually a dropdown with autopostback.

When I select the number inside of the dropdown, and check the view source, it shows the TextItem_0

After I clicked submit button, Textitem_0 is not there.
0
 
HainKurtSr. System AnalystCommented:
if TextItem_X in view source (in form elements) then when it is submitted you should be able to get values with Request.Form["TextItem_"+i]

try regular asp:textbox

Obout.Interface.OboutTextBox ItemTextBox...

-->

TextBox ItemTextBox...

and see if you can get it with request...
0
 
Webboy2008Author Commented:
I have to use obout text boxes
0
 
HainKurtSr. System AnalystCommented:
ok, but just try with regular box to see you get the values... this is to test everything is ok, but the problem is with obout text boxes... if this is the case we can find a solution for obout text boxes...
 
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 11
  • 11
Tackle projects and never again get stuck behind a technical roadblock.
Join Now