writing html (client) on aspx

A

Avi

Hello,

How can I (on Microsoft Visual studio .NET 2003) :
use HTML code on aspx page
(I have a button, and I want that the event occurs, when I am clicking on
it,
the IDE doesn't let me doing so, and there is a message : ... it must be
converted to HTML.
I want that the button will run on the client, and I know that a aspx page
can act as a simple html page,
so I can do that on aspx page (on the client side) )
How can I make an event on the button on both server & client side (with
some configuration on the Microsoft visual studio .NET 2003) ?

Thanks :)
 
M

Mona

Hi Avi,

In your ASPX code, make the button as you normally would, but add an onServerClick attribute,
an id attribute and a runat="server" attribute as follows:

<input type="button" onserverclick="MyFunction" onclick="javascript:alert('Something happened.');
"id="btnButton1" runat="server" value="Go">

In the codebehind for the page, put

Public Sub MyFunction(ByVal sender As System.Object, ByVal e As System.EventArgs)

Response.Write("From the server.")

End Sub

And now this button will respond to events both on the client side and server side.

HTH

Mona[Grapecity]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top