[Mono-aspnet-list] Problem with linkbutton, postback and validators

jhorrocks jameshorrocks at hotmail.com
Tue Jun 14 22:21:57 EDT 2011


Ok, after further investigation I have found what the problem is (but not
found the solution yet...)

As a test I setup 3 separate web servers to host the same code using the
same firefox web browser on my pc to get the following 3 results: (I will
load the signin.aspx page that has 2 textboxes (username and password) and a
linkbutton to signin when clicked. It also has 2 .net built in
RequiredFieldValidators)

Test 1 - Windows server running IIS 7: (IP 10.1.1.79)

When I load the signin page and view source (firefox) and click on any of
the 2 WebResource.axd links, 1st link takes me to all the .net generated
validator javascript code
var Page_ValidationVer = "125";
var Page_IsValid = true;
var Page_BlockSubmit = false;
var Page_InvalidControlToBeFocused = null;
function ValidatorUpdateDisplay(val) {
    if (typeof(val.display) == "string") {
        if (val.display == "None") {
            return;
        }
        if (val.display == "Dynamic") {
            val.style.display = val.isvalid ? "none" : "inline";
            return;
        }
    }
    if ((navigator.userAgent.indexOf("Mac") > -1) &&
        (navigator.userAgent.indexOf("MSIE") > -1)) {
        val.style.display = "inline";
    }
    val.style.visibility = val.isvalid ? "hidden" : "visible";
}
function ValidatorUpdateIsValid() {
    Page_IsValid = AllValidatorsValid(Page_Validators);
}
etc.......,

2nd link takes me to all the .net generated WebForm_DoPostback javascript

function WebForm_PostBackOptions(eventTarget, eventArgument, validation,
validationGroup, actionUrl, trackFocus, clientSubmit) {
    this.eventTarget = eventTarget;
    this.eventArgument = eventArgument;
    this.validation = validation;
    this.validationGroup = validationGroup;
    this.actionUrl = actionUrl;
    this.trackFocus = trackFocus;
    this.clientSubmit = clientSubmit;
}
function WebForm_DoPostBackWithOptions(options) {
etc.......

This all works correctly.


Test 2 - Local PC running ubuntu 11.04 desktop, mono 2.10 debuging on the
xsp server under monodevelop 2.6 (my IP 10.1.1.80 but xsp server IP
127.0.0.1:8080)

When I load the signin page and view source (firefox) and click on any of
the 2 WebResource.axd links, 1st link takes me to exactly the same html page
that I am already viewing but only has the html tags and stripped out any
content between the tags. Same for the 2nd link also (hence why I cannot
submit or validate the controls as it cannot find the javascript)

This fails.

Test 3 - Standalone server running ubuntu 10.04 server 64bit, apache2
webserver with mono 2.10 (IP 10.1.1.2)

Exactly the same problem as scenario 2

This fails.

--
View this message in context: http://mono.1490590.n4.nabble.com/Problem-with-linkbutton-postback-and-validators-tp3596665p3598367.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.


More information about the Mono-aspnet-list mailing list