Search Results – Webpage has expired on back button
December 8, 2009
I’ve been asked this a few times now so I thought I would blog my solution to point others to this next time I am asked.
Often times people will create a simple search on their site. The most obvious way to do this is with a simple textbox and button. You then handle the search when the button is clicked in the code-behind.
It may look something like this:
protected void btnSearch_Click(object sender, EventArgs e)
{
if (!String.IsNullOrEmpty(txtSearch.Text.Trim()))
{
BindSearch(txtSearch.Text.Trim());
}
}
Pretty straight forward. The problem here is you’re doing a postback to the same page. You won’t have a history of the previous searches in your browser. After doing a search and you want to see what you had for results from the previous search and simply hit back in your browser you’ll see this
So what I have always done to avoid this is to simply do a Response.Redirect to the page instead of just calling the BindSearch() method and put the search term in the query string.
protected void btnSearch_Click(object sender, EventArgs e)
{
if (!String.IsNullOrEmpty(txtSearch.Text.Trim()))
{
Response.Redirect("/Search.aspx?search=" + txtSearch.Text.Trim());
}
}
This is a pretty simple solution, does anyone else have a different way to handle this?
Sql Server 2008 Install – Restart Computer Failed
September 25, 2009
When installing SQL Server 2008 today I ran into an error right away. In testing the Setup Support Rules the “Restart computer” operation check failed.
After a bit of Binging I found this thread: http://social.msdn.microsoft.com/forums/en-US/sqlsetupandupgrade/thread/ca182f5d-114a-4516-99d4-0854ad176fbf/
It talks about deleting any registry settings with a value of “PendingFileRenameOperations" in the key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager"
Open your Windows programs type “regedit.exe” in the search then click enter. Now drill down to the Session Manager key. Look for any value with “Pending FileRenameOperations” and delete it.
Go back to the SQL Server 2008 setup and rerun it. Everything should pass now and you can proceed.
Visual Studio Error: project type
September 2, 2009
The application for project ‘….’ is not installed.
Make sure the application for the project type (.csproj) is installed.
I generally open up solutions by just double clicking on the .sln file. In this case that is what I did. However what it did is, since it is a 2005 solution it tried to open up in my Visual Studio 2005 install that came with Sql Server 2005. This version couldn’t handle it so it gave this error.
Easy fix, open Visual Studio 2008. Then file –> open project and browse to the same .sln file. I now was able to open the project in Visual Studio 2008.
-
Categories
- asp.net (11)
- Blog (1)
- Business (5)
- Conferences (1)
- Errors (3)
- Portfolio (2)
- Reviews (2)
- SQL Server (3)
- Tips (1)
- Uncategorized (1)
- Web Development (13)
-
Archives