الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

new textbox

مغلق
بدأه rozalina في 16 يوليو 2004 · 3 رد · 671 مشاهدة · في Microsoft Visual C#.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

اريد عمل new textbox

بدلمن عمل ذلك فيجوال لأني أحتاج ذلك ولكن عند التنفيذ تعطى هذه الرسالة

Server Error in '/WebApplication6' Application.

--------------------------------------------------------------------------------

Control '_ctl0' of type 'RadioButton' must be placed inside a form tag with runat=server.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Control '_ctl0' of type 'RadioButton' must be placed inside a form tag with runat=server.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Control '_ctl0' of type 'RadioButton' must be placed inside a form tag with runat=server.]

System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +152

System.Web.UI.WebControls.CheckBox.Render(HtmlTextWriter writer) +40

System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243

System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72

System.Web.UI.Control.Render(HtmlTextWriter writer) +7

System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243

System.Web.UI.Page.ProcessRequestMain() +1900

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0

#2

قومى باختيار textbox من الcontrols الموجوده!!!!!

#3

او اكتب الاتى

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace WindowsApplication9
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
  private System.Windows.Forms.TextBox textBox1;
  /// <summary>
  /// Required designer variable.
  /// </summary>
  private System.ComponentModel.Container components = null;

  public Form1()
  {
 	 //
 	 // Required for Windows Form Designer support
 	 //
 	 InitializeComponent();

 	 //
 	 // TODO: Add any constructor code after InitializeComponent call
 	 //
  }

  /// <summary>
  /// Clean up any resources being used.
  /// </summary>
  protected override void Dispose( bool disposing )
  {
 	 if( disposing )
 	 {
    if (components != null) 
    {
   	 components.Dispose();
    }
 	 }
 	 base.Dispose( disposing );
  }

  #region Windows Form Designer generated code
  /// <summary>
  /// Required method for Designer support - do not modify
  /// the contents of this method with the code editor.
  /// </summary>
  private void InitializeComponent()
  {
 	 this.textBox1 = new System.Windows.Forms.TextBox();
 	 this.SuspendLayout();
 	 // 
 	 // textBox1
 	 // 
 	 this.textBox1.Location = new System.Drawing.Point(128, 152);
 	 this.textBox1.Name = "textBox1";
 	 this.textBox1.TabIndex = 0;
 	 this.textBox1.Text = "textBox1";
 	 this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
 	 // 
 	 // Form1
 	 // 
 	 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
 	 this.ClientSize = new System.Drawing.Size(292, 266);
 	 this.Controls.AddRange(new System.Windows.Forms.Control[] {
                    this.textBox1});
 	 this.Name = "Form1";
 	 this.Text = "Form1";
 	 this.ResumeLayout(false);

  }
  #endregion

  /// <summary>
  /// The main entry point for the application.
  /// </summary>
  [STAThread]
  static void Main() 
  {
 	 Application.Run(new Form1());
  }

  private void textBox1_TextChanged(object sender, System.EventArgs e)
  {
  
  }
	}
}
#4

السلام عليكم

سؤال هل انت تعمل صفحة انترنت او برنامج لأن رسالة الخطأ تقول انك مستخدم صفحة ASP المهم

إذا كان برنامج

private System.Windows.Forms.TextBox textbox;

ثم قم بضبط الخصائص

 	 this.textBox.Location = new System.Drawing.Point(168, 40);
 	 this.textBox.Name = "textBox";
 	 this.textBox.Size = new System.Drawing.Size(24, 20);
 	 this.textBox.TabIndex = 1;
 	 this.textBox.Text = "textBox";

هذا الموضوع مغلق.

مواضيع مشابهة