我如何运行两个组件 [英] How do I run the two component

查看:57
本文介绍了我如何运行两个组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我有一个文件组件/Web服务器控件



如何运行两次?

文件同时如何工作?
请帮助我

谢谢

http://www.imageupload.org/?d=9896BA1B1 [ http://www.imageupload.org/?d=3A01125C1 [ http://hotfile.com/dl/135573461/78067f0/ServerControl1.rar.html [ ^ ]
代码




hello ,I have my one file component / web server controll



How can I run two times?

file at the same time how does it work?
please help me

thank you

http://www.imageupload.org/?d=9896BA1B1[^]

http://www.imageupload.org/?d=3A01125C1[^]

project download
http://hotfile.com/dl/135573461/78067f0/ServerControl1.rar.html[^]
code




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using DevExpress.Web.ASPxEditors;
using DevExpress.Web.ASPxSplitter;
using Chaos.Common;
using Microsoft.JScript;

namespace ServerControl1
{
    [DefaultProperty("Text")]
    [ToolboxData("<{0}:Server  runat="server">")]
    public class Server : DevExpress.Web.ASPxClasses.ASPxWebControl
    {

        public string ClientInstanceName = String.Empty;
 
        protected override void RenderContents(HtmlTextWriter writer)
        {
            if (!DesignMode)
            {
                writer.Write("<script  id=\"dxis_BingMap\" src=\"http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0\" type=\"text/javascript\"></script>");
            }
            base.RenderContents(writer);
        }

        private object obj = null;
        protected internal const string ScriptsResourcePath = "ServerControl1.scripts.";
        protected internal const string ControlXScriptResourceName1 = ScriptsResourcePath + "CharacterControll.js ";
        protected internal const string ControlXScriptResourceName2 = ScriptsResourcePath + "FindLocation.js";
        protected internal const string ControlXScriptResourceName3 = ScriptsResourcePath + "GetMap.js";
        

        protected override void OnInit(EventArgs e)
        {
            if (string.IsNullOrEmpty(ClientInstanceName)) ClientInstanceName = ID;
            EnableClientSideAPIInternal = true;
            base.OnInit(e);
        }

        protected override void CreateChildControls()
        {


            if (DesignMode) { base.CreateChildControls(); return; }
            if (!Utility.isForMe(ClientInstanceName)) return;
            //labels "name identification"
            string LabelxName = string.Format("{0}_Labelx", ClientInstanceName); // Latitude
            string LabelyName = string.Format("{0}_Labely", ClientInstanceName); // Longitude
            string LabelzName = string.Format("{0}_Labelz", ClientInstanceName); // Zoom

            // AspxButtons "name identification"
            string BtnSearchName = string.Format("{0}_search", ClientInstanceName);

            // Divs "name identification"
            string MapDivname = string.Format("{0}_mapDiv", ClientInstanceName);
            string ResultDivName = string.Format("{0}_resultDiv", ClientInstanceName);

            //Splitters "name identification"
            string SplitterName = string.Format("{0}_Splitter", ClientInstanceName);

             //TextBox " name identification"
            string TextBoxXName = string.Format("{0}_TextBoxX", ClientInstanceName);
            string TextBoxYName = string.Format("{0}_TextBoxY", ClientInstanceName);
            string TextBoxZName = string.Format("{0}_TextBoxZ", ClientInstanceName);
            string TextBoxSearchName = string.Format("{0}_TextBoxSearch", ClientInstanceName);
          
            // Tables " name identification"
            string TableName1 = string.Format("{0}_Table1", ClientInstanceName);
            string TableName2 = string.Format("{0}_Table2", ClientInstanceName);
            string TableName3 = string.Format("{0}_Table3", ClientInstanceName);

            // DIV CREATE
            Panel Mapdiv = new Panel();
            Mapdiv.ID = "mapDiv";
            Mapdiv.ClientIDMode = System.Web.UI.ClientIDMode.Static;
            Mapdiv.Height = 580;
            Mapdiv.Width = 1600;
            Mapdiv.Style.Add(HtmlTextWriterStyle.Position, "relative");

            Panel TopDiv = new Panel();
            TopDiv.ID = "resultDiv";
            TopDiv.ClientIDMode = System.Web.UI.ClientIDMode.Static;
            TopDiv.Height = 580;
            TopDiv.Width = 260;
  

     
            ASPxLabel x = new ASPxLabel();
            x.Text = " Latitude";
            x.Font.Bold = true;
            x.Font.Size = 12;
            x.Width = 15;
            x.Height = 20;
            x.ForeColor = System.Drawing.Color.Blue;
            x.ID = LabelxName;

            ASPxLabel y = new ASPxLabel();
            y.Text = " Longitude";
            y.Font.Bold = true;
            y.Font.Size = 12;
            y.Width = 15;
            y.Height = 20;
            y.ForeColor = System.Drawing.Color.Blue;
            y.ID = LabelyName;

            ASPxLabel z = new ASPxLabel();
            z.Text = " Zoom";
            z.Font.Bold = true;
            z.Font.Size = 12;
            z.Width = 15;
            z.Height = 20;
            z.ForeColor = System.Drawing.Color.Blue;
            z.ID =  LabelzName;

            // ASPxTextBox SEARCH CREATE
            ASPxButtonEdit TextBoxSearchAdress = new ASPxButtonEdit();
            TextBoxSearchAdress.Width = 260;
            TextBoxSearchAdress.Height = 36;
            TextBoxSearchAdress.BorderStyle = BorderStyle.Solid;
            TextBoxSearchAdress.Font.Bold = true;
            TextBoxSearchAdress.Font.Size = 15;
            TextBoxSearchAdress.ClientInstanceName = "ara";
            TextBoxSearchAdress.ID = TextBoxSearchAdress.ClientInstanceName = TextBoxSearchName;


            // ASPxTextBox LATITUDE CREATE X
            ASPxButtonEdit TextBoxX = new ASPxButtonEdit();
            TextBoxX.Width = 150;
            TextBoxX.Height = 36;
            TextBoxX.Font.Bold = true;
            TextBoxX.BorderStyle = BorderStyle.Solid;
            TextBoxX.Text = "LatitudeX";
            TextBoxX.ClientInstanceName = "TextBoxX";
            TextBoxX.ID = TextBoxX.ClientInstanceName = TextBoxXName;


            // ASPxTextBox LONGITUDE CREATE   Y
            ASPxButtonEdit TextBoxY = new ASPxButtonEdit();

            TextBoxY.Width = 150;
            TextBoxY.Height = 36;
            TextBoxY.Font.Bold = true;
            TextBoxY.BorderStyle = BorderStyle.Solid;
            TextBoxY.Text = "LongitudeY";
            TextBoxY.ClientInstanceName = "TextBoxY";
            TextBoxY.ID = TextBoxX.ClientInstanceName = TextBoxYName;

            // ASPxTextBox ZOOM CREATE
            ASPxButtonEdit TextBoxZ = new ASPxButtonEdit();
            TextBoxZ.Width = 150;
            TextBoxZ.Height = 36;
            TextBoxZ.Font.Bold = true;
            TextBoxZ.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid;
            TextBoxZ.ClientInstanceName = "TextBoxZ";
            TextBoxZ.ID = TextBoxX.ClientInstanceName = TextBoxZName;


          

            

            // SPLITTER CREATE
            ASPxSplitter Splitter = new ASPxSplitter();
            Splitter.Panes.Add("splitter1");
            Splitter.Panes.Add("splitter2");
            Splitter.Height = 600;
            Splitter.Width = 1650;

            Splitter.Panes["splitter1"].MaxSize = 220;
            Splitter.Panes["splitter1"].Controls.Add(TopDiv);
            Splitter.Panes["splitter2"].Controls.Add(Mapdiv);
            Splitter.ClientInstanceName = "Splitter";
            Splitter.ID = Splitter.ClientInstanceName = SplitterName;
 
 

 
 

            //// ASPX BUTTON CREATE
            ASPxButton AspxSearchButton = new ASPxButton();
            AspxSearchButton.Width = 174;
            AspxSearchButton.Height = 36;
            AspxSearchButton.AutoPostBack = false;
            AspxSearchButton.ID =AspxSearchButton.ClientInstanceName = BtnSearchName;
            AspxSearchButton.ClientSideEvents.Click = "function (s,e) {{ kontrol(); }}";
            Table tabledown = new Table();
            tabledown.ID = "Table1";
            TableRow satir2 = new TableRow();
            tabledown.Rows.Add(satir2);
            TableCell h1 = new TableCell();
            h1.Controls.Add(TextBoxSearchAdress);
            TableCell h2 = new TableCell();
            h2.Controls.Add(AspxSearchButton);
            satir2.Cells.Add(h1);
            satir2.Cells.Add(h2);
            Table tableup = new Table();
            TableRow satir1 = new TableRow();
            tableup.Rows.Add(satir1);
            //hucre1
            TableCell hucre1 = new TableCell();
            hucre1.Controls.Add(x);
            hucre1.Controls.Add(TextBoxX);
            //hucre2
            TableCell hucre2 = new TableCell();
            hucre2.Controls.Add(y);
            hucre2.Controls.Add(TextBoxY);
            //hucre3
            TableCell hucre3 = new TableCell();
            hucre3.Controls.Add(z);
            hucre3.Controls.Add(TextBoxZ);

            satir1.Cells.Add(hucre1);
            satir1.Cells.Add(hucre2);
            satir1.Cells.Add(hucre3);



            // TABLE CREAT  Rows1
            Table MyTable = new Table();
            MyTable.ID = "Table2";
            TableRow Rows1 = new TableRow();
            MyTable.Rows.Add(Rows1);
            TableCell Colomns1 = new TableCell();
            Colomns1.Controls.Add(tabledown);

            Colomns1.BorderStyle = BorderStyle.Solid;
            Colomns1.BackColor = System.Drawing.Color.White;
            Colomns1.ForeColor = System.Drawing.Color.Black;
            Rows1.Cells.Add(Colomns1);



            // TABLE CREAT  Rows2

            TableRow Rows2 = new TableRow();
            MyTable.Rows.Add(Rows2);
            TableCell Colomns2 = new TableCell();
            Colomns2.Controls.Add(Splitter);
            Colomns2.BorderStyle = BorderStyle.Solid;
            Colomns2.BackColor = System.Drawing.Color.White;
            Colomns2.ForeColor = System.Drawing.Color.Black;
            Rows2.Cells.Add(Colomns2);

            // TABLE CREAT  Rows3

            TableRow Rows3 = new TableRow();
            Rows3.ID = "Table3";
            MyTable.Rows.Add(Rows3);
            TableCell Colomns3 = new TableCell();

            Colomns3.BorderStyle = BorderStyle.Solid;
            Colomns3.BackColor = System.Drawing.Color.White;
            Colomns3.ForeColor = System.Drawing.Color.Black;
            Colomns3.Controls.Add(tableup);

            Rows3.Cells.Add(Colomns3);



            Controls.Add(MyTable);
            base.CreateChildControls();
        }
        protected override void RegisterIncludeScripts()
        {
             
            RegisterScriptBlock("dxis_ControlXJs1", Utility.GetIncludeJScript(typeof(ServerControl1.Server), "ControlXJs1", ControlXScriptResourceName1));
            RegisterScriptBlock("dxis_ControlXJs2", Utility.GetIncludeJScript(typeof(ServerControl1.Server), "ControlXJs2", ControlXScriptResourceName2));
            RegisterScriptBlock("dxis_ControlXJs3", Utility.GetIncludeJScript(typeof(ServerControl1.Server), "ControlXJs3", ControlXScriptResourceName3));

            base.RegisterIncludeScripts();
        }
    }
}




链接正在嵌入超链接[/编辑]
代码已包装在"pre"标记中.[/Edited]




Link is embedding for Hyperlink[/Edited]
Code is wrapped in "pre" Tag[/Edited]

推荐答案

您可以将任何项目或文件都作为输入项目或文件,但不能同时执行这两个项目或文件在同一时间.尝试两次执行两次..
you can make any project or file as the entry project or file but cannot execute the both at same time. try executing both 2 times ..


这篇关于我如何运行两个组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆