"nick" <ni**@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com...
I think I need to write a simple forms authentication app for a html page
designer. He will create html files, which are protected by forms
authentication....
For example, I create a form authentication app in securehtmls/. And the
html pages are dumped to the folder.
will it be redirected to login screen if an un-authenticated user try to
access the html files?
"Pandurang Nayak" wrote:
I am not sure I understand your question completely. But if you are
looking
to protect access to some HTML files in your website, you can use Forms
Authentication. Whenever the users try accessing the HTML files, if the
users are not authenticated, they will be redirected to a login page.
If you are looking at having some data in a HTML file and protecting
that,
it is harder. You could take a look at the Dojo toolkit (dojotoolkit.org)
which provides some strong encryption techniques using JavaScript. Any
ideas?
--
blog: www.thinkingMS.com/pandurang
"nick" wrote:
> I need to create a simple asp.net application that use password protect
> some
> html pages. The html page provider doesn't know asp.net. And the host
> doesn't
> allow me to create user accounts.
>
> What's the best way to store users/password except database tables? and
> to
> store html files?
I am not sure exactly what you are trying to do, but I think the html files
will still be served even with forms authentication unless they are in
special folders like App_Data etc (ver 2.0) or you go through some trouble
to have .net handle html files. If they are in special folders though, they
won't be served, they must be called from code. You could have a page with
an extension .aspx (which you put in a secure folder) and use something
like the following :
Sub Page_Load(sender as object, e as eventargs)
DisplayHtmlFile("Path to your secure file here")
End Sub
Sub DisplayHtmlFile(strFilePath as string)
dim reader as textreader = new streamreader(strFilePath)
dim strText as string = reader.readtoend
plc1.controls.clear
plc1.controls.add(New literalcontrol(strtext))
reader.close()
End Sub
In .aspx file
<asp:placeholder id=plc1 runat=server />