This project is read-only.

VB Sample

Apr 1, 2009 at 2:01 AM
Hello,

I am very new to asp .net and would appreciate any assistance or examples on using this control with vb instead of c#.

I have tried using a c# to vb converter, wich up until now has been 100% successful, however when converting the c# samples I am getting the follow error in VS2008:

My codebehind looks like this;

Imports

System

 

Imports

System.Collections

 

Imports

System.Configuration

 

Imports

System.Data

 

Imports

System.Linq

 

Imports

System.Web

 

Imports

System.Web.Security

 

Imports

System.Web.UI

 

Imports

System.Web.UI.HtmlControls

 

Imports

System.Web.UI.WebControls

 

Imports

System.Web.UI.WebControls.WebParts

 

Imports

System.Xml.Linq

 

Imports

Artem.Web.UI.Controls

 

Partial

Public Class _default

 

 

Inherits Artem.GoogleMap.WebSite.UI.PageBase

 

 

Protected Overloads Overrides Sub OnLoad(ByVal e As EventArgs)

 

 

MyBase.OnLoad(e)

 

 

'

 

 

If IsPostBack Then

 

 

Dim address As String = _txtAddress.Text

 

GoogleMap1.Address = address

GoogleMap1.Markers.Clear()

GoogleMap1.Markers.Add(

New GoogleMarker(address))

 

 

', "Address: " + address));

 

 

End If

 

 

End Sub

 

End

Class

 



My aspx page looks like this:

<%

@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" CodeFileBaseClass="Artem.GoogleMap.WebSite.UI.PageBase" %>

 

<%

@ Register assembly="Artem.GoogleMap" namespace="Artem.Web.UI.Controls" tagprefix="artem" %>

 

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

html xmlns="http://www.w3.org/1999/xhtml">

 

<

head runat="server">

 

 

<title>Untitled Page</title>

 

</

head>

 

<

body>

 

 

<form id="form1" runat="server">

 

 

<div>

 

Address

 

<asp:TextBox ID="_txtAddress" runat="server"></asp:TextBox>

 

 

<asp:Button ID="_btnShow" runat="server" Text="Show" />

 

 

<artem:GoogleMap ID="GoogleMap1" runat="server" Width="800px" Height="560px" Latitude="42.1229" Longitude="24.7879"

 

 

Zoom="4">

 

 

</artem:GoogleMap>

 

 

</div>

 

 

</form>

 

</

body>

 

</

html>

 


However it reports that "Artem.GoogleMap.WebSite.UI.PageBase" is not declared.

I have made the appropriate changes to the web.config file. 

Thanks

Apr 11, 2009 at 5:31 AM
mark
Jun 9, 2009 at 4:29 PM
Edited Jun 9, 2009 at 4:31 PM

Hey OzBoss,

I just found this post and was running into the same basic problem.  I solved the "Artem.GoogleMap.Website.UI.PageBase" is not declared error by doing the following:

1. In your application, create a folder call App_Code
2. Under that folder, create a folder called UI
3. In the UI folder, create a new Class file called PageBase.vb
4. In the sample application in the same path, there is a class called PageBase.cs.  Open that file, copy the contents to your C# to VB.NET converter and convert the code, then copy it to the new class file you just created.
5. If you build the project, it should build without any errors.

My problem is now that I've solved this issue is that it says it "Cannot load type 'Artem.GoogleMap.Website.UI.PageBase', so I'm trying to solve that.  If anyone has any thoughts, I would love to hear them.

Thanks,

Jim P.