Results 1 to 4 of 4

Thread: storing variable

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    storing variable

    Is there a way to save this value in a variable? I'd like to use it in a query...

    <%# Container.DataItem ("Bid_Id")%>

    Or is there another way I can get that value from the datagrid. I need the value before the datagrid is populated. I need to append data to the datagrid depending on the value of ("Bid_Id")
    Last edited by EyeTalion; Jan 27th, 2003 at 11:35 AM.

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    You need to write an event handler for the onItemDataBound event.

    In that handler, you can check e.item.cells(index).text for the value of that cell and then take appropriate action, such as setting the e.item.cells(index_another).text to something else.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  3. #3

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    I have an event handler for the ItemCreated...How can I bring that variable over from the VBCode page to the HTML? ...Heres the code I have now. I need a bidID value for the where clause...

    Code:
    Dim strSQL As String = "select bid_status_code, pre_bid_ind from pbss.pbss_bid_schedule where bid_id='" & bidid & "'" 
    
    
    Do While objDataReader.Read = True%>
    
    										<%If objDataReader("bid_status_code") = 1 Then%>
    										<%# Container.DataItem ("Bid_Schedule_Desc")%>
    										<%else%>
    										<b>DELAYED</b>
    										<%# Container.DataItem ("Bid_Schedule_Desc")%>
    										<%end if%>
    										<%loop%>

  4. #4

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    Could I use the DataKeyField on the HTML side to get that value?


    <%Dim selectedRow As String = DataGrid1.DataKeyField%>

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