Accessing ASP.net control in [Ajax.JavascriptMethod()]
-
Hi. On a button click i'm opening a page with showModalDialog, depending on the value returned from modal dialog, i want to clear contents of asp.net controls. These controls are read only controls. But i'm unable to clear the controls. Please guide me how to resolve this issue. Thanks in Advance.
-
Hi. On a button click i'm opening a page with showModalDialog, depending on the value returned from modal dialog, i want to clear contents of asp.net controls. These controls are read only controls. But i'm unable to clear the controls. Please guide me how to resolve this issue. Thanks in Advance.
Find the element on the page via JavaScript and clear it appropriately
document.GetElementById("somecontrol").value = "";
of JQuery$("#somecontrol").val("");
I know the language. I've read a book. - _Madmatt
-
Find the element on the page via JavaScript and clear it appropriately
document.GetElementById("somecontrol").value = "";
of JQuery$("#somecontrol").val("");
I know the language. I've read a book. - _Madmatt
Hi.Thanks for you reply.
document.GetElementById("somecontrol").value = "";
this code is valid,but in my case i'm unable to do it,var URL = 'AddParticipant.aspx?Id='+EventId+'; retVal = showModalDialog(URL, false, "dialogHeight:700px;dialogWidth:900px;scroll:yes;");
I'm able to retrieve the value well. after that i wrote followingdocument.getElementById("<%=txtOrderNo.ClientID%>;").value="";
But i'm unable to clear the content. and the textbox is readonly, and the page is in side updatepanel. Does it have anything to do.. Thanks again -
Hi.Thanks for you reply.
document.GetElementById("somecontrol").value = "";
this code is valid,but in my case i'm unable to do it,var URL = 'AddParticipant.aspx?Id='+EventId+'; retVal = showModalDialog(URL, false, "dialogHeight:700px;dialogWidth:900px;scroll:yes;");
I'm able to retrieve the value well. after that i wrote followingdocument.getElementById("<%=txtOrderNo.ClientID%>;").value="";
But i'm unable to clear the content. and the textbox is readonly, and the page is in side updatepanel. Does it have anything to do.. Thanks againRemove the semicolon after the binding expression
document.getElementById("<%=txtOrderNo.ClientID%>;").value="";
it should be thisdocument.getElementById("<%=txtOrderNo.ClientID%>").value="";
The former is adding the semicolon to the id which of course can't be found in the dom.
I know the language. I've read a book. - _Madmatt