URL rewriting environment.
When using the control, I found that a script error occurred while moving the mouse over. debugging. I found it all at once ..
Webresource. axd was originally rewritten. The result location is incorrect. js cannot be loaded in.
After the solution is completed, it is found that when you move the mouse over the menu, it is found.
Xxx.dddd.com/test.aspx
The menu path has changed. It was originally default. aspx and now it has changed to a.dddd.com/xxx/default.aspx with another xxx
It is the path that I rewrite Based on domain name conditions.
The solution is to change the original default. aspx ~ /Default. aspx can be accessed through URL rewriting paths,
Http://www.dddd.com/xxx/test.aspx access to the path is not right into the http://www.dddd.com/default.aspx into this. It should have been a http://www.ddd.com/xxx/default.aspx
The reason is that the control itself processes the jump address. If you can cancel the processing, you can OK. (to be continued)
Fortunately, you don't have to access it with a http://www.ddd.com/xxx/test.aspx.
The following code solves the form submission problem (copied online)
Public class templatebasepage: Page
{
Public templatebasepage ()
{
}
/**//**/
/** // <Summary>
/// Rewrite the default htmltextwriter method, modify the value attribute in the form tag, and set the value to the rewritten URL instead of the real URL.
/// </Summary>
/// <Param name = "Writer"> </param>
Protected override void render (htmltextwriter writer)
{
If (writer is system. Web. UI. html32textwriter)
{
Writer = new formfixerhtml32textwriter (writer. innerwriter );
}
Else
{
Writer = new formfixerhtmltextwriter (writer. innerwriter );
}
Base. Render (writer );
}
}
Internal class formfixerhtml32textwriter: system. Web. UI. html32textwriter
{
Private string _ URL; // a false URL
Internal formfixerhtml32textwriter (textwriter writer)
: Base (writer)
{
_ Url = httpcontext. Current. Request. rawurl;
}
Public override void writeattribute (string name, string value, bool encode)
{
// If the current output attribute is the form-marked action attribute, replace the value with the rewritten false URL
If (_ URL! = NULL & string. Compare (name, "action", true) = 0)
{
Value = _ URL;
}
Base. writeattribute (name, value, encode );
}
}
Internal class formfixerhtmltextwriter: system. Web. UI. htmltextwriter
{
Private string _ URL;
Internal formfixerhtmltextwriter (textwriter writer)
: Base (writer)
{
_ Url = httpcontext. Current. Request. rawurl;
}
Public override void writeattribute (string name, string value, bool encode)
{
If (_ URL! = NULL & string. Compare (name, "action", true) = 0)
{
Value = _ URL;
}
Base. writeattribute (name, value, encode );
}
}