Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include file not working with codeBehind

Status
Not open for further replies.

DanaTA

Programmer
Sep 24, 2003
7
0
0
US
Hi,

In my plain ASP pages I had a directive like this in the header:
<!-- #include virtual="/ForceSSL.inc" -->

The include file had standard script to redirect the page to itself only with the https: prefix.

I can't do this with ASP.NET 2.0 with the code in a separate file, which seems to be the prefered way to do things. (I am new to ASP.NET) How can I achieve the same result in my .net pages?

I tried putting the code directly into the codeBehind but that gave the same kind of error.

Thanks,
Dana
 
asp and asp.net are 2 totally different methodolgies. asp is a scripting language where asp.net is a compiled language. the 2 are nothing alike (at least to me).

I assume your ForceSSL.inc redirects the user to https(443)instead of http(80). Your previous post concerned asp.net membership.

I believe there is a web.config setting to require a secure channel, although i'm not exactly sure how. here are some google results on the subject

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Mark? (ca8msm),

Thank you. I will look into your suggestion. I am, as noted however, new to .net entirely and haven't gotten that far yet. I, so far, have not made a Master Page.


Jason,

I understand that basic difference between the two. However, that said, when I was having that other problem I had code in the pages rather than using the codeBehind method. It worked on those pages, just not in the new ones. By the way, that is how I fixed my other problem. I just created a new web in VS2005 and set up membership. I then put in only the connection string and the custom provider, without a lot of the extra options in the provider, and no machineKey section. It worked. I'm using hashed passwords.

I will check out the Google link you gave me.

Thanks,
Dana
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top