Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 4th, 2005, 11:49 AM
Registered User
 
Join Date: Oct 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Wats wrong???

Hi,

Can any1 tell me wats wrong wid dis code

Code:
<%@ Page Language="C#" %>
<script runat="server" Language="C#">

    void Page_Load()
    {
        if( Page.IsPostback )
        {
            lblMessage.Text = "You have selected " + lstCities.SelectedItem.Value;
        }
    }

</script>
<html>
<head>
</head>
<body>
    <form runat="server">
        <asp:Label id="lblMessage" runat="server"></asp:Label>
        Please select your desired destination:
        <br>
        <asp:DropDownList id="lstCities" runat="server">
            <asp:ListItem>Madrid</asp:ListItem>
            <asp:ListItem>Oslo</asp:ListItem>
            <asp:ListItem>Lisbon</asp:ListItem>
        </asp:DropDownList>
        <input type="Submit">
    </form>
</body>
]

I get the following error ven I run it using web matrix:
Compiler Error Message: CS0117: 'System.Web.UI.Page' does not contain a definition for 'IsPostback'

for this line :
Quote:
quote: Line 6: if( Page.IsPostback )
Thanx in advance

There is no patch for ignorance
 
Old October 4th, 2005, 01:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Isn't it Page.IsPostBack (capital B)?

Jacob.
 
Old October 5th, 2005, 05:06 AM
Registered User
 
Join Date: Oct 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Whoooops ! hehehe My mistake.. thanx Jacob

There is no patch for ignorance





Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong ??? FT BOOK: ASP.NET Website Programming Problem-Design-Solution 2 November 3rd, 2005 09:18 AM
What could be wrong??? jPaulB VB Databases Basics 4 October 20th, 2005 09:12 PM
Wats the error in this code rajanikrishna Classic ASP Databases 2 November 23rd, 2004 08:53 PM
Where am I going wrong ? fredb23 Classic ASP Databases 3 August 10th, 2004 04:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.