Jump to content


Photo

Mostrar Valor Da Variável


  • Faça o login para participar
1 reply to this topic

#1 xstudio

xstudio

    Normal

  • Usuários
  • 66 posts
  • Sexo:Não informado

Posted 05/06/2009, 17:08

galera no codigo abaixo estou kerendo mostrar na pagina o valor q a variavel de session está mostrando... mas keria numa variavel normal
como eu faço isso???
alguem saberia me dizer... como faz isso...???

pagina ASPX (teste.aspx)
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="teste.aspx.vb" Inherits="teste.spaTeste" %>
<%@ Import namespace="teste"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=session("tTitulo")%></title>
</head>
<body>
<form runat="server">
<asp:Label ID="txt" runat="server"/>
</form>
</body>
</html>


script vb (teste.aspx.vb)
Imports System
Imports System.Web
Imports System.Web.UI


namespace teste
public partial class spaTeste

Inherits System.Web.UI.Page

dim aString as String

Sub Page_Load(Src As Object, E As EventArgs)
If Not IsPostBack Then
mostra()
titulo()
End If
End Sub

sub mostra()
dim classe as testeClass = new testeClass()
txt.Text = classe.func_retornaTxt("William")
end sub

sub titulo() 'esse function vem do meu webservice é só retirar ela para funcionar
dim aService1 as new Service1()
session("tTitulo") = aService1.spa_Titulo()
end sub

end class
end namespace




galera já consegui o q keria...
olha como se faz... fika ai a dica

HTML
<title runat="server"></title>

VB
sub titulo()
dim aService1 as new Service1()
title = aService1.spa_Titulo()
end sub

deu erro quando eu colokei "this." ai colokei direto a tag "title" recebendo o valor do objeto q vem o de um ws e funfou 100%

até a proxima

Edição feita por: xstudio, 05/06/2009, 17:08.

www.7xstudio.com - Web Solution

#2 MACUL

MACUL

    Doutor

  • Usuários
  • 770 posts
  • Sexo:Masculino
  • Localidade:SP

Posted 09/06/2009, 14:18

response.write("??")
response.write(variavel)
*************** M ** A ** C ** U ** L ***************

*************************************************




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq