473,465 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

My theme and pictures are disappearing

11 New Member
I have a website and I,m using a an application theme that consists of a skin and a cascading style sheet and I have vriety of master pages and it works fine.

I use in my site a log in with session so I create a global file ( global.asax ). Inside this global file I check for log in by the following function:

Sub CheckLoggedIn()
'If the user is not logged in and you are not currently on the Login Page.
If (Session("id") = "" And Session("pass") = "" And InStr(Request.RawUrl, "Default.aspx") = 0) Then
Response.Redirect("Default.aspx")

End If
End Sub

If I remove this function all pictures and the theme are displayed normally
but once I add this function all the pictures in my site's theme disapeared!!

what is wrong with this function? Is it not correct??

can any one help am l missing something? please try to help me as soon as you can because I have to submit this site in 1 week

NOTE: I'm using the local host server and mysql with asp.net and vb.net.
May 10 '07 #1
11 1848
Motoma
3,237 Recognized Expert Specialist
When you say "remove this function" you mean "comment the body of the function out" correct?

What may be happening is that the function or your login are not working as you expect, and you are always getting redirected to Default.aspx.

On a side note, this function will only redirect in the case that you ARE on Default.aspx, and you have NO login credentials.


I have a website and I,m using a an application theme that consists of a skin and a cascading style sheet and I have vriety of master pages and it works fine.

I use in my site a log in with session so I create a global file ( global.asax ). Inside this global file I check for log in by the following function:

Sub CheckLoggedIn()
'If the user is not logged in and you are not currently on the Login Page.
If (Session("id") = "" And Session("pass") = "" And InStr(Request.RawUrl, "Default.aspx") = 0) Then
Response.Redirect("Default.aspx")

End If
End Sub

If I remove this function all pictures and the theme are displayed normally
but once I add this function all the pictures in my site's theme disapeared!!

what is wrong with this function? Is it not correct??

can any one help am l missing something? please try to help me as soon as you can because I have to submit this site in 1 week

NOTE: I'm using the local host server and mysql with asp.net and vb.net.
May 10 '07 #2
assor
11 New Member
Yes when I commint the body of the function every thing works fine.........
but once I return the body the theme disappear....

what is the reason of this problem ?

When I try to use
( Response.RedirectLocation = "http://localhost:4718/AlertPalSiteDesign" )

instead of using

Response . Redirect("Default.aspx");

The theme and all my pictures appear normally but the IF statement
(If (Session("id") = "" And Session("pass") = "" And InStr(Request.RawUrl, "Default.aspx") = 0))
in my function doesnot work.......................

I don't understand where is my problem and How could I repair it?
May 10 '07 #3
assor
11 New Member
Yes when I commint the body of the function every thing works fine.........
but once I return the body the theme disappear....



When I try to use
( Response.RedirectLocation = "http://localhost:4718/AlertPalSiteDesign" )

instead of using

Response . Redirect("Default.aspx");

The theme and all my pictures appear normally but the IF statement
(If (Session("id") = "" And Session("pass") = "" And InStr(Request.RawUrl, "Default.aspx") = 0))
in my function does not work (all pages are opened even though the user is not logged in).......................

Note:
I apply the styleSheet for my site as follows:

1. In the web.config file:
<pages styleSheetTheme ="Granite">

2. And inside each master page in my site I add the following statement
<link href="App_Themes/Granite/Granite.css" rel="stylesheet" type="text/css" />

3. Finally,inside each aspx page in the site I add the master page in the following way

<%@ Page Language="VB" MasterPageFile="~/AdminMasterPage.master" AutoEventWireup="false" CodeFile="ManageRecommendation.aspx.vb" Inherits="ManageRecommendation" title="Manage Recommendations" %>

Is my way in applying the theme correct??



What is the reason of my problem ??? Is it from applying the theme or from the function CheckLoggedIn()?

How could I repair this problem
May 10 '07 #4
Motoma
3,237 Recognized Expert Specialist
I am not sure, I am sorry I could not help out more.
May 11 '07 #5
Frinavale
9,735 Recognized Expert Moderator Expert
I have a website and I,m using a an application theme that consists of a skin and a cascading style sheet and I have vriety of master pages and it works fine.

I use in my site a log in with session so I create a global file ( global.asax ). Inside this global file I check for log in by the following function:

Sub CheckLoggedIn()
'If the user is not logged in and you are not currently on the Login Page.
If (Session("id") = "" And Session("pass") = "" And InStr(Request.RawUrl, "Default.aspx") = 0) Then
Response.Redirect("Default.aspx")

End If
End Sub

If I remove this function all pictures and the theme are displayed normally
but once I add this function all the pictures in my site's theme disapeared!!

what is wrong with this function? Is it not correct??

can any one help am l missing something? please try to help me as soon as you can because I have to submit this site in 1 week

NOTE: I'm using the local host server and mysql with asp.net and vb.net.

Is it possible for you just to add this function to every page instead of keeping it in your global file?

I've never put this type of functionality into the global file before.
May 11 '07 #6
assor
11 New Member
Is it possible for you just to add this function to every page instead of keeping it in your global file?

I've never put this type of functionality into the global file before.

I'v never try to add this function in every page. Isn't there any way else to solve this problem without removing this function from the global file.
May 11 '07 #7
Frinavale
9,735 Recognized Expert Moderator Expert
I'v never try to add this function in every page. Isn't there any way else to solve this problem without removing this function from the global file.
Well what I've done is created an object called Utils in almost all of my project.
This Object only holds static shared functions that are used on all my pages or in all of my objects.

So its quite simple to have a function called "CheckLoginCredentials" that returns True or False depending if the login is valid....then call this function in my Page_Load method...if it checks out then the rest of the stuff on that page is loaded, otherwise the user's redirected to the login.

It isn't as bad as it sound ;)

-Frinny
May 11 '07 #8
assor
11 New Member
Well what I've done is created an object called Utils in almost all of my project.
This Object only holds static shared functions that are used on all my pages or in all of my objects.

So its quite simple to have a function called "CheckLoginCredentials" that returns True or False depending if the login is valid....then call this function in my Page_Load method...if it checks out then the rest of the stuff on that page is loaded, otherwise the user's redirected to the login.

It isn't as bad as it sound ;)

-Frinny
Thank you so much for helping me Frinavale...your solution works well
the if statement in my function works well in the page load and my theme appears.....I'll refer to you in my references :) as the best one
May 15 '07 #9
Frinavale
9,735 Recognized Expert Moderator Expert
Thank you so much for helping me Frinavale...your solution works well
the if statement in my function works well in the page load and my theme appears.....I'll refer to you in my references :) as the best one
Good stuff :)
May 15 '07 #10
Motoma
3,237 Recognized Expert Specialist
Frinny for the win! Thanks for the help!

Thank you so much for helping me Frinavale...your solution works well
the if statement in my function works well in the page load and my theme appears.....I'll refer to you in my references :) as the best one
May 15 '07 #11
Plater
7,872 Recognized Expert Expert
Aye, global.asx really shouldn't have anything in it other then what gets auto-created by VS (Module load/unload, session start/end, error) And avoid doing much in them.
May 15 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Miguel Dias Moura | last post by:
Hello, I am creating a master page for a web site. All pages created from this master page will use the same theme. However I am not able to add the theme in my master page. Why is that? ...
4
by: Ben | last post by:
Hi, I'm using images in my menu control. I have my menu setup based on this example: http://msdn2.microsoft.com/en-US/library/system.web.ui.webcontrols.menuitembinding.imageurlfield(VS.80).aspx ...
3
by: dvan | last post by:
I've created a theme Css for my Asp.net 2.0 web application. The web.config Pages Theme key is set to the theme name. Everything seams to work fine except for any page that I want to disable the...
1
by: Joey | last post by:
Hello, I have tried to programmatically set the theme for my master page by putting code in a "Page_PreInit" fuction in the master page's code behind. However, when I set a breakpoint there and...
1
by: Ron | last post by:
I have an application that requires a login at each visit to the site and can only be accessed by a login. A user can have different themes depending if it was assigned in there profile. Theme...
11
by: greg | last post by:
Hi all, Is there a way to get the current theme name at design time? I'm trying to write a custom control for which I need to use images from the current theme. I have asigned a theme to the...
4
by: Neil Jones | last post by:
Hello, I would like to create my own theme(s) for a couple of my own blog sites. I am hoping a few better themes could bring lot more readers. So far, I have stayed with the default wordpress...
1
by: Henry Stock | last post by:
I am having trouble referencing a theme in my ASP.NET project. I was following a model that allowed for multiple themes. So The theme that I have is stored in named "Base" under the App_Theme...
0
by: TOPSie | last post by:
I used http://support.microsoft.com/kb/316383/en-us as the basis of some code to generate a Word document using VB code (.NET2005). In the code I have a loop which produces a table and in the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.