473,714 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ 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.R awUrl, "Default.as px") = 0) Then
Response.Redire ct("Default.asp x")

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 1874
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.R awUrl, "Default.as px") = 0) Then
Response.Redire ct("Default.asp x")

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.Redire ctLocation = "http://localhost:4718/AlertPalSiteDes ign" )

instead of using

Response . Redirect("Defau lt.aspx");

The theme and all my pictures appear normally but the IF statement
(If (Session("id") = "" And Session("pass") = "" And InStr(Request.R awUrl, "Default.as px") = 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.Redire ctLocation = "http://localhost:4718/AlertPalSiteDes ign" )

instead of using

Response . Redirect("Defau lt.aspx");

The theme and all my pictures appear normally but the IF statement
(If (Session("id") = "" And Session("pass") = "" And InStr(Request.R awUrl, "Default.as px") = 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_Theme s/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="Manag eRecommendation .aspx.vb" Inherits="Manag eRecommendation " 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.R awUrl, "Default.as px") = 0) Then
Response.Redire ct("Default.asp x")

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 "CheckLoginCred entials" 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 "CheckLoginCred entials" 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...you r solution works well
the if statement in my function works well in the page load and my theme appears.....I'l l 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...you r solution works well
the if statement in my function works well in the page load and my theme appears.....I'l l refer to you in my references :) as the best one
Good stuff :)
May 15 '07 #10

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

Similar topics

1
2295
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? Do I need to add the theme on the top of each page I create from this master page?
4
3410
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 I have a theme and right now, the theme structure looks like... App_Themes --Authenticated ----Images ------Menu
3
2874
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 master theme and apply another stylesheet.css. According to the documentation I've read. I should be able to disable the theme by setting the "enabletheming" attribute on the aspx Page to false. This doesn't seam to work. When I look at the...
1
8001
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 run the app, the breakpoint is never hit. Of course my theme is not being applied. The above procedure works fine for any content page, but obviously doesn't work for my master page. So, how does one properly and programmatically set a theme...
1
1756
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 A is considered the default theme for the site But different users can have different themes. User A has Theme A User B has Theme B Logs in sees Theme A During Login sees Theme A after login sees Theme B
11
6524
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 page as well as in the web.config. The control looks ok at run time but when viewed in the Visual Studio designer it cannot pick up the current theme.
4
4241
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 theme (blue title). There are a lot of web sites I have seen that have very attractive themes. I am not a programmer and do not like to edit the php files or css files etc. My preference is to visually create the theme (font,images,background...
1
2364
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 folder that is stored at the root of my project folder. It is really the one I want to use for all pages, so I thought I would reference it in the web.config file: <pages masterPageFile="~/Masters/SiteTemplate.master"
0
1449
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 merged left hand column I place a picture (looping round a directory full of ,jpg files - a table entry in the Word document for every picture). All works fine and the document looks fine on the screen and in Print Preview, but when I print only...
0
8795
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9168
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9068
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7942
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6621
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5943
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4462
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4715
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3155
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.