CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 9/20/2007 12:54:09 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 48 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
7 Items, 1 Pages 1 |< << Go >> >|
devilkill
Asp.Net User
unable to switch multiview in contentplaceholder in Master Page with dropdownlist control9/20/2007 12:54:09 AM

0/0

This code allows me to switch Multiviews on a normal page, but will not allow me to switch views in a Master Page. Does anyone know why and how to fix this situation?  

<%@ Page Language="C#" MasterPageFile="~/RootMasterPage.master" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Default3" Title="Title" EnableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPHMain" Runat="Server">

<asp:DropDownList ID="ddTest" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddTest_SelectedIndexChanged" >

<asp:ListItem Value="0" Selected="True">-</asp:ListItem>

<asp:ListItem Value="1">TEST 1</asp:ListItem>

<asp:ListItem Value="2">TEST 2</asp:ListItem>

</asp:DropDownList>

 

<asp:MultiView ID="MultiView1" runat="server">

<asp:View ID="view1" runat="server">

<p>TEST 1</p>

</asp:view>

<asp:View ID="view2" runat="server">

<p>TEST 2</p>

</asp:View>

</asp:MultiView>

</asp:Content>

 

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Collections.Specialized;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public partial class Default3 : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}

protected void ddTest_SelectedIndexChanged(object sender, EventArgs e)

{

MultiView1.ActiveViewIndex =
Convert.ToInt16(ddTest.SelectedIndex);

}

}

Amanda Wang - M
Asp.Net User
Re: unable to switch multiview in contentplaceholder in Master Page with dropdownlist control9/21/2007 3:12:00 AM

0/0

Hi

You can eidit the ddTest_SelectedIndexChanged event like below:

protected void ddTest_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddTest.SelectedIndex != 0)
        {
            MultiView1.ActiveViewIndex = Convert.ToInt16(ddTest.SelectedIndex) -1;
        }
    }

Because the  the MultiView's ActiveViewIndex is zero-based index of the active View control within a MultiView control.

Hope it helps.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
devilkill
Asp.Net User
Re: unable to switch multiview in contentplaceholder in Master Page with dropdownlist control9/21/2007 3:55:15 PM

0/0

Since the DropDownList is in a Content page which is also in a Master Page the value for the SelectedIndex will only show 0 (zero) as its value. Does anyone know how I can keep the selected value of the DropDownLists? SelectedIndex when the DropDownList is in a Master Pages Content Page?

Amanda Wang - M
Asp.Net User
Re: unable to switch multiview in contentplaceholder in Master Page with dropdownlist control9/24/2007 3:17:35 AM

0/0

Hi,

As your description, your mean is the dropdownlist control is in the master page and the  MultiView is in the content page?

For exampe:

1. Master apge:

 <td style="width: 100px">
    <asp:DropDownList ID="ddTest" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddTest_SelectedIndexChanged" > 
      <asp:ListItem Value="0" Selected="True">-</asp:ListItem>
      <asp:ListItem Value="1">TEST 1</asp:ListItem>
      <asp:ListItem Value="2">TEST 2</asp:ListItem>
    </asp:DropDownList> 
</td>
<td colspan="2" rowspan="2">
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
        </asp:contentplaceholder>
</td>
2. Content page:
<%@ Page Language="C#" MasterPageFile="~/TestMutileView/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="TestMutileView_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
     <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="view1" runat="server"> 
            <p>TEST 1</p>
        </asp:view>
        <asp:View ID="view2" runat="server">
            <p>TEST 2</p>
        </asp:View> 
    </asp:MultiView>
</asp:Content>
3.So you can get the do in the Master page codebehind:
 
 protected void ddTest_SelectedIndexChanged(object sender, EventArgs e)
    {
        MultiView mv = (MultiView)this.ContentPlaceHolder1.FindControl("MultiView1");
        if (ddTest.SelectedIndex != 0)
        {
             mv.ActiveViewIndex = Convert.ToInt16(ddTest.SelectedIndex) - 1;
        }
    }
 
  If I misunderstand you, please let me know.
 
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
devilkill
Asp.Net User
Re: unable to switch multiview in contentplaceholder in Master Page with dropdownlist control9/24/2007 4:06:12 PM

0/0

Actually, the dropdownlist is in the content page

devilkill
Asp.Net User
Re: unable to switch multiview in contentplaceholder in Master Page with dropdownlist control9/24/2007 5:45:16 PM

0/0

1. Master Page

2. Content Page (viewed in Master Page)

3. DropDownList to control MultiView (in the Content Page)

4. DropDownList SelectedIndex gets forced to 0 (zero) for some reason??????????????????.

5. How can I keep the SelectedIndex which was selected so that I can compare its value?

devilkill
Asp.Net User
Re: unable to switch multiview in contentplaceholder in Master Page with dropdownlist control10/16/2007 6:45:32 PM

0/0

I found the Problem!!!

 

There was another Form being used in the body of the Master Page. I still am not sure why it worked in Firefox and not IE, but the problem is solved.

 

Thank you to everyone who took their time on this issue.

 

7 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
unable to switch multiview in contentplaceholder in Master Page ... unable to switch multiview in contentplaceholder in Master Page with dropdownlist control. Last post 08-17-2008 3:47 PM by kazoos. ...
unable to switch multiview in contentplaceholder in Master Page ... unable to switch multiview in contentplaceholder in Master Page with dropdownlist control. Last post 08-17-2008 3:47 PM by kazoos. 7 replies. Sort Posts: ...
TheMSsForum.com >> Asp >> Multiview + Infragistics maskinput ... MasterPage Samples I'm looking for different ways to do a Master Page. ..... keep getting this error "Unable to find control id 'FreeBox1' referenced by the ...
TheMSsForum.com >> Asp >> MultiView and changing views. - The ... Master page question Hi I am setting up a web application and am ..... and dropdown on the control have data selected/entered. problem is, ...
ASP.NET Lab 1--Create a Web Site In this exercise, you’ll create a master page to serve as a template for the ..... Switch back to Design view and drag a DropDownList control onto the page. ...
.NET ASP Page 52 - Bytes Site Map Master Page in Asp.Net · Why Control inherited from DataBoundControl appears as ..... Master pages - organising layout - contentplaceholder confusion ...
ASP Net [Archive] - Page 280 [Archive] Page 280 microsoft.public.dotnet.framework.aspnet. ... ASP 2.0 Menu Control and javascript error when placed on a master · Multiple delete with ...
Web Forms UI Notice that MasterPage.master includes a SiteMapDataSource control: ...... item, the user can’t switch the MultiView to InsertView; so again the page ...
ASP.NET 2.0: A Getting Started Guide A DropDownList control is similar to the HTML select element. ...... In our case , the master page contains a single ContentPlaceHolder , but it could have ...
.NET ASP Page 9 - Bytes Site Map Changing a control on a masterpage that uses a second masterpage · Problems automating .... HTTP/1.1 500 Internal Server Error / Unable to start debugging ...




Search This Site:










error with solpart delaysubmenuload function

invitation system similar to e-vite

create edit control for module definition

starter kit 4.0.1 -- can i deploy it?

email management newsletter project - anyone want to contribute?

terms of use is a broken link

i want to show three root nodes and their folders in a treeview-but i don't return the roots-help

dnn2 : my first attempt at user selectable skinning yes its possible with the base dnn2 install ;)

xor and baes64 encoding

microsoft muip c#

database files on seperate server?

how ascx files compile in web control library projects.

how can generate dynamic master page.

e.message.body

can't access admin functions after visual studio "copy project" to host

hosting provider recommendations (dnn)?

setting up a virtual directory

loading usercontrols dynamically to webpart

validate ok button in editior zone

help with css

network drive access

creating a module that uses a different database than dnn's

vendors not showing 'add new banner"

remember me in login control (with layouttemplate) doesn't remember

filling a treeview recursively with data from a sqldatasource

how to create a role in c# codes?

"parent hidden / child not" bug (2.12 & 3.0.12)

membership roles.addusertorole(user.identity.name, listbox1.selectedvalue);

problems with aspnet_setreg process

specifying master pages via database

 
All Times Are GMT