DropDownList/AutoPostBack causing me problems (ASP.NET)

Soldato
Joined
25 Jan 2003
Posts
11,550
Location
Newark, Notts
I'm trying to set up globalisation on a site, and I have everything tested and ready to stick into the pages.

Problem is, when I go to place a dropdownlist control on the page, with AutoPostBack=True it causes the stylesheet on the page not to be set, and the dropdownlist control gives an "error on page" icon at the bottom when used, which says:

Line - 1
Char - 1
Error - Object expected

My first line is simply:
Code:
<%@ Page Language="vb" AutoEventWireup="false" CodeFile="home.aspx.vb" Inherits="_Default" Culture="auto:en-GB" UICulture="auto" %>

When I remove AutoPostBack=True, the page looks as it should but the control doesn't work as I want it to. This sound familiar to anyone?

The code for my stylesheets is as follows:

Code:
<!-- links to two stylesheets ->
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="blue" />
<link rel="alternate stylesheet" type="text/css" href="stylesheet2.css" title="red" />

<!-- script link to style switcher ->
<script type="text/javascript" src="styleswitcher.js"></script>

Then there's a seperate styleswitcher.js file.
 
Ok by messsing around with a few things, if I remove the following two links (which are used for the user to select a stylesheet):

Code:
<a href="#" onclick="setActiveStyleSheet('blue'); return false;"><img id="colour" src="images/stylesheetcolour2.gif" /></a>
    -
<a href="#" onclick="setActiveStyleSheet('red'); return false;"><img id="colour" src="images/stylesheetcolour1.gif" /></a>

...It works. Problem is I need the style sheet option there. Any ideas why this would be causing problems?
 
Tried a different stylesheet switcher which doesn't have any javascript onclick stuff in the main code, seems to work :)
 
Last edited:
Back
Top Bottom