开发者

IIS7 Rewrite changing default button

开发者 https://www.devze.com 2022-12-27 18:57 出处:网络
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 prerend

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消