Missing Controls In Design View(A strange question)  
Author Message

PostPosted: ASMX Web Services and XML Serialization, Missing Controls In Design View(A strange question) Top

My OS :win server 2003. VS2005 8.0 50727
I used VS to open a simple ASP.net source files by open wensite mode.......when I click Design Mode from SorceCode mode,the controls write in sourcecode are missing,I cann't see them,but if i press Crll+F5,nothing is wrong.Another problem is I cann't add any new controls ,if I add ,VS will show me an error....I will paste two sourcecode below:
1:GreetingCardMaker(Type: Asp.Net server page)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<FORM id="Form1" method="post" runat="server">
<DIV style="BORDER-RIGHT: thin ridge; PADDING-RIGHT: 20px; BORDER-TOP: thin ridge; PADDING-LEFT: 20px; FONT-SIZE: x-small; PADDING-BOTTOM: 20px; BORDER-LEFT: thin ridge; WIDTH: 293px; PADDING-TOP: 20px; BORDER-BOTTOM: thin ridge; FONT-FAMILY: Verdana; HEIGHT: 486px; BACKGROUND-COLOR: lightyellow">Choose
a background color:<BR>
<asp:dropdownlist id="lstBackColor" runat="server" Height="22px" Width="194px"></asp:dropdownlist><BR>
Choose a font:<BR>
<asp:dropdownlist id="lstFontName" runat="server" Height="22px" Width="194px"></asp:dropdownlist><BR>
Specify&nbsp;a numeric font size:<BR>
<asp:textbox id="txtFontSize" runat="server"></asp:textbox><BR>
Choose a border style:<BR>
<asp:radiobuttonlist id="lstBorder" runat="server" Height="59px" Width="177px" Font-Size="X-Small"></asp:radiobuttonlist><BR>
<asp:checkbox id="chkPicture" runat="server" Text="Add the Default Picture"></asp:checkbox><BR>
Enter the greeting text below:<BR>
<asp:textbox id="txtGreeting" runat="server" Height="85px" Width="240px" TextMode="MultiLine"></asp:textbox><BR>
<asp:button id="cmdUpdate" runat="server" Height="24px" Width="71px" Text="Update" onclick="cmdUpdate_Click"></asp:button></DIV>
<asp:panel id="pnlCard" style="Z-INDEX: 101; LEFT: 313px; POSITION: absolute; TOP: 16px" runat="server" Height="507px" Width="339px" HorizontalAlign="Center"><BR>&nbsp;
<asp:Label id="lblGreeting" runat="server" Height="150px" Width="256px"></asp:Label><BR><BR><BR>
<asp:Image id="imgDefault" runat="server" Height="160px" Width="212px" Visible="False"></asp:Image></asp:panel></FORM>

2:SourceCode File:GreetingCardMaker.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace GreetingCardMaker

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

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
// CODEGEN: This call is required by the ASP.NET Web Form Designer.

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()


protected void Page_Load(object sender, System.EventArgs e)
if (this.IsPostBack == false)
// Set color options.

// Set font options.
lstFontName.Items.Add("Times New Roman");

// Set border style options by adding a series of
// ListItem objects.
ListItem item = new ListItem();

// The item text indicates the name of the option.
item.Text = BorderStyle.None.ToString();

// The item value records the corresponding integer
// from the enumeration. To obtain this value, you
// must cast the enumeration value to an integer,
// and then convert the number to a string so it
// can be placed in the HTML page.
item.Value = ((int)BorderStyle.None).ToString();

// Add the item.

// Now repeat the process for two other border styles.
item = new ListItem();
item.Text = BorderStyle.Double.ToString();
item.Value = ((int)BorderStyle.Double).ToString();

item = new ListItem();
item.Text = BorderStyle.Solid.ToString();
item.Value = ((int)BorderStyle.Solid).ToString();

// Select the first border option.
lstBorder.SelectedIndex = 0;

// Set the picture.
imgDefault.ImageUrl = "defaultpic.png";

protected void cmdUpdate_Click(object sender, System.EventArgs e)
// Update the color.
pnlCard.BackColor = Color.FromName(lstBackColor.SelectedItem.Text);

// Update the font.
lblGreeting.Font.Name = lstFontName.SelectedItem.Text;

if (Int32.Parse(txtFontSize.Text) > 0)
lblGreeting.Font.Size =
// Use error handling to ignore invalid value.

// Update the border style.
pnlCard.BorderStyle = (BorderStyle)Int32.Parse(lstBorder.SelectedItem.Value);

// Update the picture.
if (chkPicture.Checked == true)
imgDefault.Visible = true;
imgDefault.Visible = false;

// Set the text.
lblGreeting.Text = txtGreeting.Text;

.NET Development15  

PostPosted: ASMX Web Services and XML Serialization, Missing Controls In Design View(A strange question) Top

If I create a new website,and copy and paste the code......I can see all the controls in desige view.......when I open the source code file by VS start page open website...the control will be missing in design view.........

Nathan Anderson - MSFT

PostPosted: ASMX Web Services and XML Serialization, Missing Controls In Design View(A strange question) Top

UI questions for ASP.NET are best asked at http://forums.asp.net.