deb081900 0 Newbie Poster

Hi All

According to the documentation in Microsoft.com/MSDN - Walkthrough: Creating User-Selectable Themes
I used the following code with different nos. like 4 or 6 or 3 but in line no. 7
I got exception either - ArgumentException was unhandled by user code-
is not a valid theme name. Parameter name:Theme

or - Index out of Range

1<script runat="server">   
2  public void Page_PreInit()
3   {
4        // Sets the Theme for the page.
5        this.Theme = "Blue";
6        if (Request.Form != null && Request.Form.Count > 0)
7            this.Theme = this.Request.Form[4].Trim();
8    } 
9</script>

Same code runs successfully with no. 5 only. WHY with only 5????

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.