問ASPX 轉 內容...

E+ str1 show左係個client到
如果我想將 str1 既內容清左佢
再將str2 show 去個client到咁要點先做倒


do you mean this?
this.textbox1.text = str2

?

TOP

我用html黎做output

TOP

aspx 用html 做output???
你....寫緊乜?

TOP

轉網頁....如果D STR多過100字就CUT做STRING ARRAY
開頭比ARRAY(0) 比個CLIENT機, 睇完再按一個HYPERLINK SHOW ARRAY(1)....

TOP

If i understand Cantonese maybe i can help you!

TOP

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

TOP

<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>

TOP

<%@ 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>

TOP

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!

TOP