IIS7 Rewrite changing default button
I've run into a strange problem regarding default buttons in master pages and IIS7 rewrite module. All my content pages hav开发者_StackOverflow社区e default buttons set in the code-behind (on prerender), or they are in panels on the aspx page. This works fine on my local machine and on the production server. However, when I enable IIS7 URL Rewrite, the default button is always to the one in the master page.
protected void LoginButton_PreRender(object sender, EventArgs e)
{
Button btnDefault = sender as Button;
this.Page.Form.DefaultButton = btnDefault.UniqueID;
}
That's how I set my default button in the code-behind. I'm not sure what the rewrite module could be doing. Thanks for any help
I don't know what it is about posting to SO, but after hours and hours of trying, I figure it out...after posting lol. Well, I'll leave the question here for anyone who comes across this, or a similar problem. I added this to the Rules section in the web.config
<add input="{URL}" negate="true" pattern="\.axd$" />
The .axd files are generated dynamically, so you can't 'hard-code' against it.
精彩评论