Ⅰ 如何用vb.net上傳post數據給伺服器
圖有點模糊。
伺服器端要有方法接收,接收的參數要看方法的定義。
Controller A裡面假設有這個get Action
<httppost>
function get(frm as formcollection) as actionresult
dim a as string=frm("keyword")
return content(a)
end function
頁面View 中
@Using FormBegin("get","A","POST")
@<div>
<input name="keyword" type="text"/>
<Input type="submit" value="提交"/>
end using
你在頁面上點擊按鈕「提交」後,就會把表單的中keyword文本框的內容賦值給a.
這里我用的是MVC..前端用的VB Razor.