Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    HyperLink: perchè non va?

    ciao a tutti,
    io dichiaro nella mia classe un placeholder

    poi dentro ad una SUB mi creo un HyperLink, lo setto e lo passo al mio placeholder.

    codice:
    Protected WithEvents btn_Next As System.Web.UI.WebControls.PlaceHolder
    
    Dim btnNext As HyperLink
    btnNext.ImageUrl = "images\bottoni\bottnext.gif"
     btnNext.NavigateUrl = "lista.aspx?cat=" & cat.Replace(" '", "''") & "&p=" & CurrentPage + 1
    btn_Next.Controls.Add(btnNext)
    però ricevo questo errore:

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    su questa riga:
    btnNext.ImageUrl = "images\bottoni\bottnext.gif"



  2. #2
    l'errore stava qui:
    Dim btnNext As HyperLink

    la correzione è questa:
    Dim btnNext As New HyperLink

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.