简体   繁体   中英

Missing buttons in visual studio 2012

When I am in Visual Studio 2012,and working on asp.net pages, my design and split buttons are missing. I only have source. How can I get these back.

Look at the bottom of the window. Take a look at this question: Where has Design View gone in Visual Studio 2012?

If they aren't there, enable them: Visual Studio 2012 - where has ASPX design and split view gone?

<TabControl TabStripPlacement="Top">
        <TabItem Header="Ex1" Width="100">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="129*"/>
                    <ColumnDefinition Width="23*"/>
                    <ColumnDefinition Width="355*"/>
                </Grid.ColumnDefinitions>
                <Button Content="Get Data" HorizontalAlignment="Left" Margin="61,22,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click" Grid.Column="2"/>
                <ListBox  Name="lbxDisplay" HorizontalAlignment="Left" Height="195" Margin="24,59,0,0" VerticalAlignment="Top" Width="456" Grid.ColumnSpan="3"/>
            </Grid>
        </TabItem>
        <TabItem Header="Ex2" Width="100">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="22*"/>
                    <ColumnDefinition Width="20*"/>
                    <ColumnDefinition Width="465*"/>
                </Grid.ColumnDefinitions>
                <Button Content="GetData2" Name="GetData2" HorizontalAlignment="Left" Margin="171,22,0,0" VerticalAlignment="Top" Width="75" Click="GetData2_Click" Grid.Column="2"/>
                <ListBox Name="lbx1" HorizontalAlignment="Left" Height="195" Margin="2,59,0,0" VerticalAlignment="Top" Width="209" Grid.Column="1" Grid.ColumnSpan="2" SelectionChanged="lbx1_SelectionChanged" />
                <ListBox Name="lbx2" HorizontalAlignment="Left" Height="195" Margin="233,59,0,0" VerticalAlignment="Top" Width="207" Grid.Column="2"/>
            </Grid>
        </TabItem>
        <TabItem Header="Ex3" Width="100">
            <Grid Margin="9,14,16,28">
                <Button Content="Get Data3"  Name="GetData3" HorizontalAlignment="Left" Margin="213,22,0,0" VerticalAlignment="Top" Width="75" Click="GetData3_Click"/>
                <DataGrid Name="dgDisplay3" Margin="0,51,0,0" RenderTransformOrigin="0.5,0.5" >
                    <DataGrid.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform AngleX="1.193"/>
                            <RotateTransform/>
                            <TranslateTransform X="-1.479"/>
                        </TransformGroup>
                    </DataGrid.RenderTransform>
                </DataGrid>
            </Grid>
        </TabItem>
        <TabItem Header="Ex4" Width="100">
            <Grid>
                <Button Content="Get Data" Name="GetData4" HorizontalAlignment="Left" Margin="213,22,0,0" VerticalAlignment="Top" Width="75" Click="GetData4_Click"/>
                <DataGrid Name ="dgDisplay4" Margin="10,62,10,10"></DataGrid>
            </Grid>
        </TabItem>
        <TabItem Header="Ex5" Width="100">
            <Grid>
                <Button Content="Get Data"  Name="GetData5" HorizontalAlignment="Left" Margin="213,22,0,0" VerticalAlignment="Top" Width="75" Click="GetData5_Click"/>
                <DataGrid Name ="dgDisplay5" Margin="10,62,10,10"></DataGrid>
            </Grid>
        </TabItem>
    </TabControl>




   //1. Retrieve customer names and display alphabetically in a listbox 
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            DataClasses1DataContext db = new DataClasses1DataContext();

            var query = from c in db.Customers
                        orderby c.ContactName ascending
                        select c.ContactName;

            lbxDisplay.ItemsSource = query.ToList();
        }


        //2.(a) One on left displays supplier name.  
        private void GetData2_Click(object sender, RoutedEventArgs e)
        {
            DataClasses1DataContext db = new DataClasses1DataContext();

            var query = from s in db.Suppliers
                        select s.CompanyName;

            lbx1.ItemsSource = query.ToList();
            lbx1.SelectedIndex = 0;
        }
        //(b) When a name is selected on this list the products for this supplier are displayed on the right
        private void lbx1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataClasses1DataContext db = new DataClasses1DataContext();

            string companyName = lbx1.SelectedValue.ToString();
            var query2 = from s in db.Suppliers
                         join p in db.Products
                         on s.SupplierID equals p.SupplierID
                         where s.CompanyName == companyName
                         select p.ProductName;

            lbx2.ItemsSource = query2.ToList();
        }


        //3. Select the following product information and display on a DataGrid
        //Product Name //Supplier Name //Unit Price
        private void GetData3_Click(object sender, RoutedEventArgs e)
        {
            DataClasses1DataContext db = new DataClasses1DataContext();

            var query3 = from s in db.Suppliers
                         join p in db.Products
                         on s.SupplierID equals p.SupplierID
                         select new
                         {
                             Name = s.CompanyName,
                             Product = p.ProductName,
                             Price = p.UnitPrice
                         };

            dgDisplay3.ItemsSource = query3.ToList();
        }


        //4. Display Customer ID and Number of Orders sorted with highest number of orders first
        //using Orderby
        private void GetData4_Click(object sender, RoutedEventArgs e)
        {
            DataClasses1DataContext db = new DataClasses1DataContext();

            var query4 = from o in db.Orders
                         join od in db.Order_Details
                         on o.OrderID equals od.OrderID
                         orderby od.Quantity descending

                         select new
                            {
                            CustomerId = o.CustomerID,
                            NumberofOrders = od.Quantity,
                            }; 

            dgDisplay4.ItemsSource = query4.ToList();
        }


        //5. Display the following information from the Orders and Customer tables ordered by count of orders
        // Customer ID // Company Name // Number of Orders // Contact Name // Contact Phone
        //Hint: Use Group and Join
        private void GetData5_Click(object sender, RoutedEventArgs e)
        {
            DataClasses1DataContext db = new DataClasses1DataContext();

            var query5 = from o in db.Orders
                         group o by o.CustomerID into g
                         join c in db.Customers on g.Key equals c.CustomerID
                         orderby g.Count() descending

                         select new
                         {
                             CustomerId = g.Key,
                             CompanyName = c.CompanyName,
                             OrderCount = g.Count(),
                             ContactName = c.ContactName,
                             ContactPhone = c.Phone
                         };
            dgDisplay5.ItemsSource = query5;
        }


    }//end class

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM