做了一個查詢的功能。我用string id,因為我要用默認(rèn)的路由。[ValidateInput(false)]public ActionResult Search(string id){}==>>如果我用post:<form method="post" action="/tag/search/"> <input type="text" id="id" name="id" /> <input type="submit" value="查詢" /></form>比如用戶輸入“你好”后,雖然能正常查詢出數(shù)據(jù),但是URL地址不會路由到 /tag/search/你好 如果我用get:<form method="get" action="/tag/search/"><input type="text" id="id" name="id" /><input type="submit" value="查詢" /></form>產(chǎn)生的URL地址是: /tag/search/?id=你好, 這時如果直接在地址欄中敲入/tag/search?id=你好 或者 /tag/search/你好 ,這樣的都能訪問,也都能取到數(shù)據(jù),這樣就造成一個內(nèi)容多個地址的問題,對SEO不好。 所以這個問題該怎么解決?
- 1 回答
- 0 關(guān)注
- 403 瀏覽
添加回答
舉報
0/150
提交
取消