我在asp.net上写了一个带有输入表单的网站。默认网址= 172.30.0.1/Orion/Nodes/Add/Default.aspx?&restart=false。输入表格params =
<input name="ctl00$ctl00$ctl00$BodyContent$ContentPlaceHolder1$adminContentPlaceholder$HostNameIP1$txtHostNameIP" type="text" value="172.30.24.12" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ctl00$ctl00$BodyContent$ContentPlaceHolder1$adminContentPlaceholder$HostNameIP1$txtHostNameIP\',\'\')', 0)" onkeypress="if (WebForm_TextBoxKeyHandler(event) == false) return false;" id="ctl00_ctl00_ctl00_BodyContent_ContentPlaceHolder1_adminContentPlaceholder_HostNameIP1_txtHostNameIP" style="width:250px;">
现在有一个问题:我必须用URL做什么才能在输入表单(现在等于“172.30.24.12”)到“172.30.10.29”中进行更改? 网址喜欢
172.30.0.1/Orion/Nodes/Add/Default.aspx?&restart=false&ctl00$ctl00$ctl00$BodyContent$ContentPlaceHolder1$adminContentPlaceholder$HostNameIP1$txtHostNameIP='172.30.10.29'
不起作用。
答案 0 :(得分:1)
我不确定我是否完全理解您的问题,但如果您尝试传递参数并分配给输入值,请执行以下操作:
url = 172.30.0.1/Orion/Nodes/Add/Default.aspx?restart=false&ip=172.30.10.29
并在Page_Load事件中分配值:
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Load
>
> txtHostNameIP.Text = Request.QueryString("ip").ToString()
>
>End Sub
希望这个帮助