1. Content = Replace(Content,vbcrlf,"<br>") 文本框替换回车用C#怎么写?
2. 怎么才可以用C#实现下面的代码,在Vs里面的,也就是页面吧.
<%
if Request.Cookies("test")<>"" then
%>
<table>
内容
</table>
<%
else
%>
<table>
不同的内容
</table>
<%
end if
%>
2. 怎么才可以用C#实现下面的代码,在Vs里面的,也就是页面吧.
<%
if Request.Cookies("test")<>"" then
%>
<table>
内容
</table>
<%
else
%>
<table>
不同的内容
</table>
<%
end if
%>
....
<%} else {%>
.....
<%}%>
TextBox1.Text.Replace("\n","<br/>")
TextBox1.Text.Replace(Chr(13), "<br/>")
2. 用Panel就可以。 js的话用table的style<table id="tab1">
<table id="tab2"><script>
if(str=='undefined'||nike=='')
{
tab1.style.display="none";
tab2.style.display="block";
}</script>
在.cs文件里:
if(Request.Cookies("test") != "")
{
str1 = "内容";
}
else
{
str1 = "不同的内容";
}
DataBind();在.aspx文件中
<table>
<%= str1 %>
</table>
<%} else {%><%}%>
<% = MakeTable()%>aspx.cs中代码:
protected string MakeTable()
{
string str ="";
if (Request.Cookies["userName"] != null && Request.Cookies["userName"].ToString() != string.Empty)
{
str += "<table>nnn</table>";
}
else
{
str += "<table>aaaa</table>";
}
return str;
}
然后
<%
if Request.Cookies("test")<>"" then
tableID.InnerHtml=内容1
else
tableID.InnerHtml=内容2
end if
%>