Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Using an IF statment within an ItemTemplate

Reply
Thread Tools

Using an IF statment within an ItemTemplate

 
 
David Lozzi
Guest
Posts: n/a
 
      03-16-2005
Hello,

I have a datagrid listing bill to addresses. One column specifies whether or
not the bill to is the primary for the customer. Here's my dilemma: I would
like to add the option to set another bill to to primary within the data
grid. So something like this

<% if container.dataitem("bitPrimary") = 1 then %>
Primary
<% else %>
<asp:LinkButton Runat="server"
commandname="setPrimary(<%#container.dataitem("ID" )%>)">Make
Primary</asp:LinkButton>
<% end if %>

So, if the item is already primary, it will simply state that. If it is not,
then give the user the option to set it. I can hanld ethe function
setPrimary(), but this IF statement doesn't work within the datagrid.

Thanks!


--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com


 
Reply With Quote
 
 
 
 
Elton Wang
Guest
Posts: n/a
 
      03-16-2005
Hi David,

Instead in HTML section, you can process your logic in
ItemDataBound event. It's easy for you to code any logic.

HTH

Elton Wang
http://www.velocityreviews.com/forums/(E-Mail Removed)

>-----Original Message-----
>Hello,
>
>I have a datagrid listing bill to addresses. One column

specifies whether or
>not the bill to is the primary for the customer. Here's

my dilemma: I would
>like to add the option to set another bill to to primary

within the data
>grid. So something like this
>
><% if container.dataitem("bitPrimary") = 1 then %>
> Primary
><% else %>
> <asp:LinkButton Runat="server"
>commandname="setPrimary(<%#container.dataitem("ID ")%
>)">Make
>Primary</asp:LinkButton>
><% end if %>
>
>So, if the item is already primary, it will simply state

that. If it is not,
>then give the user the option to set it. I can hanld ethe

function
>setPrimary(), but this IF statement doesn't work within

the datagrid.
>
>Thanks!
>
>
>--
>David Lozzi
>Web Applications Developer
>dlozzi@(remove-this)delphi-ts.com
>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statment (assistance) vncntj@hotmail.com ASP .Net 2 01-09-2006 03:20 AM
PIX route inside statment John Cisco 1 09-27-2005 03:06 AM
can code inside a Repeater's ItemTemplate modify controls in the ItemTemplate? Bennett Haselton ASP .Net 1 09-24-2004 01:59 AM
Using "For Each ctrl In.." Statment Inside UserControl crjunk ASP .Net 2 09-03-2004 06:23 PM
Return statment JL ASP .Net 2 12-17-2003 10:47 AM



Advertisments