Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

ASP.NET, calling vb.net sub on onclick


  • Please log in to reply

#1
Palk

Palk

    New Member

  • Member
  • Pip
  • 1 posts
Hi!
I'm new here and would like some help to solve my problem.

I'm working in ASP.net with Vb.net
What i want, and i'm trying to do, is to add onclick attribute to tablecell
It is working if i call on onclick an event functin, like Linkbutton1. But if i call a sub made by me isn't working
Example.

This Works
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
label1.text="a"
End Sub
Table Cell calling linkbutton1 function
tc.Attributes.Add(("onclick"), ("java script:__doPostBack('LinkButton1','')"))

------------------------------------------------------
This is what i want, but don't work

Public sub teste(byval x as string)
label1.text=x
end sub

tc.Attributes.Add(("onclick"), ("teste(1)"))

PS (if help):i want to pass in parameter one variable who receives id from database

If you can help me i would thank you
Hope you understood my problem

Edited by Palk, 01 March 2008 - 02:23 PM.

  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP