471,319 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

VS2005 is a PIECE of Garbage and is bug Ridden

VS2005 is a PIECE of Garbage and is bug Ridden, I wonder how many others
feel the same, I am so sorry that I have moved away from VS2003,

VS2005 is unstable, and half the stuff doesn't work, Microsft has spent so
much time trying to make it simply that when you try to do something useful
with it it doesn't work...

Half the time it crashes, and menu items appear for things you cannot do.
For example, Go into component designer, or SQLDataAdapter component for
WebForms is junk, doesn't come installed, so you add it to the toolbar and
it doesn't work, it breaks webforms.

I guess this is now a good system for doing things the microsoft way, but
build anytihng decent and forget it..,

VS2005 is a WASTE of MONEY.. I advise all to NOT upgrade, grab yourself
the express additons the FREE versions, at least you won't feel so riped...

Anyway my two cents...
Dec 1 '05
56 3305
None of my ASPX files with VB behind them will port - I had to convert them
to C#!!
I will get an example and post it here asap

"Alvin Bruney - ASP.NET MVP" wrote:
can you post the code that will not port?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

"mishj" <mi***@discussions.microsoft.com> wrote in message
news:52**********************************@microsof t.com...
I am having troubles converting vb code behind to vs2005 - I converted c#
code behind no problem at all, but I get compile errors with vb that I

cant
work out what the cause is - for every one of my vb code behind files, the
same errors!!
InitializeCulture is not a member of ASP.[filename].aspx
CreateResourceBasedLiteralControl is not a member of ...
Context is not a member of [project name].[filename]

Help??!!

"Fred Nelson" wrote:
Hi Rob:

I had some problems with it also at first. Now I have converted two
major apps from VS.2003 and it seems to be fine for me.

Hang in there - it will get better!

Fred
Rob Dob wrote:

> VS2005 is a PIECE of Garbage and is bug Ridden, I wonder how many others > feel the same, I am so sorry that I have moved away from VS2003,
>
> VS2005 is unstable, and half the stuff doesn't work, Microsft has spent so > much time trying to make it simply that when you try to do something useful > with it it doesn't work...
>
> Half the time it crashes, and menu items appear for things you cannot do. > For example, Go into component designer, or SQLDataAdapter component for > WebForms is junk, doesn't come installed, so you add it to the toolbar and > it doesn't work, it breaks webforms.
>
> I guess this is now a good system for doing things the microsoft way, but > build anytihng decent and forget it..,
>
> VS2005 is a WASTE of MONEY.. I advise all to NOT upgrade, grab yourself > the express additons the FREE versions, at least you won't feel so riped... >
> Anyway my two cents...
>
>


Feb 22 '06 #51
The following is an example (slightly different to the others) of a piece of
asp.net that compiles fine if it has c# behind it but not if vb is behind it.
If vb is behind it, the <style> tag gives the following error:
Element 'style' must be contained within a parent element

However, the really weird thing is that sometimes when I compile this doesnt
cause an error, even though I make no changes to the code!!! Maddening!

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<%@ Register TagPrefix="wcp" Namespace="WCPierce.Web.UI.WebControls"
Assembly="WCPierce.Web" %>

<!-- Note that this style sheet will only be imported in IE4 and 5 and Opera
-->
<STYLE type="text/css">
@import url(defaultlayout.css);
</STYLE>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>GMap Basics</title>
<style type="text/css">
v\:* {
behavior:url(#default#VML);
}
</style>
</head>
<script>

</script>
<body onload="javascript: displayDirections(
document.getElementById('HiddenField1').value); ">
<iframe id="frameDirections" width=700 height=700
style="position:absolute; top:20px; left:299px; visibility:visible ">No
directions at this time</iframe>
<iframe id="framegMap" width="500px" height="500px"
style="position:absolute; top:25px; left:299px; visibility:hidden ">No Map at
this time</iframe>
<form id="Form1" method="post" runat="server">
<table>
<script>
var contentArr = new Array();
bFillFromAddress=true;
function displayDirections(strURL) {

document.getElementById('frameDirections').src = strURL;

}
function getAddressInfo() {

var strGeneratedURL = "http://maps.google.com/maps?saddr=";

//start address
strGeneratedURL = strGeneratedURL +
document.getElemetById('fromAddr').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('fromCity').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('fromState').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('fromZip').value ;
//destination address
strGeneratedURL = strGeneratedURL + "&daddr=" +
document.getElementById('toAddr').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('toCity').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('toState').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('toZip').value ;

//URL_displayInBrowser(strGeneratedURL);
document.getElementById('HiddenField1').value = strGeneratedURL;

}
function MapDiv_hide(strId) {

if (document.layers) {

document[strId].visibility = 'hide';

}
else {
if (document.all) {

document.all[strId].style.visibility='hidden';
}
else {
if (document.getElementById) {

document.getElementById(strId).style.visibility =
'hidden';
document.getElementById("frame" +
strId).style.visibility='hidden';
}
}
}

}

function Div_hide(strId) {

if (document.layers) {
document[strId].visibility = 'hide';

}
else {
if (document.all) {
document.all[strId].style.visibility = 'hidden';

}
else {
if (document.getElementById) {
document.getElementById(strId).style.visibility =
'hidden';
document.getElementById("frame" +
strId).style.visibility='hidden';
}
}
}

}

function Div_show(strId) {
if (document.layers) {
document[strId].visibility = 'show';

}
else {
if (document.all) {

document.all[strId].style.visibility = 'visible';

}
else {
if (document.getElementById) {
document.getElementById(strId).style.visibility =
'visible';
document.getElementById(strId).zIndex=1000;
document.getElementById("frame" +
strId).style.visibility='visible';

}
}
}

}

function GMap_Click(overlay, point)
{
if( overlay )
this.removeOverlay(overlay);
else if( point )
{
this.addOverlay(new GMarker(point));
if (bFillFromAddress=true)
{

}
}
}
function GMap_placeOverlay(overlay, point)
{
var map = new GMap(document.getElementById("GMap_div"));

if( overlay ){

map.removeOverlay(overlay);
}
else if( point )
{

var gMarker = new GMarker(point);

map.addOverlay(gMarker);
}
}

</script>
<tr>
<td valign="top">
<table>
<tr>
<td><b>From Address:</b></td>
<td><asp:TextBox ID="fromAddr" runat="server" maxlength=35
Text=""></asp:TextBox></td>
</tr>
<tr>
<td><b>City:</b></td>
<td><asp:TextBox ID="fromCity" runat="server"
maxlength=35 Text="Atlanta"></asp:TextBox></td>
</tr>
<tr>
<td><b>State:</b></td>
<td><asp:TextBox ID="fromState" runat="server"
maxlength=35 Text="GA"></asp:TextBox></td>
</tr>
<tr>
<td><b>Zip:</b></td>
<td><asp:TextBox ID="fromZip" runat="server"
maxlength=35 Text=""></asp:TextBox></td>
</tr>
<tr>
<td style="height: 26px"><b>Lat</b></td>
<td style="height: 26px"><asp:TextBox runat="server"
ID="fromLat" ></asp:TextBox></td>
</tr>
<tr>
<td><b>Lon</b></td>
<td><asp:TextBox runat="server" ID="fromLon"
</asp:TextBox></td> </tr>
<tr><td> </td></tr>

<tr>
<td><b>To Address:</b></td>
<td><asp:TextBox ID="toAddr" runat="server" maxlength=35
Text=""></asp:TextBox></td>
</tr>
<tr>
<td><b>City:</b></td>
<td><asp:TextBox ID="toCity" runat="server" maxlength=35
Text="Marietta"></asp:TextBox></td>
</tr>
<tr>
<td><b>State:</b></td>
<td><asp:TextBox ID="toState" runat="server"
maxlength=35 Text="GA"></asp:TextBox></td>
</tr>
<tr>
<td><b>Zip:</b></td>
<td><asp:TextBox ID="toZip" runat="server" maxlength=35
Text="30067"></asp:TextBox></td>
</tr>
<tr>
<td><b>Lat</b></td>
<td><asp:TextBox runat="server" ID="toLat"</asp:TextBox></td> </tr>
<tr>
<td style="height: 26px"><b>Lon</b></td>
<td style="height: 26px"><asp:TextBox runat="server"
ID="toLon" ></asp:TextBox></td>
</tr>
<tr>
<td style="height: 26px">
<b>Distance </b><br />(as the crow flies)</td>
<td style="height: 26px">
<asp:TextBox ID="distance"
runat="server"></asp:TextBox></td>
</tr>
<!--<tr><td><input id="btnGetDirections" type=button
value="Directions" onClick="javascript: getAddressInfo(); displayDirections(
document.getElementById('HiddenField1').value);"/></td></tr>-->

</table>
<asp:HiddenField ID="HiddenField1" runat="server" />
<asp:Button ID="getDirections" runat="server"
AutoPostBack="true" Text="Directions" />
<asp:HiddenField ID="HiddenFieldLatLonFrom" runat="server" />
<asp:HiddenField ID="HiddenFieldLatLonTo" runat="server" />
<asp:HiddenField ID="oldFromLat" runat="server" />
<asp:HiddenField ID="oldFromLon" runat="server" />
<asp:HiddenField ID="oldToLat" runat="server" />
<asp:HiddenField ID="oldToLon" runat="server" />
<wcp:GMap runat="server" id="gMap" Width="250px"
Height="250px" />
<!--<YMap runat="server" id="yMap" Width="250px"
Height="250px" />-->
</td>


<td>
</td>
</tr>

</table>

<script>

</script>
<script>

function replaceString( strInString, strToSearchFor, strToReplaceWith)
{

while (strInString.indexOf(strToSearchFor)>0)
{
iPosFound=strInString.indexOf(strToSearchFor);

if (strToSearchFor == "apos;")
{

strInString = strInString.substr(0, iPosFound-2) + strToReplaceWith +
strInString.substr(iPosFound+strToSearchFor.length );

}
else
{
strInString = strInString.substr(0, iPosFound-1) + strToReplaceWith +
strInString.substr(iPosFound+strToSearchFor.length );

}
}
return strInString;
}

</script>
<script>


function urlFetch(strURL){
XMLDoc = new ActiveXObject("Msxml2.DOMDocument.3.0")
XMLDoc.async = false

XMLDoc.load(strURL)
if (XMLDoc.parseError.errorCode != 0) {

}
else {

}

return(XMLDoc);
}

function LatLon_getValues()
{
document.getElementById("fromLat").value =
retrieveData(document.getElementById("HiddenFieldL atLonFrom").value,
"Latitude");
document.getElementById("fromLon").value =
retrieveData(document.getElementById("HiddenFieldL atLonFrom").value,
"Longitude");

document.getElementById("toLat").value =
retrieveData(document.getElementById("HiddenFieldL atLonTo").value,
"Latitude");
document.getElementById("toLon").value =
retrieveData(document.getElementById("HiddenFieldL atLonTo").value,
"Longitude");
}
//url, "Result", "Latitude"
function retrieveData(strURL, strDetailTag){

var XMLDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");

XMLDoc = urlFetch(strURL); //escape??

var nodeArr;

nodeArr = XMLDoc.getElementsByTagName(strDetailTag);

for(i=0; i<nodeArr.length; i++) {

return(nodeArr.item(i).text);

}
return("");
}
</script>
</form>
</body>

</html>
"mishj" wrote:
I am having troubles converting vb code behind to vs2005 - I converted c#
code behind no problem at all, but I get compile errors with vb that I cant
work out what the cause is - for every one of my vb code behind files, the
same errors!!
InitializeCulture is not a member of ASP.[filename].aspx
CreateResourceBasedLiteralControl is not a member of ...
Context is not a member of [project name].[filename]

Help??!!

"Fred Nelson" wrote:
Hi Rob:

I had some problems with it also at first. Now I have converted two
major apps from VS.2003 and it seems to be fine for me.

Hang in there - it will get better!

Fred
Rob Dob wrote:
VS2005 is a PIECE of Garbage and is bug Ridden, I wonder how many others
feel the same, I am so sorry that I have moved away from VS2003,

VS2005 is unstable, and half the stuff doesn't work, Microsft has spent so
much time trying to make it simply that when you try to do something useful
with it it doesn't work...

Half the time it crashes, and menu items appear for things you cannot do.
For example, Go into component designer, or SQLDataAdapter component for
WebForms is junk, doesn't come installed, so you add it to the toolbar and
it doesn't work, it breaks webforms.

I guess this is now a good system for doing things the microsoft way, but
build anytihng decent and forget it..,

VS2005 is a WASTE of MONEY.. I advise all to NOT upgrade, grab yourself
the express additons the FREE versions, at least you won't feel so riped...

Anyway my two cents...


Feb 23 '06 #52
As an example of another symptom of the problem, the following code compiles
and runs fine with my vb code behind it within visual studio, but when I try
to run it from my browser, I get "Parser Error" could not load type
'_Default'.

The same code (apart from the @Page directive) with C# behind it works fine
in my browser. Unfortunately I have no hosting that supports .Net 2.0 so I
cannot put this example anywhere you can see it. Is there anywhere you know
of that allows you to host .Net 2.0 cheap/free?

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<%@ Register TagPrefix="wcp" Namespace="WCPierce.Web.UI.WebControls"
Assembly="WCPierce.Web" %>

<!-- Note that this style sheet will only be imported in IE4 and 5 and Opera
-->
<STYLE type="text/css">
@import url(defaultlayout.css);
</STYLE>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>GMap Basics</title>
<style type="text/css">
v\:* {
behavior:url(#default#VML);
}
</style>
</head>
<script>

</script>
<body onload="javascript: displayDirections(
document.getElementById('HiddenField1').value); ">
<iframe id="frameDirections" width=700 height=700
style="position:absolute; top:20px; left:299px; visibility:visible ">No
directions at this time</iframe>
<iframe id="framegMap" width="500px" height="500px"
style="position:absolute; top:25px; left:299px; visibility:hidden ">No Map at
this time</iframe>
<form id="Form1" method="post" runat="server">
<table>
<script>
var contentArr = new Array();
bFillFromAddress=true;
function displayDirections(strURL) {

document.getElementById('frameDirections').src = strURL;

}
function getAddressInfo() {

var strGeneratedURL = "http://maps.google.com/maps?saddr=";

//start address
strGeneratedURL = strGeneratedURL +
document.getElemetById('fromAddr').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('fromCity').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('fromState').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('fromZip').value ;
//destination address
strGeneratedURL = strGeneratedURL + "&daddr=" +
document.getElementById('toAddr').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('toCity').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('toState').value + "+";
strGeneratedURL = strGeneratedURL +
document.getElementById('toZip').value ;

//URL_displayInBrowser(strGeneratedURL);
document.getElementById('HiddenField1').value = strGeneratedURL;

}
function MapDiv_hide(strId) {

if (document.layers) {

document[strId].visibility = 'hide';

}
else {
if (document.all) {

document.all[strId].style.visibility='hidden';
}
else {
if (document.getElementById) {

document.getElementById(strId).style.visibility =
'hidden';
document.getElementById("frame" +
strId).style.visibility='hidden';
}
}
}

}

function Div_hide(strId) {

if (document.layers) {
document[strId].visibility = 'hide';

}
else {
if (document.all) {
document.all[strId].style.visibility = 'hidden';

}
else {
if (document.getElementById) {
document.getElementById(strId).style.visibility =
'hidden';
document.getElementById("frame" +
strId).style.visibility='hidden';
}
}
}

}

function Div_show(strId) {
if (document.layers) {
document[strId].visibility = 'show';

}
else {
if (document.all) {

document.all[strId].style.visibility = 'visible';

}
else {
if (document.getElementById) {
document.getElementById(strId).style.visibility =
'visible';
document.getElementById(strId).zIndex=1000;
document.getElementById("frame" +
strId).style.visibility='visible';

}
}
}

}

function GMap_Click(overlay, point)
{
if( overlay )
this.removeOverlay(overlay);
else if( point )
{
this.addOverlay(new GMarker(point));
if (bFillFromAddress=true)
{

}
}
}
function GMap_placeOverlay(overlay, point)
{
var map = new GMap(document.getElementById("GMap_div"));

if( overlay ){

map.removeOverlay(overlay);
}
else if( point )
{

var gMarker = new GMarker(point);

map.addOverlay(gMarker);
}
}

</script>
<tr>
<td valign="top">
<table>
<tr>
<td><b>From Address:</b></td>
<td><asp:TextBox ID="fromAddr" runat="server" maxlength=35
Text=""></asp:TextBox></td>
</tr>
<tr>
<td><b>City:</b></td>
<td><asp:TextBox ID="fromCity" runat="server"
maxlength=35 Text="Atlanta"></asp:TextBox></td>
</tr>
<tr>
<td><b>State:</b></td>
<td><asp:TextBox ID="fromState" runat="server"
maxlength=35 Text="GA"></asp:TextBox></td>
</tr>
<tr>
<td><b>Zip:</b></td>
<td><asp:TextBox ID="fromZip" runat="server"
maxlength=35 Text=""></asp:TextBox></td>
</tr>
<tr>
<td style="height: 26px"><b>Lat</b></td>
<td style="height: 26px"><asp:TextBox runat="server"
ID="fromLat" ></asp:TextBox></td>
</tr>
<tr>
<td><b>Lon</b></td>
<td><asp:TextBox runat="server" ID="fromLon"
</asp:TextBox></td> </tr>
<tr><td> </td></tr>

<tr>
<td><b>To Address:</b></td>
<td><asp:TextBox ID="toAddr" runat="server" maxlength=35
Text=""></asp:TextBox></td>
</tr>
<tr>
<td><b>City:</b></td>
<td><asp:TextBox ID="toCity" runat="server" maxlength=35
Text="Marietta"></asp:TextBox></td>
</tr>
<tr>
<td><b>State:</b></td>
<td><asp:TextBox ID="toState" runat="server"
maxlength=35 Text="GA"></asp:TextBox></td>
</tr>
<tr>
<td><b>Zip:</b></td>
<td><asp:TextBox ID="toZip" runat="server" maxlength=35
Text="30067"></asp:TextBox></td>
</tr>
<tr>
<td><b>Lat</b></td>
<td><asp:TextBox runat="server" ID="toLat"</asp:TextBox></td> </tr>
<tr>
<td style="height: 26px"><b>Lon</b></td>
<td style="height: 26px"><asp:TextBox runat="server"
ID="toLon" ></asp:TextBox></td>
</tr>
<tr>
<td style="height: 26px">
<b>Distance </b><br />(as the crow flies)</td>
<td style="height: 26px">
<asp:TextBox ID="distance"
runat="server"></asp:TextBox></td>
</tr>
<!--<tr><td><input id="btnGetDirections" type=button
value="Directions" onClick="javascript: getAddressInfo(); displayDirections(
document.getElementById('HiddenField1').value);"/></td></tr>-->

</table>
<asp:HiddenField ID="HiddenField1" runat="server" />
<asp:Button ID="getDirections" runat="server"
AutoPostBack="true" Text="Directions" />
<asp:HiddenField ID="HiddenFieldLatLonFrom" runat="server" />
<asp:HiddenField ID="HiddenFieldLatLonTo" runat="server" />
<asp:HiddenField ID="oldFromLat" runat="server" />
<asp:HiddenField ID="oldFromLon" runat="server" />
<asp:HiddenField ID="oldToLat" runat="server" />
<asp:HiddenField ID="oldToLon" runat="server" />
<wcp:GMap runat="server" id="gMap" Width="250px"
Height="250px" />
<!--<YMap runat="server" id="yMap" Width="250px"
Height="250px" />-->
</td>


<td>
</td>
</tr>

</table>

<script>

</script>
<script>

function replaceString( strInString, strToSearchFor, strToReplaceWith)
{

while (strInString.indexOf(strToSearchFor)>0)
{
iPosFound=strInString.indexOf(strToSearchFor);

if (strToSearchFor == "apos;")
{

strInString = strInString.substr(0, iPosFound-2) + strToReplaceWith +
strInString.substr(iPosFound+strToSearchFor.length );

}
else
{
strInString = strInString.substr(0, iPosFound-1) + strToReplaceWith +
strInString.substr(iPosFound+strToSearchFor.length );

}
}
return strInString;
}

</script>
<script>


function urlFetch(strURL){
XMLDoc = new ActiveXObject("Msxml2.DOMDocument.3.0")
XMLDoc.async = false

XMLDoc.load(strURL)
if (XMLDoc.parseError.errorCode != 0) {

}
else {

}

return(XMLDoc);
}

function LatLon_getValues()
{
document.getElementById("fromLat").value =
retrieveData(document.getElementById("HiddenFieldL atLonFrom").value,
"Latitude");
document.getElementById("fromLon").value =
retrieveData(document.getElementById("HiddenFieldL atLonFrom").value,
"Longitude");

document.getElementById("toLat").value =
retrieveData(document.getElementById("HiddenFieldL atLonTo").value,
"Latitude");
document.getElementById("toLon").value =
retrieveData(document.getElementById("HiddenFieldL atLonTo").value,
"Longitude");
}
//url, "Result", "Latitude"
function retrieveData(strURL, strDetailTag){

var XMLDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");

XMLDoc = urlFetch(strURL); //escape??

var nodeArr;

nodeArr = XMLDoc.getElementsByTagName(strDetailTag);

for(i=0; i<nodeArr.length; i++) {

return(nodeArr.item(i).text);

}
return("");
}
</script>
</form>
</body>

</html>
"Alvin Bruney - ASP.NET MVP" wrote:
can you post the code that will not port?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

"mishj" <mi***@discussions.microsoft.com> wrote in message
news:52**********************************@microsof t.com...
I am having troubles converting vb code behind to vs2005 - I converted c#
code behind no problem at all, but I get compile errors with vb that I

cant
work out what the cause is - for every one of my vb code behind files, the
same errors!!
InitializeCulture is not a member of ASP.[filename].aspx
CreateResourceBasedLiteralControl is not a member of ...
Context is not a member of [project name].[filename]

Help??!!

"Fred Nelson" wrote:
Hi Rob:

I had some problems with it also at first. Now I have converted two
major apps from VS.2003 and it seems to be fine for me.

Hang in there - it will get better!

Fred
Rob Dob wrote:

> VS2005 is a PIECE of Garbage and is bug Ridden, I wonder how many others > feel the same, I am so sorry that I have moved away from VS2003,
>
> VS2005 is unstable, and half the stuff doesn't work, Microsft has spent so > much time trying to make it simply that when you try to do something useful > with it it doesn't work...
>
> Half the time it crashes, and menu items appear for things you cannot do. > For example, Go into component designer, or SQLDataAdapter component for > WebForms is junk, doesn't come installed, so you add it to the toolbar and > it doesn't work, it breaks webforms.
>
> I guess this is now a good system for doing things the microsoft way, but > build anytihng decent and forget it..,
>
> VS2005 is a WASTE of MONEY.. I advise all to NOT upgrade, grab yourself > the express additons the FREE versions, at least you won't feel so riped... >
> Anyway my two cents...
>
>


Feb 23 '06 #53
The Vb.Net behind this example is as follows (sorry its large)

Imports System

Imports System.Collections
Imports System.ComponentModel
Imports System.Data

Imports System.Drawing
Imports System.Globalization
Imports System.Xml
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls

Imports WCPierce.Web.UI.WebControls

Partial Class _Default
Inherits System.Web.UI.Page

Public YAHOOAPI_code = "MAPRESTHOMES"

Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) _
Handles MyBase.Load

Dim gSmallMapControl As New GSmallMapControl()
Dim gMapTypeControl As New GMapTypeControl()

If IsPostBack() = False Then
gMap.AddControl(gSmallMapControl)
gMap.AddControl(gMapTypeControl)

'initially centered on Atlanta
Dim gpOrigin As New GPoint(-84.0F, 34.0F)

gMap.CenterAndZoom(gpOrigin, 10)
getLocations()

End If

displayDirections()
End Sub
Private Sub LatLon_change()
Dim gpFrom As New GPoint
Dim gpTo As New GPoint
Dim gpOldFrom As New GPoint
Dim gpOldTo As New GPoint
Dim ioverlay As Integer

For ioverlay = 0 To gMap.Overlays.Count - 1
gMap.Overlays.RemoveAt(0)
Next

gpFrom = Point_plot("From Address", fromLat.Text, fromLon.Text)
gpTo = Point_plot("To Address", toLat.Text, toLon.Text)

oldFromLat.Value = fromLat.Text
oldFromLon.Value = fromLon.Text
oldToLat.Value = toLat.Text
oldToLon.Value = toLon.Text

zoomAndCenter(gpFrom, gpTo)

Dim distanceBetweenPoints As Double
distanceBetweenPoints = calcDistance(gpFrom, gpTo)
distance.Text = distanceBetweenPoints.ToString()

End Sub
Function calcDistance(ByVal pStart As GPoint, ByVal pEnd As GPoint) As
Double
Dim fRadiusOfEarth As New Double()
Dim fLonA As New Double()
Dim fLonB As New Double()
Dim fLatA As New Double()
Dim fLatB As New Double()
Dim a As New Double()
Dim c As New Double()
Dim d As New Double()
Dim fDistanceLon As New Double()
Dim fDistanceLat As New Double()

fRadiusOfEarth = 3959.871 ' radius of earth in miles
'fRadiusOfEarth = (double)6372.795477598; ' radius of earth in km

fLonA = pStart.X * Math.PI / 180
fLonB = pEnd.X * Math.PI / 180
fLatA = pStart.Y * Math.PI / 180
fLatB = pEnd.Y * Math.PI / 180

Dim dblFloat, dblFloat2 As Double
fDistanceLon = fLonB - fLonA
fDistanceLat = fLatB - fLatA

a = Math.Pow(Math.Sin(fDistanceLat / 2), 2)
dblFloat2 = Math.Pow(Math.Sin(fDistanceLon / 2), 2)

a = a + (Math.Cos(fLatA) * Math.Cos(fLatB) * dblFloat2)

dblFloat = Math.Sqrt(a)
dblFloat2 = Math.Sqrt(1 - a)
c = 2 * Math.Atan2(dblFloat, dblFloat2)
d = fRadiusOfEarth * c

calcDistance = d
End Function
Private Sub zoomAndCenter(ByVal gpFrom As GPoint, ByVal gpTo As GPoint)

Dim spanLat As Double
Dim spanLon As Double
Dim latMid As Double
Dim lonMid As Double
Dim gpMidpoint As New GPoint()
spanLat = Math.Abs(gpFrom.Y - gpTo.Y)
spanLon = Math.Abs(gpFrom.X - gpTo.X)
latMid = (gpFrom.Y + gpTo.Y) / 2
lonMid = (gpFrom.X + gpTo.X) / 2
gpMidpoint = New GPoint()
gpMidpoint.X = lonMid
gpMidpoint.Y = latMid

Dim mapWidth As Double = 250
Dim mapHeight As Double = 250

Dim zoomX As Double
zoomX = Math.Log(spanLon * 100000 * Math.Cos(latMid * Math.PI / 180)
/ mapWidth) / Math.Log(2)
Dim zoomY As Double
zoomY = Math.Log(spanLat * 100000 / mapHeight) / Math.Log(2)
Dim iZoom As Integer
iZoom = Math.Ceiling(Math.Max(zoomX, zoomY))
gMap.CenterAndZoom(gpMidpoint, iZoom + 1)

End Sub
Private Function Point_plot(ByVal strTag As String, ByVal strLat As
String, ByVal strLon As String) As GPoint
Dim gpPoint As New GPoint()

Dim fLat As New Double
Dim fLon As New Double
If strLat <> "" And strLon <> "" Then

fLat = Convert.ToDouble(strLat)

fLon = Convert.ToDouble(strLon)

gpPoint.Y = fLat
gpPoint.X = fLon
'gMap.CenterAndZoom(gpPoint, 5);

Dim gm As New GMarker(gpPoint, strTag)

gMap.Overlays.Add(gm)

End If

Point_plot = gpPoint
End Function

Private Sub Address_getLatLon()

Dim strGeneratedURL As New
String("http://api.local.yahoo.com/MapsService/V1/geocode?")

'start address
strGeneratedURL = strGeneratedURL + "appid=" + YAHOOAPI_code
strGeneratedURL = strGeneratedURL + "&street=" + fromAddr.Text + "+"
strGeneratedURL = strGeneratedURL + "&city=" + fromCity.Text + "+"
strGeneratedURL = strGeneratedURL + "&state=" + fromState.Text + "+"
strGeneratedURL = strGeneratedURL + "&zip=" + fromZip.Text

HiddenFieldLatLonFrom.Value = strGeneratedURL
fromLat.Text = String_getFromXML(strGeneratedURL, "Latitude")
fromLon.Text = String_getFromXML(strGeneratedURL, "Longitude")

strGeneratedURL = "http://api.local.yahoo.com/MapsService/V1/geocode?"

'destination address
strGeneratedURL = strGeneratedURL + "appid=" + YAHOOAPI_code
strGeneratedURL = strGeneratedURL + "&street=" + toAddr.Text + "+"
strGeneratedURL = strGeneratedURL + "&city=" + toCity.Text + "+"
strGeneratedURL = strGeneratedURL + "&state=" + toState.Text + "+"
strGeneratedURL = strGeneratedURL + "&zip=" + toZip.Text
HiddenFieldLatLonTo.Value = strGeneratedURL
toLat.Text = String_getFromXML(strGeneratedURL, "Latitude")
toLon.Text = String_getFromXML(strGeneratedURL, "Longitude")

End Sub
Private Function String_getFromXML(ByVal strGeneratedURL As String,
ByVal strTag As String) As String

Dim XMLDoc As New System.Xml.XmlDocument()
'XMLDoc.async = false

XMLDoc.Load(strGeneratedURL)

Dim nodeArr As XmlNodeList

nodeArr = XMLDoc.GetElementsByTagName(strTag)

String_getFromXML = nodeArr.Item(0).InnerText


End Function
Private Sub Directions_displayYahoo()
'Aiming to generate a url like the following one:
'http://maps.yahoo.com/dd_result?newaddr=1199+Main+St&taddr=518+Smithston e+Trace+SE&csz=Atlanta%2C+GA+30349-5839&country=us&tcsz=Marietta+GA+30067&tcountry=us

Dim strGeneratedURL As New
String("http://maps.yahoo.com/dd_result?newaddr=")

'start address
strGeneratedURL = strGeneratedURL + fromAddr.Text + "+"
strGeneratedURL = strGeneratedURL + "&csz=" + fromCity.Text + "+"
strGeneratedURL = strGeneratedURL + fromState.Text + "+"
strGeneratedURL = strGeneratedURL + fromZip.Text
strGeneratedURL = strGeneratedURL + "&country=us"
'destination address
strGeneratedURL = strGeneratedURL + "&taddr=" + toAddr.Text + "+"
strGeneratedURL = strGeneratedURL + "&tcsz=" + toCity.Text + "+"
strGeneratedURL = strGeneratedURL + toState.Text + "+"
strGeneratedURL = strGeneratedURL + toZip.Text
strGeneratedURL = strGeneratedURL + "&tcountry=us"
HiddenField1.Value = strGeneratedURL

End Sub

Private Sub getDirections_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles getDirections.Click
displayDirections()

End Sub
Sub putLocationsInFields(ByVal dsLocations As DataSet)
Dim drStart As System.Data.DataRow
Dim drEnd As System.Data.DataRow

drStart = dsLocations.Tables.Item(0).Rows.Item(0)

fromAddr.Text = drStart.Item("Address").ToString()
fromCity.Text = drStart.Item("City").ToString()
fromState.Text = drStart.Item("State").ToString()
fromZip.Text = drStart.Item("Zip").ToString()

drEnd = dsLocations.Tables.Item(0).Rows.Item(1)

toAddr.Text = drEnd.Item("Address").ToString()
toCity.Text = drEnd.Item("City").ToString()
toState.Text = drEnd.Item("State").ToString()
toZip.Text = drEnd.Item("Zip").ToString()
End Sub
Private Sub getLocations()
Dim dsLocations As New DataSet
Dim drStart As DataRow
Dim drEnd As DataRow

dsLocations.Tables.Add("Location")
dsLocations.Tables(0).Columns.Add("Address", GetType(System.String))
dsLocations.Tables(0).Columns.Add("City", GetType(System.String))
dsLocations.Tables(0).Columns.Add("State", GetType(System.String))
dsLocations.Tables(0).Columns.Add("Zip", GetType(System.String))
dsLocations.Tables(0).Columns.Add("DistanceTo",
GetType(System.Decimal))

drStart = dsLocations.Tables(0).NewRow

drStart.Item("Address") = "1199 Main St"
drStart.Item("City") = "Atlanta"
drStart.Item("State") = "GA"
drStart.Item("Zip") = "30349"
drStart.Item("DistanceTo") = 0.0

dsLocations.Tables(0).Rows.Add(drStart)

drEnd = dsLocations.Tables(0).NewRow

drEnd.Item("Address") = "2035 Main St"
drEnd.Item("City") = "Atlanta"
drEnd.Item("State") = "GA"
drEnd.Item("Zip") = "30349"
drEnd.Item("DistanceTo") = 0.0

dsLocations.Tables(0).Rows.Add(drEnd)

putLocationsInFields(dsLocations)

End Sub
Private Sub displayDirections()

Directions_displayYahoo()
Address_getLatLon()
LatLon_change()
End Sub
End Class


"Alvin Bruney - ASP.NET MVP" wrote:
can you post the code that will not port?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

"mishj" <mi***@discussions.microsoft.com> wrote in message
news:52**********************************@microsof t.com...
I am having troubles converting vb code behind to vs2005 - I converted c#
code behind no problem at all, but I get compile errors with vb that I

cant
work out what the cause is - for every one of my vb code behind files, the
same errors!!
InitializeCulture is not a member of ASP.[filename].aspx
CreateResourceBasedLiteralControl is not a member of ...
Context is not a member of [project name].[filename]

Help??!!

"Fred Nelson" wrote:
Hi Rob:

I had some problems with it also at first. Now I have converted two
major apps from VS.2003 and it seems to be fine for me.

Hang in there - it will get better!

Fred
Rob Dob wrote:

> VS2005 is a PIECE of Garbage and is bug Ridden, I wonder how many others > feel the same, I am so sorry that I have moved away from VS2003,
>
> VS2005 is unstable, and half the stuff doesn't work, Microsft has spent so > much time trying to make it simply that when you try to do something useful > with it it doesn't work...
>
> Half the time it crashes, and menu items appear for things you cannot do. > For example, Go into component designer, or SQLDataAdapter component for > WebForms is junk, doesn't come installed, so you add it to the toolbar and > it doesn't work, it breaks webforms.
>
> I guess this is now a good system for doing things the microsoft way, but > build anytihng decent and forget it..,
>
> VS2005 is a WASTE of MONEY.. I advise all to NOT upgrade, grab yourself > the express additons the FREE versions, at least you won't feel so riped... >
> Anyway my two cents...
>
>


Feb 23 '06 #54
Sorry to keep posting on this but even vb code that works fine in the IDE is
giving me this error when I try to run it from outside the IDE.. At first I
thought it was something wrong with the way I was publishing the site, but
someone on another forum wonders if my .Net 2.0 install did not install
properly, as they think some of my errors suggest my apps are trying to run
in .Net 1.1?? Any ideas?

Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: Could not load type '_Default'.

Source Error:
Line 1: <%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>
Line 2: <%@ Register TagPrefix="wcp"
Namespace="WCPierce.Web.UI.WebControls" Assembly="WCPierce.Web" %>
Line 3:

"mishj" wrote:
I am having troubles converting vb code behind to vs2005 - I converted c#
code behind no problem at all, but I get compile errors with vb that I cant
work out what the cause is - for every one of my vb code behind files, the
same errors!!
InitializeCulture is not a member of ASP.[filename].aspx
CreateResourceBasedLiteralControl is not a member of ...
Context is not a member of [project name].[filename]

Help??!!

"Fred Nelson" wrote:
Hi Rob:

I had some problems with it also at first. Now I have converted two
major apps from VS.2003 and it seems to be fine for me.

Hang in there - it will get better!

Fred
Rob Dob wrote:
VS2005 is a PIECE of Garbage and is bug Ridden, I wonder how many others
feel the same, I am so sorry that I have moved away from VS2003,

VS2005 is unstable, and half the stuff doesn't work, Microsft has spent so
much time trying to make it simply that when you try to do something useful
with it it doesn't work...

Half the time it crashes, and menu items appear for things you cannot do.
For example, Go into component designer, or SQLDataAdapter component for
WebForms is junk, doesn't come installed, so you add it to the toolbar and
it doesn't work, it breaks webforms.

I guess this is now a good system for doing things the microsoft way, but
build anytihng decent and forget it..,

VS2005 is a WASTE of MONEY.. I advise all to NOT upgrade, grab yourself
the express additons the FREE versions, at least you won't feel so riped...

Anyway my two cents...


Feb 24 '06 #55
I tried to "attach to the process" (IIS) and got this error this time..
Maybe this confirms that something is screwed in my install of .Net 2??
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: Unrecognized attribute 'xmlns'.

Source Error:
Line 1: <?xml version="1.0"?>
Line 2: <configuration
xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
Line 3: <appSettings>
Line 4: <add key="ScriptFolderPath" value="~/Scripts"/>
Source File: C:\Inetpub\WCPierce\TestWeb\web.config Line: 2
"Alvin Bruney - ASP.NET MVP" wrote:
can you post the code that will not port?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

"mishj" <mi***@discussions.microsoft.com> wrote in message
news:52**********************************@microsof t.com...
I am having troubles converting vb code behind to vs2005 - I converted c#
code behind no problem at all, but I get compile errors with vb that I

cant
work out what the cause is - for every one of my vb code behind files, the
same errors!!
InitializeCulture is not a member of ASP.[filename].aspx
CreateResourceBasedLiteralControl is not a member of ...
Context is not a member of [project name].[filename]

Help??!!

"Fred Nelson" wrote:
Hi Rob:

I had some problems with it also at first. Now I have converted two
major apps from VS.2003 and it seems to be fine for me.

Hang in there - it will get better!

Fred
Rob Dob wrote:

> VS2005 is a PIECE of Garbage and is bug Ridden, I wonder how many others > feel the same, I am so sorry that I have moved away from VS2003,
>
> VS2005 is unstable, and half the stuff doesn't work, Microsft has spent so > much time trying to make it simply that when you try to do something useful > with it it doesn't work...
>
> Half the time it crashes, and menu items appear for things you cannot do. > For example, Go into component designer, or SQLDataAdapter component for > WebForms is junk, doesn't come installed, so you add it to the toolbar and > it doesn't work, it breaks webforms.
>
> I guess this is now a good system for doing things the microsoft way, but > build anytihng decent and forget it..,
>
> VS2005 is a WASTE of MONEY.. I advise all to NOT upgrade, grab yourself > the express additons the FREE versions, at least you won't feel so riped... >
> Anyway my two cents...
>
>


Feb 24 '06 #56
If you're running this outside of VS 2005, then it must be running through
your local IIS. So, you have to make sure that this specific web
application is configured under IIS to run under ASP.NET 2.0. Open the IIS
Manager and go to this application and right-click. Select Properties and
in the dialog that should come up, select the ASP.NET tab. You should be
able to change this to the .NET 2.0 version.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"mishj" <mi***@discussions.microsoft.com> wrote in message
news:51**********************************@microsof t.com...
Sorry to keep posting on this but even vb code that works fine in the IDE
is
giving me this error when I try to run it from outside the IDE.. At first
I
thought it was something wrong with the way I was publishing the site, but
someone on another forum wonders if my .Net 2.0 install did not install
properly, as they think some of my errors suggest my apps are trying to
run
in .Net 1.1?? Any ideas?

Parser Error
Description: An error occurred during the parsing of a resource required
to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: Could not load type '_Default'.

Source Error:
Line 1: <%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>
Line 2: <%@ Register TagPrefix="wcp"
Namespace="WCPierce.Web.UI.WebControls" Assembly="WCPierce.Web" %>
Line 3:

"mishj" wrote:
I am having troubles converting vb code behind to vs2005 - I converted c#
code behind no problem at all, but I get compile errors with vb that I
cant
work out what the cause is - for every one of my vb code behind files,
the
same errors!!
InitializeCulture is not a member of ASP.[filename].aspx
CreateResourceBasedLiteralControl is not a member of ...
Context is not a member of [project name].[filename]

Help??!!

"Fred Nelson" wrote:
> Hi Rob:
>
> I had some problems with it also at first. Now I have converted two
> major apps from VS.2003 and it seems to be fine for me.
>
> Hang in there - it will get better!
>
> Fred
>
>
> Rob Dob wrote:
>
> > VS2005 is a PIECE of Garbage and is bug Ridden, I wonder how many
> > others
> > feel the same, I am so sorry that I have moved away from VS2003,
> >
> > VS2005 is unstable, and half the stuff doesn't work, Microsft has
> > spent so
> > much time trying to make it simply that when you try to do something
> > useful
> > with it it doesn't work...
> >
> > Half the time it crashes, and menu items appear for things you
> > cannot do.
> > For example, Go into component designer, or SQLDataAdapter
> > component for
> > WebForms is junk, doesn't come installed, so you add it to the
> > toolbar and
> > it doesn't work, it breaks webforms.
> >
> > I guess this is now a good system for doing things the microsoft way,
> > but
> > build anytihng decent and forget it..,
> >
> > VS2005 is a WASTE of MONEY.. I advise all to NOT upgrade, grab
> > yourself
> > the express additons the FREE versions, at least you won't feel so
> > riped...
> >
> > Anyway my two cents...
> >
> >
>
>

Feb 24 '06 #57

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.