Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > writing html (client) on aspx

Reply
Thread Tools

writing html (client) on aspx

 
 
Avi
Guest
Posts: n/a
 
      05-05-2005
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


 
Reply With Quote
 
 
 
 
Mona
Guest
Posts: n/a
 
      05-05-2005
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]


"Avi" <nobody@nospam_please.com> wrote in message news:Oc0QX$...
> 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
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding main.aspx.vb & main.aspx.resx under aspx John M ASP .Net 1 05-29-2005 09:27 PM
How to bring aspx code (in HTML view) to the aspx.vb code-behind? Paolo Pignatelli ASP .Net 6 02-21-2005 01:55 AM
Any problems with writing the information into a file - Multi-users perform writing the same file at the same time ???? HNguyen ASP .Net 4 12-21-2004 01:53 PM
Writing to a log file with in an aspx file. JuneCleaver ASP .Net 1 04-08-2004 05:17 PM
include other aspx/html in my aspx page Mr. x ASP .Net 1 11-30-2003 11:56 PM



Advertisments