question about postback

question about postback

am 13.01.2008 14:36:23 von mark

Hi,

In the aspx file, the form is submitted with a javascript like this:



onclick="myfunc()"/>




In the code-behind page, i did this (which doesn't work):
--------------------------------------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load

Dim sqlcomm As String
sqlcomm = Request.Form("sql")

If page.IsPostBack
response.write("ok")
else
....

I can solve this by doing this (which works):
-------------------------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load

Dim sqlcomm As String
sqlcomm = Request.Form("sql")

If sqlcomm <> "" Then
response.write("ok")
else
....

My question: why is this not considered as a postback?
Thanks
Marc

Re: question about postback

am 13.01.2008 15:41:55 von mark

"Mark" wrote in message
news:urGELleVIHA.1132@TK2MSFTNGP06.phx.gbl...

> My question: why is this not considered as a postback?

Because it isn't...

What you have here is a bog-standard HTML form...

For a postback in ASP.NET, you need an ASP.NET form...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Re: question about postback

am 14.01.2008 08:58:00 von mark

Thanks

"Mark Rae [MVP]" schreef in bericht
news:%23V7EzJfVIHA.5208@TK2MSFTNGP04.phx.gbl...
> "Mark" wrote in message
> news:urGELleVIHA.1132@TK2MSFTNGP06.phx.gbl...
>
>> My question: why is this not considered as a postback?
>
> Because it isn't...
>
> What you have here is a bog-standard HTML form...
>
> For a postback in ASP.NET, you need an ASP.NET form...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net