Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Book Cover Pure ASP.NET
100377 times
Rated
Read 100,377 times

Contents

Related Categories

ASP.NET Web Forms - Server-side Code Blocks

Server-side Code Blocks

Code to be executed on the server is contained inside a set of <script> </script> tags, similar to the tags you would use to add client-side code to a Web page. In order for the page compiler to process the source code on the server, you must add a runat="server" attribute to the tag. Page logic, including the handling of events such as the Page_Load() event, is found in server-side code blocks rather than on the client side.

Note
If the runat="server" attribute is not specified, then the tag will be passed to the client as is. This causes unpredictable results, depending on the tag in question. In the case of ASP.NET Web controls, the browser will most likely ignore the tag entirely. HTML controls will then be displayed on the client, but they will not be accessible to ViewState management or server-side validation.

Comments

  • more help?

    Posted by HardlyNoticable on 23 Aug 2005

    Peter: You are using an alert box. I'm pretty sure that only the exclamation icon is your only option.

    svkoli: I get the following error when I try to use your box:

    CS0122: 'testresults.Button1...

  • Posted by chandrababu on 28 Jul 2005

    Use window.confirm()

  • Posted by VasanthKumar on 28 Jul 2005

    [quote][1]Posted by [b]surendar[/b] on 10 Jan 2005 11:47 PM[/1]
    what the code to create a messagebox in asp using c# language ?
    [/quote]

    http://www.developerfusion.co.uk/show/4700/
    see this.

  • Posted by anshu on 28 Jul 2005

    anyone can please tell me how to create a message box with ok & cancel buttons on a web page using asp.net using code behind ? Actually i am new to .NET. i reqire it urgently.

  • Posted by laney_18_boggs on 24 Jun 2005

    string message = strConn;
    string alertScript = "