I am storing the page URL in database using HttpContext.Current.Request.Url.AbsolutePath.
The issue is that sometimes it stored the url with the extension .aspx and sometime not.
How to solve this problem?
string absolutepath = HttpContext.Current.Request.Url.AbsolutePath;
string query2 = "select * from tblURL where url_page= '" + absolutepath + "'";
DataTable dt = contextdb.GetData_Using_Datatable(query2);
if (dt.Rows.Count == 0)
{
contextdb add = new contextdb();
bool InsertStatement = add.insert("INSERT INTO tblURL ( url_page, url_status) VALUES ('" + absolutepath + "', '1' ) ");
}