ASP.NET - error webbrowser // informe

 
Vista:

error webbrowser // informe

Publicado por nenure (56 intervenciones) el 23/04/2008 13:40:13
Hola! Tengo un problema al escribir este codigo

If txtDireccion.Text <> String.Empty Then

zip = txtDireccion.Text.ToString()

queryAddress.Append(zip)

End If
webBrowser1.Navigate(queryAddress.ToString())

me da que webBrowser1 no esta declarado y no se como hacerlo.

Otra pregunta ya que escribo esta nota: a la hora de hacer los informes en visual studio 2005, cual es la forma mas adecuada? usando crystal report o report viewer?

Muchas gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:error webbrowser // informe

Publicado por Javier Santamaria (312 intervenciones) el 23/04/2008 15:34:26
Hola,

¿Podrias explicar que tipo de objeto es webBrowser1?

Yo solo he utilizado Crystal Reports por loq ue no te puedo comparar ambos.

Saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:error webbrowser // informe

Publicado por nenure (56 intervenciones) el 23/04/2008 15:42:09
Hola Javier!

Te mando el codigo entero del codebehind:

Partial Class Inmobiliarias_mapa
Inherits System.Web.UI.Page
'PONIENDO DIRECCION NORMAL
Private Sub btnMapIt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMapIt.Click
Try
Dim street As String = String.Empty
Dim city As String = String.Empty
Dim state As String = String.Empty
Dim zip As String = String.Empty
Dim queryAddress As New StringBuilder()
queryAddress.Append("http://maps.google.com/maps?q=")
' build street part of query string
If txtStreet.Text <> String.Empty Then
street = txtStreet.Text.Replace(" ", "+")
queryAddress.Append(street + "," & "+")
End If
' build city part of query string
If txtCity.Text <> String.Empty Then
city = txtCity.Text.Replace(" ", "+")
queryAddress.Append(city + "," & "+")
End If
' build state part of query string
If txtState.Text <> String.Empty Then
state = txtState.Text.Replace(" ", "+")
queryAddress.Append(state + "," & "+")
End If
' build zip code part of query string
If txtZipCode.Text <> String.Empty Then
zip = txtZipCode.Text.ToString()
queryAddress.Append(zip)
End If
' pass the url with the query string to web browser control
webBrowser1.Navigate(queryAddress.ToString())
Catch ex As Exception
' MessageBox.Show(ex.Message.ToString(), "Unable to Retrieve Map")
End Try
End Sub

'PONIENDO LATITUD Y LONGITUD

Private Sub btnMapLatLong_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnMapLatLong.Click
If txtLat.Text = String.Empty Or txtLong.Text = String.Empty Then
' MessageBox.Show("Supply a latitude and longitude value.", "Missing Data")
End If
Try
Dim lat As String = String.Empty
Dim lon As String = String.Empty
Dim queryAddress As New StringBuilder()
queryAddress.Append("http://maps.google.com/maps?q=")
' build latitude part of query string
If txtLat.Text <> String.Empty Then
lat = txtLat.Text
queryAddress.Append(lat + "%2C")
End If
' build longitude part of query string
If txtLong.Text <> String.Empty Then
lon = txtLong.Text
queryAddress.Append(lon)
End If
webBrowser1.Navigate(queryAddress.ToString())
Catch ex As Exception
' MessageBox.Show(ex.Message.ToString(), "Error")
End Try
End Sub
End Class

Es para que en google maps que estoy utilizando, puedas escribir la direccion y te lo busque en el mapa.

Gracias.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:error webbrowser // informe

Publicado por @vm (196 intervenciones) el 23/04/2008 17:55:47
El objeto webBrowser es un objeto para aplicaciones cliente, no se, si se puede usar en proyectos web. El método Navigate lo que hace es cargar la página resultado de la dirección url pasada como parametro string en dicho objeto, a lo que veo tu aplicación es WEB, porque no sustituyes esa línea por:

Response.Redirect(queryAddress.ToString())
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:error webbrowser // informe

Publicado por nenure (56 intervenciones) el 24/04/2008 08:44:34
Muchisimas gracias, era eso,si. La verdad que no me di cuenta y si, funciona muy bien. Gracias por vuestra ayuda.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar