hello friends! i have designed my website in ASP, this website has large database in (make in database MS Access) i want to show our asp pages in browser html format. which is coding use behind this how can i create this script own website please help to me....... our website in ASP no in (ASP.NET / PHP
I'm a little unclear of your problem. If I read your post correctly, you've made an ASP page, but you are having trouble displaying output from a database in a browser?
i think he means he wants showing .html or text instead of .asp try XMLHTTP get your .asp whole page txt string and create or copy to a .html file name you want.
hello! Thanks for reply to me i want to open my .asp pages in .html for example http://www.articlesexample.com/iarticles.asp?pr=748& than database create auto link and pick the article number like748 than made this link like http://www.articlesexample.com/748.html http://www.articlesexample.com/iarticles748.html and other file as you made... please tell me
Sounds like you are looking for URL rewriting: You want domain.com/iarticles748.html rather than domain.com/iarticles.asp?pr=748 The easiest way to deal with this is with LinkFreeze by Helicon Tech. LinkFreeze runs as an IIS snap in, so it will automatically write all of your .asp querry strings to, say, .html files; you don't need to do anything with the site. Everything is handled as 301 redirects too, so even links to the .asp? URLs will get redirected to the .html rewritten URL. So, domain.com/iarticles.asp?pr=748 would be rendered as something like domain.com/iarticles~pr~748.html However, if you are using shared hosting and your host doesn't already offer this, you may find that they aren't willing to install it . . . . which may mean you'll need to find a host that does offer it. Otherwise, in classic ASP, you're looking at having to develop a custom URL rewriter for the application. This would have the benefit of being able to rewrite the URL to something like domain.com/Article-Title-748.html or some such. I've developed these before.
Yep. Looks like they're running the same sort of setup as we run. In a Windows hosting environment, it's not as simple as mod_rewrite on a LAMP server . . . . so, not many Windows hosts offer LinkFreeze or ISAPI_Rewrite. LinkFreeze is the simple solution, just as I described below. Just set it an forget it. ISAPI_Rewrite is MUCH more sophisticated and powerful, and can also handle everything .htaccess can handle on a LAMP server. PM me if you have any more questions about any of this.
that's a good simple solution, but.. asp is dynamic programming language and html is static p.l., this means that, one asp file can make many html pages in the same time (not exactly), if any , which one html page you want to show
I'm sorry, @palme, You do not know about which you speak. True ASP classic or .NET -- or any other server side scripting such as PHP, etc. -- processes code on the server first . . . . but this has NOTHING to do with XMLHTTP, as that just a "silent posts back" to the server in the same way a browser or robot would to retreive the client-side rendering of a page; so, you are completely wrong here.
How about a blank file 404.aspx with a code-behind file 404.aspx.vb similar to this: Imports System.IO Imports System.Net Partial Class _404 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim reqURL, myReq, myID As String reqURL = Request.Url.ToString reqURL = Right(reqURL, Len(reqURL) - InStr(reqURL, ";")) Dim uri As New Uri(reqURL) myReq = Replace(uri.AbsolutePath, "/", "") myReq = Replace(myReq, ".html", "") If Left(myReq, 8) = "article-" Then myID = Right(myReq, Len(myReq) - 8) 'now load the page using loadWebPage sub loadWebPage("http://www.yourarticles.com/articles.aspx?articleID=" & myID) Else Response.Write("Error 404") 'Response.Redirect("error404.html") End If End Sub Function loadWebPage(ByVal strURI As String) As String Dim r As WebResponse r = WebRequest.Create(New Uri(strURI)).GetResponse() Dim sr As New StreamReader(r.GetResponseStream()) Do Until sr.EndOfStream Response.Write(sr.ReadToEnd) Loop sr.Close() r.Close() End Function End Class Code (markup): You can then set your 404 error page to 404.aspx (which most hosts should allow).... I tested this theory and it works... usage would be http://www.yourarticles.com/article-2134.html would load articles.aspx?articleID=2134 This is ASP.net code but I'm sure it could be done in regular ASP also.
the 404.aspx file wouldn't be blank but would have the line: <%@ Page Language="VB" AutoEventWireup="false" CodeFile="404.aspx.vb" Inherits="_404" %>
Yeah, but bouncing off custom 404 is so "old school". It's really better to handle this through IIS anymore when expedient. What's more, the "sweet spot" with URL rewriting here would be to be able to write out the links and pick up the URL rewrites at the application level so that you could search the db for title matches and thereby have keyword-rich URL's too. But as that would require a serverside search on the db via a custom 404 handling like this one here, it has to be application-specific. The easiest way to get up and going better than this suggestion here is with Helicon Tech's LinkFreeze as it will do the very same thing right in IIS . . . AND it will also rewrite all links generated by the application BEFORE they are pushed to the browser AND when they come in via some other referrer such as a search engine or link from another site. Yeah, this can be done with classic ASP too with the same essential logic. PM me if you are interested.
yeah I figured it had probably been done before... just a suggestion if installing the addin isn't an option.
For sure @camjohnson95: point well taken. You are right. Not many Windows hosts are going to support advanced stuff like this -- though we do ( shameless plug! ). But, yeah, you've got a site specific way to handle it, @camjohnson95, that only requires custom 404 handling mapped to a processing script, and any host that doesn't support something like that is not a host worth hosting with. Nice contribution to this thread, IMHO.