Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Background and Text to a button

Status
Not open for further replies.

vilrbn

Programmer
Oct 29, 2002
105
FR
Hello,

I want to associate both image and text to my buttons.
I got many examples but they are all javascript ones using an onclick method.
My problem is that for the moment, most of my buttons are ASP.NET ones with Code behind. How can I fire an event in a Javascript function to launch a VB one ?

I tried:

Function Java()
{
<%
Response.Write(&quot;<%VBSub()%>&quot;)
%>
}

But don't know how to format <% between the parenthesis.

Anybody can help me ?

Thanks.
 
you can add an onclick event to your button in codebehind:

btn.attributes.add(&quot;onclick&quot;,&quot;yourJavascriptMethodHere&quot;)

same goes for any other control, just replace the event with your desired event, and the second argument is what is to be called.
penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top