A button press causes your form to post back to the server, thus
IsPostBack will always be true when an event happens.
Is this code in Page_Load or some other event handler? If you show us
the code you are trying to use to execute SQL commands I'm sure
someone will be able to help you.
--
Scott
http://www.OdeToCode.com
On Tue, 27 Jan 2004 15:38:12 -0000, "luna" <> wrote:
>If Not Page.IsPostBack Then
> surname1.Text = "PASS"
>Else
> surname1.Text = "FAIL"
>End If
>
>Im new to aspx so apologies in advance
>
>Im using the above piece of code to try to ascertain what is happening with
>my webpage
>
>I created a webpage and put a button on it - simple enough
>
>when i click the button i want to retrieve some data from a SQL database and
>put it into different textboxes - seems simple enough
>
>the above 5 lines of code is my code behind my button
>Now surname1.text is never equal to PASS - why i dont know?
>
>if i dont include if not page.ispostback then
>the code seems to work - except that i cannot run any SQL commands on the
>DB
>
>any help again is greatly appreciated
>
>Mark.
>