Forum: ASP.NET |
Thema:
Re: Konvertieren von Windows Form nach Web Form |
Von:
Ansgar Sommer (
23.06.2005 11:52) |
Hallo Guest,
das aspx Layout
<%@ Page language="C#" Codebehind="MainDialog.aspx.cs" AutoEventWireup="false" Inherits="CSProduct_Catalog.MainDialog" %>
<HTML>
<HEAD>
<title>MainDialog</title>
<meta name="GENERATOR" Content="form.suite4.net" />
<meta name="CODE_LANGUAGE" Content="C#" />
<meta name="vs_defaultClientScript" content="JavaScript" />
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="MainDialog" method="post" runat="server">
<asp:Button id="btnClose" runat="server" Text="Close" style="font: 8pt 'Microsoft Sans Serif';color: #000000;text-align:center;vertical-align:middle;position: absolute;left:8px;top:216px;" visible="true" height="23px" width="75px" TabIndex="2" />
<div ID="groupBox1" runat="server" style="font: 8pt 'Microsoft Sans Serif';color: #000000;position: absolute;left:8px;top:64px;">
<Fieldset style="width:160px; height:144px; border:1px solid">
<legend style="font: 8pt 'Microsoft Sans Serif';color: #000000;">
Zone
</legend>
<asp:RadioButton id="radioButton4" runat="server" Text="Restricted" GroupName="groupBox1" style="font: 8pt 'Microsoft Sans Serif';color: #000000;text-align:left;vertical-align:middle;position: absolute;left:16px;top:112px;" Checked="false" Visible="true" Enabled="true" height="24px" width="104px" TabIndex="4" />
<asp:RadioButton id="radioButton2" runat="server" Text="Trusted" GroupName="groupBox1" style="font: 8pt 'Microsoft Sans Serif';color: #000000;text-align:left;vertical-align:middle;position: absolute;left:16px;top:64px;" Checked="false" Visible="true" Enabled="true" height="24px" width="104px" TabIndex="3" />
<asp:RadioButton id="radioButton3" runat="server" Text="Internet" GroupName="groupBox1" style="font: 8pt 'Microsoft Sans Serif';color: #000000;text-align:left;vertical-align:middle;position: absolute;left:16px;top:88px;" Checked="false" Visible="true" Enabled="true" height="24px" width="104px" TabIndex="2" />
<asp:RadioButton id="radioButton1" runat="server" Text="Intranet" GroupName="groupBox1" style="font: 8pt 'Microsoft Sans Serif';color: #000000;text-align:left;vertical-align:middle;position: absolute;left:16px;top:40px;" Checked="false" Visible="true" Enabled="true" height="24px" width="104px" TabIndex="1" />
<asp:RadioButton id="radioButton0" runat="server" Text="Local Machine" GroupName="groupBox1" style="font: 8pt 'Microsoft Sans Serif';color: #000000;text-align:left;vertical-align:middle;position: absolute;left:16px;top:16px;" Checked="false" Visible="true" Enabled="true" height="24px" width="104px" TabIndex="0" />
</Fieldset>
</div>
<asp:Button id="btnAdd" runat="server" Text="Add" style="font: 8pt 'Microsoft Sans Serif';color: #000000;text-align:center;vertical-align:middle;position: absolute;left:144px;top:216px;" visible="true" height="23px" width="75px" TabIndex="3" />
<asp:Label id="lblSite" runat="server" style="font: 8pt 'Microsoft Sans Serif';color: #000000;text-align: left;vertical-align: top;border:none;position: absolute;left:8px;top:8px;width:100px;height:16px;" visible="true" height="16px" width="100px">
Site pattern
</asp:Label>
<asp:TextBox id="txtPattern" runat="server" style="font: 8pt 'Microsoft Sans Serif';color: #000000;background-color: #ffffff;text-align:left;border:2 solid black;position: absolute;left:8px;top:32px;" visible="true" ReadOnly="false" height="20px" width="216px" MaxLength="32767" TextMode="SingleLine" Columns="33" TabIndex="0" />
</form>
</body>
</HTML>
bzw. als code behind
//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by form.suite4.net.
//
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------
using System;
namespace CSProduct_Catalog
{
public class MainDialog : System.Web.UI.Page
{
private bool _IsInitialized;
protected System.Web.UI.WebControls.Button btnClose;
protected System.Web.UI.WebControls.RadioButton radioButton4;
protected System.Web.UI.WebControls.RadioButton radioButton2;
protected System.Web.UI.WebControls.RadioButton radioButton3;
protected System.Web.UI.WebControls.RadioButton radioButton1;
protected System.Web.UI.WebControls.RadioButton radioButton0;
protected System.Web.UI.HtmlControls.HtmlGenericControl groupBox1;
protected System.Web.UI.WebControls.Button btnAdd;
protected System.Web.UI.WebControls.Label lblSite;
protected System.Web.UI.WebControls.TextBox txtPattern;
#region void InitializeComponent()
private void InitializeComponent()
{
#region Assign instances
this.Load += new System.EventHandler(this.Page_Load);
#endregion
} // end private void InitializeComponent()
#endregion
#region void OnInit(System.EventArgs e)
protected override void OnInit(System.EventArgs e)
{
this.InitializeComponent();
base.OnInit(e);
} // end protected override void OnInit(System.EventArgs e)
#endregion
#region void Page_Load(object sender, System.EventArgs e)
private void Page_Load(object sender, System.EventArgs e)
{
if(this._IsInitialized)
{
return;
} // end if(this._IsInitialized)
this._IsInitialized = true;
if((this.btnClose != null))
{
return;
} // end if((this.btnClose != null))
this.btnClose = new System.Web.UI.WebControls.Button();
this.radioButton4 = new System.Web.UI.WebControls.RadioButton();
this.radioButton2 = new System.Web.UI.WebControls.RadioButton();
this.radioButton3 = new System.Web.UI.WebControls.RadioButton();
this.radioButton1 = new System.Web.UI.WebControls.RadioButton();
this.radioButton0 = new System.Web.UI.WebControls.RadioButton();
this.groupBox1 = new System.Web.UI.HtmlControls.HtmlGenericControl();
this.btnAdd = new System.Web.UI.WebControls.Button();
this.lblSite = new System.Web.UI.WebControls.Label();
this.txtPattern = new System.Web.UI.WebControls.TextBox();
//
// btnClose
//
this.btnClose.Width = 75;
this.btnClose.TabIndex = 2;
this.btnClose.ID = "btnClose";
this.btnClose.Height = 23;
this.btnClose.Text = "Close";
this.btnClose.Attributes.Add("style", "font: 8pt \'Microsoft Sans Serif\';color: #000000;text-align:center;vertical-align:" + "middle;position: absolute;left:8px;top:216px;");
//
// radioButton4
//
this.radioButton4.Height = 24;
this.radioButton4.TabIndex = 4;
this.radioButton4.Width = 104;
this.radioButton4.GroupName = "groupBox1";
this.radioButton4.Text = "Restricted";
this.radioButton4.ID = "radioButton4";
this.radioButton4.Attributes.Add("style", "font: 8pt \'Microsoft Sans Serif\';color: #000000;text-align:left;vertical-align:mi" + "ddle;position: absolute;left:16px;top:112px;");
//
// radioButton2
//
this.radioButton2.Height = 24;
this.radioButton2.TabIndex = 3;
this.radioButton2.Width = 104;
this.radioButton2.GroupName = "groupBox1";
this.radioButton2.Text = "Trusted";
this.radioButton2.ID = "radioButton2";
this.radioButton2.Attributes.Add("style", "font: 8pt \'Microsoft Sans Serif\';color: #000000;text-align:left;vertical-align:mi" + "ddle;position: absolute;left:16px;top:64px;");
//
// radioButton3
//
this.radioButton3.Height = 24;
this.radioButton3.TabIndex = 2;
this.radioButton3.Width = 104;
this.radioButton3.GroupName = "groupBox1";
this.radioButton3.Text = "Internet";
this.radioButton3.ID = "radioButton3";
this.radioButton3.Attributes.Add("style", "font: 8pt \'Microsoft Sans Serif\';color: #000000;text-align:left;vertical-align:mi" + "ddle;position: absolute;left:16px;top:88px;");
//
// radioButton1
//
this.radioButton1.Height = 24;
this.radioButton1.TabIndex = 1;
this.radioButton1.Width = 104;
this.radioButton1.GroupName = "groupBox1";
this.radioButton1.Text = "Intranet";
this.radioButton1.ID = "radioButton1";
this.radioButton1.Attributes.Add("style", "font: 8pt \'Microsoft Sans Serif\';color: #000000;text-align:left;vertical-align:mi" + "ddle;position: absolute;left:16px;top:40px;");
//
// radioButton0
//
this.radioButton0.Height = 24;
this.radioButton0.Width = 104;
this.radioButton0.GroupName = "groupBox1";
this.radioButton0.Text = "Local Machine";
this.radioButton0.ID = "radioButton0";
this.radioButton0.Attributes.Add("style", "font: 8pt \'Microsoft Sans Serif\';color: #000000;text-align:left;vertical-align:mi" + "ddle;position: absolute;left:16px;top:16px;");
//
// groupBox1
//
this.groupBox1.TagName = "div";
this.groupBox1.ID = "groupBox1";
this.groupBox1.InnerHtml = "<fieldset style=\"width:160px; height:144px; border:1px solid\"><legend style=\"font" + ": 8pt \'Microsoft Sans Serif\';color: #000000;\">Zone</legend></fieldset>";
this.groupBox1.Attributes.Add("style", "font: 8pt \'Microsoft Sans Serif\';color: #000000;position: absolute;left:8px;top:6" + "4px;");
//
// btnAdd
//
this.btnAdd.Width = 75;
this.btnAdd.TabIndex = 3;
this.btnAdd.ID = "btnAdd";
this.btnAdd.Height = 23;
this.btnAdd.Text = "Add";
this.btnAdd.Attributes.Add("style", "font: 8pt \'Microsoft Sans Serif\';color: #000000;text-align:center;vertical-align:" + "middle;position: absolute;left:144px;top:216px;");
//
// lblSite
//
this.lblSite.Width = 100;
this.lblSite.ID = "lblSite";
this.lblSite.Height = 16;
this.lblSite.Text = "Site pattern";
this.lblSite.Attributes.Add("style", "font: 8pt \'Microsoft Sans Serif\';color: #000000;text-align: left;vertical-align: " + "top;border:none;position: absolute;left:8px;top:8px;width:100px;height:16px;");
//
// txtPattern
//
this.txtPattern.Height = 20;
this.txtPattern.Width = 216;
this.txtPattern.Columns = 33;
this.txtPattern.ID = "txtPattern";
this.txtPattern.MaxLength = 32767;
this.txtPattern.Attributes.Add("style", "font: 8pt \'Microsoft Sans Serif\';color: #000000;background-color: #ffffff;text-al" + "ign:left;border:2 solid black;position: absolute;left:8px;top:32px;");
//
// add controls to Page
//
this.Controls.Add(this.btnClose);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnAdd);
this.Controls.Add(this.lblSite);
this.Controls.Add(this.txtPattern);
//
// add controls to groupBox1
//
this.groupBox1.Controls.Add(this.radioButton4);
this.groupBox1.Controls.Add(this.radioButton2);
this.groupBox1.Controls.Add(this.radioButton3);
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Controls.Add(this.radioButton0);
} // end private void Page_Load(object sender, System.EventArgs e)
#endregion
} // end public class MainDialog
} // end namespace CSProduct_Catalog
hth
Gruß
Ansgar Sommer
Ansgar Sommer
Betreff |
Von |
Datum |
|
|
Re: Konvertieren von Windows Form nach Web Form
Vielen Dank! <br>Ich bekomme noch Fehlermeldungen, ich habe jetzt den ganzen code geschrieben, es wäre super, wenn Du das nochmal als Webapplikation generieren kannst.<br><br><br>using System;<br>using... |
|
|
|
|
|
G.
Guest
|
23.06.2005 13:46 |
|
|
Ansgar
Sommer
|
23.06.2005 18:28 |
|
|
Re: Konvertieren von Windows Form nach Web Form
Vielen Dank für die Mühe, aber leider der Wichtigste Teil im Code ist noch nicht konvertiert worden, schau bitt noch mal den Code was ich vorher geschrieben habe:<br><br>// constants from urlmon.h<br>public... |
|
|
|
|
|
G.
Guest
|
23.06.2005 19:09 |
|
|
Re: Konvertieren von Windows Form nach Web...
Hallo Guest,<br><br>mit der form.suite4.net wird lediglich das Layout konvertier, den rest muß Du wohl selber implementieren. Das Konzept für WebForms unterscheidet sich von dem Windows Forms wesenlich in... |
|
|
|
|
|
Ansgar
Sommer
|
23.06.2005 20:14 |
|
|
Antworten
Vorsicht bei der Eingabe: Die Zeichen ' oder -- sind nicht erlaubt!