Nothing happens when I click a button

G

Guest

I have added a Button control (also tried LinkButton with same result) and
some code to the click event to my web form in vb.net/vs.net.

When I test it from a browser (IE6) the button shows up but when I click it
nothing happens. In the IE status bar it says "javascript:{if
(typeof(Page_ClientValidate) != 'function' || Page_ClientValidate())
__doPostBack('btnTest','')}" but absolutely nothing happens when I click it.

There seems to be a couple of known bugs that are related to this, especially:
http://support.microsoft.com/?kbid=889877
and maybe this one:
http://support.microsoft.com/default.aspx?scid=kb;en-us;q324735

I have tried running aspnet_regiis.exe -c but there is no difference.
I'm running .net framework 1.1 on a win2k3 server.

Any ideas are appreciated. Thanks.
 
G

Guest

Yes it is. Besides I thought asp.net would check the browser and generate
proper code (ie not use javascript) if it wasn't?
 
D

Daniel Walzenbach

ASP.NET does not work very well if you deactivate js. In fact, in HTML only
a few controls can perform a postback and therefor what ASP.NET does is that
it uses js to submit the page back to the server. As this is a limitation of
HTML ASP.NET has no chance to "generate proper code" if you disable js.
If you enable ja you'll see your button work.

HTHs

Daniel Walzenbach
 
J

Juan T. Llibre

ASP.NET *does* check the browser and, if you're using IE6,
*will* send JavaScript ( and not *not* send it, as you say ).

If you're using IE6, you *will* get JavaScript,
whether you've disabled it or not.
 
G

Guest

Ok. thanks for your reply. But as I said javascript IS enabled, so there has
to be something else.
 
G

Guest

Ok, I see, thanks. So it only checks what browser, not if it's capable of
running javascript.
Anyway this was just a sideline to my real problem. Any ideas why buttons
won't work for me (javascript is enabled in the browser)?
 
D

Daniel Walzenbach

Sorry,

kind it was kind of late yesterday and my kapability of reading... Did you
try a simple asp.net page with *only one* button on it which only does
something like response.write("Hello World")? Do clicks in this example
work?

Daniel Walzenbach
 
J

Juan T. Llibre

I'd check to see whether your client
validation files are where they should be.

ASP.NET 1.1 :
drive:\Inetpub\wwwroot\aspnet_client\system_web\1_1_4322

You should have webuivalidation.js and smartnav.js there.

For more recent versions of the .Net Framework,
just replace your vesion number.

If the validation files aren't there, run aspnet_regiis -c
from a command window in your .Net Framework directory.

That will install them correctly.
Then, try your Page_ClientValidate button Javascript stuff again.
 
G

Guest

I feel stupid for not aleady trying this but when I do as you suggest it DOES
WORK.
So this means there have to be something wrong with my page, any suggestions
how to troubleshoot?
 
G

Guest

Yes, they are there and I've already tried aspnet_regiis -c. However, as in
my reply to Daniel Walzenbach, I realize I haven't done much of
troubleshooting before posting here... It seems if I make a new really simple
page it works, so it has to be something on the specific page I'm trying it
on.
Thanks.
 
G

Guest

Is the the 'Handles' statement at the end of your button code subroutine?

private sub button_click(ByVal sender as System.Object, ByVal e As
Sytem.EventArgs) HANDLES BUTTON.CLICK

Galtac.
 
J

Justin Greene

I had a similiar symptom except my pages were working on my dev machine
but wouldn't submit when I uploaded them. Uploading the .resx files
associated with the .aspx pages (which I hadn't been doing) fixed it.

The problem also went away when I got rid of the validation controls so
they must require the .resx files. I guess it makes sense that the
..resx files are needed since the pages get compiled on server but it
would have been nice to have an error message.

Anyway, hopefully that'll fix your problem too. Good luck!
 
G

Guest

Did you ever get an annswer. I'm having the same problem on a very old site i
did after a server crash.

please let me know

kes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top