is this too heavy

Discussion in 'ASP .Net' started by =?Utf-8?B?cm9kY2hhcg==?=, Nov 24, 2004.

  1. hey all,

    i was wondering if the following code, in general, if it wouldn't always be
    a good idea or if there's a better way to do it.

    Private Sub DataGrid2_ItemDataBound(ByVal sender As Obj...
    If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
    ListItemType.AlternatingItem Then
    Dim lnb As LinkButton
    lnb = e.Item.Cells(1).FindControl("LinkButton1")
    lnb.Text = e.Item.DataItem("OrderID")
    End If

    All i'm trying to do is take a field in each row of the datasource and
    assign it to the text of a link button so users can click it.

    Thanks,
    rodchar
     
    =?Utf-8?B?cm9kY2hhcg==?=, Nov 24, 2004
    #1
    1. Advertising

  2. This looks like perfectly good code to me.
    I've used similar code successfully before.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net


    "rodchar" <> wrote in message
    news:...
    > hey all,
    >
    > i was wondering if the following code, in general, if it wouldn't always
    > be
    > a good idea or if there's a better way to do it.
    >
    > Private Sub DataGrid2_ItemDataBound(ByVal sender As Obj...
    > If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
    > ListItemType.AlternatingItem Then
    > Dim lnb As LinkButton
    > lnb = e.Item.Cells(1).FindControl("LinkButton1")
    > lnb.Text = e.Item.DataItem("OrderID")
    > End If
    >
    > All i'm trying to do is take a field in each row of the datasource and
    > assign it to the text of a link button so users can click it.
    >
    > Thanks,
    > rodchar
     
    Steve C. Orr [MVP, MCSD], Nov 24, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?cm9kY2hhcg==?=

    Joe Fallon Guest

    Good god, I hope not!!
    I use code like that all the time. <g>
    --
    Joe Fallon



    "rodchar" <> wrote in message
    news:...
    > hey all,
    >
    > i was wondering if the following code, in general, if it wouldn't always
    > be
    > a good idea or if there's a better way to do it.
    >
    > Private Sub DataGrid2_ItemDataBound(ByVal sender As Obj...
    > If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
    > ListItemType.AlternatingItem Then
    > Dim lnb As LinkButton
    > lnb = e.Item.Cells(1).FindControl("LinkButton1")
    > lnb.Text = e.Item.DataItem("OrderID")
    > End If
    >
    > All i'm trying to do is take a field in each row of the datasource and
    > assign it to the text of a link button so users can click it.
    >
    > Thanks,
    > rodchar
     
    Joe Fallon, Nov 25, 2004
    #3
  4. Thank you everyone for your feedback. This helps a lot.

    "Joe Fallon" wrote:

    > Good god, I hope not!!
    > I use code like that all the time. <g>
    > --
    > Joe Fallon
    >
    >
    >
    > "rodchar" <> wrote in message
    > news:...
    > > hey all,
    > >
    > > i was wondering if the following code, in general, if it wouldn't always
    > > be
    > > a good idea or if there's a better way to do it.
    > >
    > > Private Sub DataGrid2_ItemDataBound(ByVal sender As Obj...
    > > If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
    > > ListItemType.AlternatingItem Then
    > > Dim lnb As LinkButton
    > > lnb = e.Item.Cells(1).FindControl("LinkButton1")
    > > lnb.Text = e.Item.DataItem("OrderID")
    > > End If
    > >
    > > All i'm trying to do is take a field in each row of the datasource and
    > > assign it to the text of a link button so users can click it.
    > >
    > > Thanks,
    > > rodchar

    >
    >
    >
     
    =?Utf-8?B?cm9kY2hhcg==?=, Nov 26, 2004
    #4
  5. Pretty nice code!
    Patrick

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Patrick Olurotimi Ige, Nov 26, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.microsoft.com

    HTTPHandler 404 Under Heavy Load

    news.microsoft.com, Jun 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    495
    Darren Clark
    Jul 21, 2004
  2. roygon
    Replies:
    10
    Views:
    570
    William Buchanan
    Apr 7, 2006
  3. Blazej Zak
    Replies:
    2
    Views:
    540
    Blazej Zak
    Nov 19, 2003
  4. Minti
    Replies:
    4
    Views:
    886
    John C. Bollinger
    Feb 12, 2004
  5. Luigi Donatello Asero

    Too big and heavy images?

    Luigi Donatello Asero, Jan 16, 2004, in forum: HTML
    Replies:
    4
    Views:
    482
    Luigi Donatello Asero
    Jan 17, 2004
Loading...

Share This Page