Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a simple button and textbox on a webform with a RequiredFieldValidator tied to the textbox control. The problem is that a postback never occurs on the webform by clicking the button even when I have something inside the textbox.

 

If I don't have the validator control on the webform, then the button clicked event gets fired (causing the postback - I have a breakpoint set in the Button.Clicked event of the button on the webform).

 

The CausesValidation property of the button is set to True, but I have something inside the textbox and it still doesn't postback. I thought that a postback will NOT occur only if there is some kind of validation or required error with the control. In this case, something is inside the textbox, so how come the postback doesn't occur?

 

Does anyone know what the problem is with this?

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

Posted
There is a property on the validator, enableclientscript or something like that, if that is set to true, then asp.net will do the validation ont eh client and not post back.
Posted

I did the following to resolve the problem:

 

On the webserver with the problem, run this command:

aspnet_regiis.exe -c

from [windows]\microsoft.net\framework\[version]

 

It copies the correct files for the version of ASP.NET you are running into each domain defined in IIS.

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...