I know in PHP you can do
Code:require('page1.php');
How can you do this in aspx?
Printable View
I know in PHP you can do
Code:require('page1.php');
How can you do this in aspx?
Hello,
There are a couple approaches that you could use.
For instance, you could use ASP.Net User Controls, or you can use ASP.Net Master Pages.
Gary
okay what i have is index.aspx I want to write a script which says if logged in via response.Cookie.... then show a login script otherwise show me the index.php page.
what is the better approach to take?
Are you using the built in ASP.Net Membership Provider?
If so, then the best approach would be to use a LoginView control. You say you want to show index.php, if that is the case, why are you using ASP.Net? I am not saying that you "can't" do this, but mixing two very different technologies is likely to cause you other problems down the line.
Gary
I think you might have missed my question.
I don't want to write this in PHP, I want a ASPX copy of it.
In my index.aspx.vb code I can use VB and check if I cookie exists, if it does not the redirect to login.aspx
On these pages though I want a code to show menu links IF i'm logged in.
So in PHP I would write
How can I write something in ASP which is the same as the PHP code but in ASP.NET?Code:if ($_COOKIE['LoggedIn'] == True){
echo "menui 1";
echo "menu 2";
}
Hello,
Nope I don't think I missed the question, but I think you might have missed my response :)
Everything that you have described can be achieved out of the box, if you use the built in systems that ASP.Net provides for you. Namely, the ASP.Net Membership, Roles and Profile Providers, along with the built in controls that ship with ASP.Net, such as the LoginView. Now granted, you "could" do all of this work by hand, using similar techniques to those that you used in PHP, but my question would be, why bother?
IMO, it would be much more expedient to use the methods that have been tried and test within ASP.Net.
Gary
Thanks, okay I understand what you are saying and let me explain my position.
I've created a number a "sites" using Web Developer 2008 at working using our internal Intranet - I always get errors with it. How can I test or get the settings of my server so I can build something here at home and know i'm not wasting my time?
Here is my background, I'm a PHP programmer but have basic VB.Net understanding.
I want to build a site (mainly a subsite) on our internal intranet which connects to a database so we can edit, update and delete info.
WHat is this .net membership? what's this loginview? where can i get a quick understanding of all of this???
What sort of errors are you referring to? Can you provide an example? Assuming that you are debugging/building straight out of Visual Studio, there should be no need to configure the server (assuming IIS) at this stage.
The short answer is Google/Bing. Here are a couple links that turned up after a quick search:
Membership
http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx
http://msdn.microsoft.com/en-us/library/ff648345.aspx
LoginView
http://msdn.microsoft.com/en-us/libr...loginview.aspx
http://msdn.microsoft.com/en-us/library/ms178329.aspx
Although the MSDN documentation can appear a bit daunting to start with, it really is the best place to get started.
Gary
I would need to look tomorrow at work but the error around authentication, windows, Password, none etc when i remove it i get the topic 657156 which I created on this forum
http://www.vbforums.com/showthread.php?t=657156
With regard to your other thread, are you able to provide more information, as requested? i.e are you running under IIS? If so, do you have the correct version of the .Net Framework etc installed?
Gary
Rather than continue the discussion about this issue in this thread, lets stick to talking about it in the other thread.
Gary