Jump to content
Fórum Script Brasil
  • 0

(Resolvido) Mostrar Valor Da Variavel


Question

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???

alguém 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/xhtml1/DTD/xhtml1-transitional.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

Edited by quintelab
Adicionado BBCode Code e BBCode HTML
Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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 coloquei "this." ai coloquei direto e funfou 100%

vlw pela ajuda...

Edited by quintelab
Adicionado BBCode Code e BBCode HTML
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      148724
    • Total Posts
      644561
×
×
  • Create New...