我在aspx頁面中有一個小表單。該表單在jQuery對話框中呈現。我在這個對話框中放置了兩個按鈕(jQuery按鈕)。由於這些都不是一個aspx按鈕我不得不手動做回發當按下一個jQuery對話框按鈕,像這樣:無法從代碼隱藏中獲取asp.net textfield
對話框:
jQuery(function() {
var dlg = $('#dialog_renombrar').dialog({
autoOpen: false,
resizable: false,
modal: true,
width: 360,
buttons: {
"Aceptar": function() {
__doPostBack('rnmbrFchr', null);
},
"Cancelar": function() {
$(this).dialog("close");
}
}
});
形式:
<div
align="center"
id="dialog_renombrar"
style="padding: 10px 10px 10px 10px;
margin: 10px 10px 10px 10px;
width:100%;
height:100%;
display:none;
overflow:auto">
<table
cellspacing="2"
width="100%"
align="center">
<tr>
<td>
Documento:
</td>
<td>
<asp:TextBox
ID="nombre_antiguo"
Enabled="false"
style="width:100%;"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Nuevo nombre:
</td>
<td>
<cc1:SWCTextBox
ID="SWCTextBox3"
MarcarObligatorio="true"
style="width:100%; height:90%"
runat="server"></cc1:SWCTextBox>
<asp:HiddenField runat="server" ID="itemkey" />
</td>
</tr>
</table>
</div>
然後在執行回發的代碼隱藏中,我無法訪問文本字段。不能這樣做:
Request.Forms["SWCTextField3"]
值和即時對象都不可見。
我需要幫助。謝謝。
爲什麼不通過AJAX做文章,如果你已經在使用jQuery了。將數據發佈到頁面方法。 – 2011-05-25 14:36:00
@Akram你可能想要改變你的評論,它相當苛刻。 – 2011-05-25 14:36:20
我想但我必須做回傳。 – antoni 2011-05-25 14:37:53