gpt4 book ai didi

主题控件中的 C# 提交按钮

转载 作者:太空宇宙 更新时间:2023-11-03 11:28:41 26 4
gpt4 key购买 nike

我在母版页中声明了一个表单:

 <form name="search" method="post" action="searchresults.aspx" id="searchform" runat="server" enableviewstate="true">

我在名为 TopicSearchTreeControl 的控件中有一个文本框,其中的文本框声明为:

 <input type="text" name="keywords" id="keywordSearch" value="Enter keyword(s) or pub. number" runat="server" class="watermark" />

但是当用户按下键盘上的 enter 键提交表单时,searchresults.aspx.cs 中的 page_load 函数被调用:

keywords = Request.Form["keywords"]; 

上面一行总是空白。

似乎是什么问题?

最佳答案

如果正在发布,Request[] 会找到它,它将搜索所有 Request 集合:

//should work
keywords = Request["keywordSearch"];

关于主题控件中的 C# 提交按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8542340/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com