Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > is this the right way in vb?

Reply
Thread Tools

is this the right way in vb?

 
 
=?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=
Guest
Posts: n/a
 
      05-06-2005
This works, i adds a confirm box to a datagrid control. However is this the
correct way to check for the an item or alt item in the onitemdatabound
event/sub?

Private Sub dgOrders_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgOrders.ItemDataBound
If e.Item.ItemIndex <> -1 Then
Dim thslnkBtn As LinkButton
thslnkBtn = e.Item.FindControl("delThis")
thslnkBtn.Attributes.Add("onClick", "return confirm('Are you
sure you wish to delete this item?');")
End If
End Sub
or should it be done like the C# way "if(e.Item.FindControl("DeleteLink") !=
null))".
If so how?
thanks
kes

(i like the C# way better:
 
Reply With Quote
 
 
 
 
TJS
Guest
Posts: n/a
 
      05-07-2005
write your code in C# and convert it here

http://authors.aspalliance.com/aldot...translate.aspx



"Kurt Schroeder" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> This works, i adds a confirm box to a datagrid control. However is this
> the
> correct way to check for the an item or alt item in the onitemdatabound
> event/sub?
>
> Private Sub dgOrders_ItemDataBound(ByVal sender As Object, ByVal e As
> System.Web.UI.WebControls.DataGridItemEventArgs) Handles
> dgOrders.ItemDataBound
> If e.Item.ItemIndex <> -1 Then
> Dim thslnkBtn As LinkButton
> thslnkBtn = e.Item.FindControl("delThis")
> thslnkBtn.Attributes.Add("onClick", "return confirm('Are you
> sure you wish to delete this item?');")
> End If
> End Sub
> or should it be done like the C# way "if(e.Item.FindControl("DeleteLink")
> !=
> null))".
> If so how?
> thanks
> kes
>
> (i like the C# way better:



 
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
Dynamic Menu Items is not right aligned with Right to Left documen =?Utf-8?B?QmlzaG95?= ASP .Net 0 12-28-2006 11:39 AM
Right-Click With Mouse and Toolba Buttonsr Don't Work Right Bigfoot It Is Computer Support 0 10-30-2006 06:08 PM
Tool to enable Right click on pages where Right click is disabled tsteinke@gmail.com Computer Support 4 08-28-2005 11:53 PM
Tool to right click image in windows explorer and rotate image right or left 90 degrees siliconpi Digital Photography 2 11-29-2004 12:56 PM
pass the right form input to the right control Tom ASP .Net 0 12-11-2003 03:07 AM



Advertisments