Results 1 to 2 of 2

Thread: variable not declared

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870

    variable not declared

    Hi,

    I have a dataset that is filled with data in the vb.net design part of my webform1.aspx. I am then trying to refer to it in the html bit by the following line.
    Code:
    <asp:HyperLink id="Hyperlink1" runat="server" NavigateUrl="http://www.vbforums.com">'<%dataset1.Tables(0).Rows(0).Item(1)%>'
    but it says dataset1 is not declared. How do i get to use it in my html code?

    Many thanks
    Nick
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  2. #2
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803
    You can't do it like that...
    You don't need to do anything in the html file (aspx file)

    just do this in the vb code
    HyperLink1.Text = dataset1.Tables(0).Rows(0).Item(1)

    you can also change the target url in the same way...
    HyperLink1.NavigateUrl = "http://my.website.com"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width