开发者

Using an HTML Textbox in place of an ASP.NET TextBox

开发者 https://www.devze.com 2022-12-25 21:02 出处:网络
If I ad开发者_如何学Pythond this to the ASPX page: <input id=\"Text1\" type=\"text\" value=\"Text1Value\" />

If I ad开发者_如何学Pythond this to the ASPX page:

<input id="Text1" type="text" value="Text1Value" />

I would expect to see "Text1" in the list of Request Form keys even WITHOUT setting the runat=Server property.

? request.Form.AllKeys

I realize that if I do set that propery, then I will have a server-sided HTML control that I can reference using the name "Text1", but shouldn't I be able to access the text in the text box using the following VB.NET syntax?

request.Form("Text1")


Because you need to add the name attribute. Try this

<input id="Text1" name="Text1" type="text" value="Text1Value" />


The textbox on page1.aspx is available in teh Request.Forms collection on Page2 when posting from 2 to 1.

But, when using a ASP.NET button to postback to Page1, it seems not to be. Dunno why yet...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号