Redirect to last page in asp.net

Filed in .Net Leave a comment

if (!IsPostBack)

{

ViewState[Constants.ViewState.ReferUrl] = Request.UrlReferrer.ToString();

}

protected void btnSignIn_Click(object sender, ImageClickEventArgs e)

{

if (this.SignIn())

{

if (ViewState[Constants.ViewState.ReferUrl] != null)

{

Response.Redirect(ViewState[Constants.ViewState.ReferUrl].ToString(), false);

}

}

}

http://www.dotnetcurry.com/ShowArticle.aspx?ID=89

String Concatenation in gridview Template column using Eval

Filed in .Net Leave a comment

Text=’<%# “Receipt Id# : ” + Eval(“SId”) %>’

This is only possible in Eval method, doesn’t work in Bind.

 

Take backup of your pinned items in Windows 7

Filed in OS Leave a comment

%AppData%\Microsoft\Windows\Recent\AutomaticDestinations
%AppData%\Microsoft\Windows\Recent\CustomDestinations
%AppData%\Microsoft\Windows\Recent\AutomaticDestinations
 

WordPress Site in a Virtual Directory

Filed in IIS Configuration Leave a comment

Recently we faced an issue with setting up the permalink on a word press site deployed over IIS7.

Actually there was a main site (like www.abc.com) and the wp site was setup as a virtual directory on that website (like www.abc.com/wp).

When we setup the permalink to post name (pretty permalink as said by word press) all the links on the site end up in the page not found error (404 error). The actual problem got identified when i looked at the URL Rewrite settings in the IIS for that virtual directory, there were many redirection rules appearing and those were defined on the root of the website and the redirection rule that was defined for the wp site was appearing at the bottom of the page. So I moved that rule to the top of all the rules and the problem got resolved.

Hope this will help someone as well, as we’ve spent 10s of hours to fix it with trying out multiple things.

———————–Updates: Nov-25-2011———————–

The actual reason was that the virtual directory’s web.config file was inheriting rules from the root site’s web.config. So the alternate is to add the “Clear” tag before any rules tag in the web.config file. Clear will remove the inheritance or rules for that virtual directory. Please see below:

<rewrite>
<rules>
<clear />
<rule name=”wordpress” patternSyntax=”Wildcard”>
<match url=”*” />
<conditions logicalGrouping=”MatchAll” trackAllCaptures=”false”>
<add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />
<add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” />
</conditions>
<action type=”Rewrite” url=”index.php” />
</rule>
</rules>
</rewrite>

, , ,

TOP