如果有可能在一页中有两个ui [英] If it is possible two ui in one page

查看:72
本文介绍了如果有可能在一页中有两个ui的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ui不同于取决于客户端,但源代码在设计页面上有所不同

取决于单个表单中的webconfig键。



我的尝试:



<!DOCTYPE HTML PUBLIC - // W3C // DTD HTML 4.0 Transitional // EN>



< HTML>



< HEAD>



< title> WebForm1< / title>



< script runat =serverlanguage =C#>



private void Page_Load(object sender,System.EventArgs e)



{



Form1.Visible =!Form1.Visible;



Form2.Visible =!Form2.Visible;



}



< / script>



< ; / HEAD>



< body MS_POSITIONING =GridLayout>



< form id =Form1method =postrunat =server>



< asp:TextBox id =Textbox2runat =server> Form1



< asp:Button Runat =服务器ID =Button1NAME =Button1Text =点击查看Form2/>



< / form>



< form id =Form2method =postrunat =servervisible =false>



< asp:TextBox id =TextBox1runat =server> Form2



< asp:Button Runat =服务器ID =Button2NAME = Button2Text =点击查看Form1/>



< / form>



< / body>



< / HTML>

ui differ from depends on the client but source code is same differ in design page
depends on the webconfig key in a single form.

What I have tried:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<HTML>

<HEAD>

<title>WebForm1</title>

<script runat="server" language="C#">

private void Page_Load(object sender, System.EventArgs e)

{

Form1.Visible = !Form1.Visible;

Form2.Visible = !Form2.Visible;

}

</script>

</HEAD>

<body MS_POSITIONING="GridLayout">

<form id="Form1″ method="post" runat="server" >

<asp:TextBox id="Textbox2″ runat="server">Form1

<asp:Button Runat=server ID="Button1″ NAME="Button1″ Text="Click to see Form2″/>

</form>

<form id="Form2″ method="post" runat="server" visible="false">

<asp:TextBox id="TextBox1″ runat="server">Form2

<asp:Button Runat=server ID="Button2″ NAME="Button2″ Text="Click to see Form1″/>

</form>

</body>

</HTML>

推荐答案

当然你可以做一个不同的UI取决于设置。如果更改非常小,则只需使用if语句并隐藏或显示单个控件。如果用户界面差别很大,但你仍然想要同一个页面,那么我建议制作不同的div并将所有内容放入每个。



设置runat =server div,以便您可以在C#中引用它,然后根据您的设置隐藏并显示相应的div。
Of course you can make a different UI depending on a setting. If the changes are very small then just use an if statement and hide or show individual controls. If the UI is greatly different but you still want the same page then I suggest making different divs and putting everything into each one.

Set runat="server" on your div so that you can reference it in C# and then just hide and show the appropriate divs based on your setting.


这篇关于如果有可能在一页中有两个ui的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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