Results 1 to 4 of 4

Thread: Validaion Controls

  1. #1

    Thread Starter
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Validaion Controls

    I generate a table on the fly in my page. For each row i have a radiobutton so the user can select an item on the table to view.

    How can i add a validation control to check whether the user has selected a row in my table.

    Currently i validate the control when the user hits the view button but when the button is click the tables data is not reloaded cos of the postback, maybe i should cache that?

    VB Code:
    1. While (l_e.MoveNext = True)
    2.                     l_order = CType(l_e.Current, Order)
    3.                     Dim detailsRow As TableRow = New TableRow
    4.  
    5.                     Dim l_cellSelect As New TableCell
    6.                     Dim l_selector As New RadioButton
    7.                     l_selector.ID = l_order.OrderHeader.OrderHeaderId.ToString
    8.                     l_selector.GroupName = ORDER_SELECTION
    9.                     l_cellSelect.Controls.Add(l_selector)
    10.                     detailsRow.Cells.Add(l_cellSelect)
    11.  
    12.                     Dim l_nameCell As TableCell = New TableCell
    13.                     l_nameCell.Text = l_order.Customer.CustomerName
    14.                     detailsRow.Cells.Add(l_nameCell)
    15.  
    16.                     Dim l_dispatchCell As TableCell = New TableCell
    17.                     l_dispatchCell.Text = l_order.OrderHeader.DispatchNo.ToString
    18.                     detailsRow.Cells.Add(l_dispatchCell)
    19.  
    20.                     Dim l_poNoCell As TableCell = New TableCell
    21.                     l_poNoCell.Text = l_order.OrderHeader.CustPONo
    22.                     detailsRow.Cells.Add(l_poNoCell)
    23.  
    24.                     Dim l_poDateCell As TableCell = New TableCell
    25.                     l_poDateCell.Text = l_order.OrderHeader.CustPODate.ToString("dd/MM/yyyy")
    26.                     detailsRow.Cells.Add(l_poDateCell)
    27.  
    28.                     'Add the new row to the table.
    29.                     tblOrders.Rows.Add(detailsRow)
    30.                 End While
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  2. #2
    Fanatic Member Valleysboy1978's Avatar
    Join Date
    Nov 2004
    Location
    Planet Xeoroaniar CC Posts:1,928,453,459,361
    Posts
    770

    Re: Validaion Controls

    could you not store the DataTable in a session variable?
    Life is one big rock tune

  3. #3

    Thread Starter
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Validaion Controls

    yes i could store the array of order objects in a session, but for performance reasons im trying to keep sessions to a minimum...

    but if i could get the validation field working for the selection it would be less overhead

    can you add a validator on the fly to the selection or is what im trying to do hard
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  4. #4
    Fanatic Member Valleysboy1978's Avatar
    Join Date
    Nov 2004
    Location
    Planet Xeoroaniar CC Posts:1,928,453,459,361
    Posts
    770

    Re: Validaion Controls

    I'm pretty sure you can add any kind of control on the fly. May not be very consistent though. Besides the session variable is held server-side so if the page is doing a postback anyway the performance difference should be negligible. Try using the trace before and after declaring a postback just to check
    Life is one big rock tune

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width