Click here to Skip to main content
16,020,447 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

We recently set up some of our pages to be redirected as friendlyurl's. When doing this, I noticed that the requiredfieldvalidators do not display. What we have are different login pages with different page material based on the state in which you live. So to make things easier, we added these login pages to have friendlyurl's so they would be easier for the users. By doing this, my requiredfieldvalidators do not work any more. I have validators displaying messages if the user did not fill in their username, one if they did not fill in their password, and one if they entered an incorrect username or password. My guess is that the validators are not displaying due to the redirection for the friendly url, but am not sure what to do to make them display. Any ideas on what I need to do to make this work?

Thanks In Advance,

Brad
Posted
Comments
Orcun Iyigun 26-Jul-11 12:51pm    
I am not quite certain that I understand you correct but do your "CausesValidation" property is set to true in the requiredfieldvalidators?
clugsy64 26-Jul-11 13:41pm    
I do not see a "CausesValidation" property for the validators.

Let me try to explain this better. The ASPX page resides in "student/en/home/california/cal.aspx". So the user does not have to go to "www.site.com/student/en/home/california/cal.aspx", we have the following in Web.config:

<MappingRule>
<friendlyurlpattern>~/cal.aspx
<complexinteralurl>~/student/en/home/california/cal.aspx
</MappingRule>

We also have the following snippet routine in UrlMappingModule.cs:

else if (requestedPath.ToLower().IndexOf("california/cal.aspx") >= 0)
{
//replace relative uri to absolute uri, the host server does not take
//relative uri

redirectUrl += @"cal.aspx";

// go to new page
app.Response.Status = "301 Moved Permanently";
app.Response.AddHeader("Location", redirectUrl);
}


And this is where I think the issue lies because of the redirection therefore the validators do not show.

Any ideas?
clugsy64 26-Jul-11 13:42pm    
I am sorry the mapping rule should look like:

<MappingRule>
<friendlyurlpattern>~/cal.aspx
<complexinteralurl>~/student/en/home/california/cal.aspx
</MappingRule>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900