Displaying posts categorized under

Tips and tricks

ASP.NET, MySQL and paging

In this article we will create a simple one page ASP.NET web application, implementing paging using the cool MySQL feature LIMIT and SQL_CALC_FOUND_ROWS.

One of the coolest things about MySQL is some of its non standard features. It might sound like a weird thing to say, but being a web developer I just love the simplicity [...]

ASP.NET search terms to database and listing most popular

Logging search terms your visitors are using at your site can be valuable for you as a webmaster, first of all just knowing what they are looking for at your site but also it can give you a hint if some of your content seems hard to reach by “regular” navigation making people always needing to [...]

Get current page name

This function can be used to retrieve the current page:s name, i.e default.aspx, hello.aspx or whatever.

public string GetCurrentPageName()
{
string sPath = System.Web.HttpContext.Current.Request.Url.AbsolutePath;
System.IO.FileInfo oInfo = new System.IO.FileInfo(sPath);
string sRet = oInfo.Name;
return sRet;
}

By going through System.Web.HttpContext.Current object we are able to have this [...]

Last second HTML changes in your ASP.NET page

While this solution might seems a little odd (or more correctly the problem might seem very odd) but this technique has sure solved a lot of problems for me.
What I’m gonna show you is a was to manipulate the resulting HTML and ASP.NET page has generated just before it’s sent to the browser.
Now you [...]