大大們好 小弟是VB新手 目前遇到的問題是如何在html語法內加入sql語法讀取資料
html:
function imgAd(){
adadd_initial();
$("#t_ad1").html("<textarea name='ad' cols='38' rows='5' style='width:400px'></textarea>");
}
例如向下列語法將value撈出來
<%
PageUrl = "?Action="&Action
Sql="Select * From UpFile Where AdUserName='"&AdUserName&"' Order By AddTime Desc"
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.open Sql,Conn,1,1
Response.write ":<input id='img"&Rs("ID")&"' type='text' value='"&AdPath&"upload/"&Rs("FileName")&"' size='40' >"
Rs.Close()
%>
恩..
傳統 asp 網頁架構..
不過不知道是要做甚麼的
來猜猜~
<script>
function imgAd(){
adadd_initial();
$("#t_ad1").html("<textarea id='ad' name='ad' cols='38' rows='5' style='width:400px'></textarea>");
}
</script>
<%
Sql="Select ad_Txt From ad "
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.open Sql,Conn,1,1
if not rs.eof then
%>
<script>
var ad = document.getElementById("ad");
if(ad!=null){ad.value="<%=Rs("ad_Txt")%>";}
</script>
<%
end if
Rs.Close()
%>
<%
PageUrl = "?Action="&Action
Sql="Select * From UpFile Where AdUserName='"&AdUserName&"' Order By AddTime Desc"
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.open Sql,Conn,1,1
if not rs.eof then
ImgID = "img" & Rs("ID")
Response.write ":<input id='img" & Rs("ID") & "' type='text' value='"&AdPath&"upload/"&Rs("FileName")&"' size='40' >"
end if
Rs.Close()
%>
<script>
var ImgShow = document.getElementById("<%=ImgID%>");
if(ImgShow!=null){alert(ImgShow.value);}
</script>
為何不使用ASP.NET runat SERVER ?
GET
dim textareadata = Request.QueryString("ad")
POST
dim textareadata = Request.Form("ad")