Reply
asp:Label problem...
Old 03-16-2006, 08:28 PM asp:Label problem...
waller's Avatar
Skilled Talker

Posts: 59
Location: North Borneo.
I have this code in default.aspx
PHP Code:
<asp:Label id="ids" runat="server" CssClass="aspnetmaker" Visible="FALSE"></asp:Label>
        <
asp:Label id="DIV1" runat="server" Visible="True"></asp:Label
I cannot display the second asp:Label( id="DIV1").
And also, the asp:Label(id="ids") is not "Hi".

The code behind is default.aspx.vb(below)
Whats the problem?
PHP Code:
Imports System
Imports System
.Web
Imports System
.Web.Security
Imports System
.Web.UI
Imports System
.Web.UI.HtmlControls
Imports System
.Web.UI.WebControls
Imports System
.Data
Imports System
.Data.SqlClient
Imports Microsoft
.VisualBasic
Namespace mygdi
Public Class ewdefault
        Inherits System
.Web.UI.Page
        
Protected WithEvents ids As Label
        
Protected WithEvents DIV1 As Label
        Dim fname

        
'*********************
        '  
Page Load Handler
        
'*********************

        Private Sub Page_Load(ByVal s As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim test
            Dim useridStr As String
            Response.Cookies.Remove("hi")
            If Not fname = Request.Cookies("hi").Value Is Nothing Then
                Dim aCookie As HttpCookie = Request.Cookies("hi")
                ids.Text = Server.HtmlEncode(aCookie.Value)
                useridStr = ids.Text
                ids.Text = "NIL"
            End If

            Dim oewdb As ewdb = New ewdb
            Dim sTmp As String


            Dim sSelect As String
            Dim sConnStr As String = oewdb.ewConnStr  ' 
Get Connection String
            sSelect 
"SELECT * FROM [Users] WHERE [UserName] = useridStr"
            '" & sTmp & "'"
            Dim objDataReader As SqlDataReader
            Dim oConn As New SqlConnection(sConnStr)
            oConn.Open() ' Open the Connection to the Database
            Dim objCommand As New SqlCommand(sSelect, oConn)
            objDataReader = objCommand.ExecuteReader()
            Dim useridDB, passwordDB As String
            useridDB = objDataReader("
Us")
            ids.Text = "
NIL"
            DIV1.Text = "
hello"

        End Sub

        Private Sub InitializeComponent()

        End Sub
    End Class
End Namespace 
__________________
$id ="waxxer";
$id = str_replace('x', 'l', $id);
echo $id;
echo " and Marj";
waller is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 03-23-2006, 10:20 AM Re: asp:Label problem...
WebcyteDesign's Avatar
Extreme Talker

Posts: 159
Location: Hamilton
First your don't need visible=True for Div1 it defaults to that. Second try this

If Not fname = Is Nothing And Not Request.Cookies("hi").Value Is Nothing Then

also why do you put the cookie value into ids.Text then override that and put "NIL" in there and then on top of that override it yet again at the bottom with "NIL" yet again.

Where is fname comming from, it seems to have no purpose there and the same with test which is not completely declared.

label ids shouldn't display anything as you have not put in your code visible="true"

I'd say really go through your code and put in comments so that when you show someone who is helping you it makes a little more sense.
WebcyteDesign is offline
Reply With Quote
View Public Profile Visit WebcyteDesign's homepage!
 
Reply     « Reply to asp:Label problem...
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11869 seconds with 13 queries