作者: AlexAu 時間: 2008-11-6 13:11 標題: 問ASPX 轉 內容...
E+ str1 show左係個client到
如果我想將 str1 既內容清左佢
再將str2 show 去個client到咁要點先做倒
作者: alphaau 時間: 2008-11-6 15:22
do you mean this?
this.textbox1.text = str2
?
作者: AlexAu 時間: 2008-11-6 16:35
我用html黎做output
作者: alphaau 時間: 2008-11-6 16:38
aspx 用html 做output???
你....寫緊乜?
作者: AlexAu 時間: 2008-11-6 18:58
轉網頁....如果D STR多過100字就CUT做STRING ARRAY
開頭比ARRAY(0) 比個CLIENT機, 睇完再按一個HYPERLINK SHOW ARRAY(1)....

作者: freewave 時間: 2008-11-6 19:22
If i understand Cantonese maybe i can help you!
作者: AlexAu 時間: 2008-11-6 19:43
to be more simple:
<%
dim str1 as string = "aaaa"
dim str2 as string = "bbbb"
%>
<html><body>
<%=str1%>
<a href>click here to show str2</a>
</body></html>
how to use the hyperlink to switch between str1 and str2
作者: freewave 時間: 2008-11-6 20:01
<html>
<script language="javascript">
var str1 = "hello world";
var str2 = "hello hongkong";
function swap(sender) {
if (sender.innerText == str1)
sender.innerText = str2;
else
sender.innerText = str1;
}
</script>
<a onclick="swap(this)" href="#">hello world</a>
</html>
作者: freewave 時間: 2008-11-6 20:16
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebControlTest.WebForm2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<script runat="server" language="c#">
string str1 = "hello world";
string str2 = "hello hongkong";
public void OnSwapLinkClick(object sender, EventArgs args)
{
LinkButton link = sender as LinkButton;
if (link.Text == str1)
link.Text = str2;
else
link.Text = str1;
}
</script>
<body>
<form id="form1" runat="server">
<div>
<asp:LinkButton ID="swapLink" runat="server" OnClick="OnSwapLinkClick" Text="<% str1 %>" />
</div>
</form>
</body>
</html>
作者: freewave 時間: 2008-11-6 20:18
The first sample is with no postback. you can render the html in server side.
The second sample is with post back.
Hope this helps you!
作者: AlexAu 時間: 2008-11-6 21:50
is it possible to show
hello world
linkbutton to change hello world to abc
作者: freewave 時間: 2008-11-7 08:40
The samples above show how to do. but what to do.
you can change the text as you want.
作者: AlexAu 時間: 2008-11-7 18:12
THX A LOT BRO
