Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o..."Partial Methods" vb class missing from tutorial"Partial Methods" vb class missing from tutorial
Previous
 
Next
New Post
8/3/2008 8:01 AM
 

I am trying to get my head around Linq to SQL by following Michael Washington's excellent tutorial package. I code in VB, so I have been substituting vb code as I go, using the vb version supplied. That worked great through Part 2, Application Look and Feel. It falls apart at Category Administration, because the "PartialMethods" class doesn't have an equivalent in the vb install kit. I'm trying to just wing it, but my cs->vb skills aren't good enough. When I try to create the "DeleteThingsForSale_Category" method, I get a message that a partial method must be empty.

Is it possible that there is more vb code available, that fully parallels the cs-based tutorial?

 
New Post
8/3/2008 1:28 PM
 

The VB version of that tutorial is posted here:

Things4SaleVB_02.00.00_Install.zip



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
8/3/2008 1:34 PM
 

Hmm I just looked at the code and it appears I must have ran into the same error and coded the VB version without the partial method.

However this may help:

How to: Create a Partial Method (Visual Basic)



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
8/6/2008 7:18 AM
 

I tried installing the vb kit you referenced, and ran into other problems. Also, it seemed to me it didn't go all the way to implementing the ListView solution described in part 3 of the tutorial. So I stepped through all of the tutorial steps, converting C# to VB as I went along, and I have it working 90% (?). The only thing that doesn't work is expansion to the list of items when the "+" is clicked on the LVGroup listview.

I think the problem is in the conversion of the "v13wstat3" region or the "ListView" region of the view.ascx.vb code behind.

Hmm, I just realized I don't see an option for uploading a file. I was going to upload the installer I have built, but I'll just paste inline the code for those two regions. I'll try to email you the installer.

Thanks for all help!

#Region

"v13wstat3"

<Serializable()> _

 

 

Public Class CategoryPublic Property Name() As String

 

Get

 

End Get

 

 

Set(ByVal value As String)End Set

 

End Property

 

End Class

 

 

Public Property Categories() As List(Of Category)Get

 

If v13wstat3("Categories") Is Nothing Then

 

 

Return New List(Of Category)()Else

 

 

Return DirectCast(v13wstat3("Categories"), List(Of Category))End If

 

End Get

 

v13wstat3(

 

Set(ByVal value As List(Of Category))"Categories") = valueEnd Set

 

#End

#Region

End Property Region "ListView"

 

 

 

Protected Sub lvItems_ItemDataBound(ByVal sender As Object, ByVal e As ListViewItemEventArgs)Dim LinkButton As LinkButton = DirectCast(e.Item.FindControl("lnkSelect"), LinkButton)If (Not PortalSecurity.IsInRole("Administrators")) And Not (Entities.Users.UserController.GetCurrentUserInfo().UserID = Convert.ToInt16(LinkButton.CommandArgument)) Then

e.Item.Controls(1).Visible =

False

 

End If

 

End Sub

 

 

 

 

 

 

 

Protected Sub LVGroup_ItemDataBound(ByVal sender As Object, ByVal e As ListViewItemEventArgs)Dim Panel As Panel = DirectCast(e.Item.FindControl("pnlItems"), Panel)Dim objLinkButton As LinkButton = DirectCast(e.Item.FindControl("MinMax"), LinkButton)Dim results = From cat In Categories _Where cat.Name = objLinkButton.CommandArgument _Select catIf results.Count() <> 0 Then

Panel.Visible =

True

objLinkButton.Text =

"-"

 

End If

 

#End

#Region

End Sub Region "MinMax"

 

 

 

 

 

 

Protected Sub MinMax_Click(ByVal sender As Object, ByVal e As EventArgs)Dim objLinkButton As LinkButton = DirectCast(sender, LinkButton)Dim results = From cat In Categories _Where cat.Name = objLinkButton.CommandArgument _Select catIf objLinkButton.Text = "+" Then

 

If results.Count() = 0 Then

 

objCategory.Name = objLinkButton.CommandArgument

 

colCategories.Add(objCategory)

Categories = colCategories

 

Dim objCategory As New CategoryDim colCategories As List(Of Category) = CategoriesEnd If

 

Else

 

If results.Count() <> 0 Then

 

 

objCategory = colCategories.FirstOrDefault(

colCategories.Remove(objCategory)

Categories = colCategories

 

Dim colCategories As List(Of Category) = CategoriesDim objCategory As CategoryFunction(c) c.Name = objLinkButton.CommandArgument)End If

 

End If

LVGroup.DataBind()

 

#End

End Sub Region

 
New Post
8/6/2008 8:07 AM
 

Michael,

I tried uploading my code to your webmaster email account, but it didn't like the attachment. I've sent a followup email, inviting you to email me with upload instructions.

Worth

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o..."Partial Methods" vb class missing from tutorial"Partial Methods" vb class missing from tutorial


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out