Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2005

Tip: Looking for answers? Try searching our database.

writing html (client) on aspx

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Avi - 05 May 2005 08:03 GMT
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 :)
Mona - 05 May 2005 12:33 GMT
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]

> Hello,
>
[quoted text clipped - 11 lines]
>
> Thanks :)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.