|
-
July 3rd, 2006, 05:21 AM
#1
Masterpages / Forms question
hello,
I'm using masterpages in my asp.net web application, my problem is that the login is placed in the masterpage.
That works actually very well, but on some content pages I'm using validate controls and a submit button aswell.
So, If you open such a page and you are not logged in and you click on
the login button in the masterpage, the validate control elements don't allow the submit.
It's only one form, even with a masterpage, but how can I work around this problem ?
-
July 3rd, 2006, 10:18 PM
#2
Re: Masterpages / Forms question
 Originally Posted by AndyTheAce
hello,
I'm using masterpages in my asp.net web application, my problem is that the login is placed in the masterpage.
That works actually very well, but on some content pages I'm using validate controls and a submit button aswell.
So, If you open such a page and you are not logged in and you click on
the login button in the masterpage, the validate control elements don't allow the submit.
It's only one form, even with a masterpage, but how can I work around this problem ?
Hi,
You can turn-off validation. It's property CausesValidation. Assign all the other elements to a Validation group and turn that validation group off when clicking on the login button. You will need to do that with JavaScript.
If that doesn't work, have you tried to forcefully do a post back using javascript:
Client side:
javascript:__doPostBack('__Page', 'ACTION_NAME');
Server side:
You need to register the post back in PageLoad...
Page.ClientScript.GetPostBackEventReference(this, "ACTION_NAME");
Reto
http://www.xcellery.com
-
July 4th, 2006, 06:36 AM
#3
Re: Masterpages / Forms question
Hello & thanks for answer,
yes I tried it with a manual __doPostBack by using btnname.Attributes.Add().
Didn't work, the postback was also blocked by the javascript code from the validation.
You said I could turn off the validation manually, I have not a clue how to do this. I guess I must implement a javascript aswell, but what have I to do in the script?
-
July 4th, 2006, 03:20 PM
#4
Re: Masterpages / Forms question
 Originally Posted by AndyTheAce
Hello & thanks for answer,
yes I tried it with a manual __doPostBack by using btnname.Attributes.Add().
Didn't work, the postback was also blocked by the javascript code from the validation.
You said I could turn off the validation manually, I have not a clue how to do this. I guess I must implement a javascript aswell, but what have I to do in the script?
Hi,
Read this article. http://msdn.microsoft.com/msdnmag/issues/02/04/Valid/
There it talks about disabling validations.
Reto
www.xcellery.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|