Hello Dps, Please solve my query. I have a web page like (www.example.com/home.aspx). I want to convert that url into html url using java script. Please let me know how to make it done. All replies will be highly Appericiated. Thanks
I think you can't do that with javascript. maybe with .htaccess. But let me understand it right: do you just want to display .html instead of .aspx in the url bar?
Its like i have a url that is in .aspx and i just want to convert that into .html using javascript , so i can use that for promotion.... LET ME KNOW
I'm not sure what you mean exactly. But if you open up the page in your browser and then save it locally as HTML, then upload that html. It will display. But that will only work if the page is static (it doesn't change according to a database etc, and has no forms etc.) If it does then there you cannot change the page to HTML, because HTML runs client-side (on the users computer) where aspx (asp.net) runs server-side (on the server). You can use .htaccess or other methods to make the page appear to be a .HTML page, but it will still be asp because it has to be in order to run the necessary code on the server, otherwise it won't display properly.
As far as I know, you can't change the extension of aspx file into html like what we can do with PHP. So, whatever you do, the extension still will be .aspx. That's as far as I know. Maybe anyone can help?
You cannot run asp.net code from a file with the .html extension, what you can do is put a couple of lines of code in your asp app so that to the end user it appears like to have the .html extension; void Application_BeginRequest(object sender, EventArgs e) { HttpApplication app = sender as HttpApplication; if(app.Request.Path.IndexOf("View.html") > 0) { app.Context.RewritePath("/View.aspx"); } } Code (markup):