|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to collect the data from input created by document.write() in ASP.NET?if the input field was generated in Client-side Javascript by
document.write, how to retrieve the data of the input field in code behind? Thanks See if this gets you started down the right path....
<A href="javascript:SendMail();">Send Mail</A> <asp:linkbutton id=SendMail runat="server"></asp:linkbutton> <script language="javascript"> function SendMail() { // save the values of the hidden variables from page A // to the hidden variables in page B // then call a postback with the id of our SendMail link button __doPostBack('SendMail',''); } Show quoteHide quote "BP" <blackplan***@hotmail.com> wrote in message news:u5smVPRJHHA.780@TK2MSFTNGP03.phx.gbl... > if the input field was generated in Client-side Javascript by > document.write, how to retrieve the data of the input field in code > behind? > > Thanks > > > my bad....I misread your post.
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> Private Function __doPostBack(ByValeventTarget, ByValeventArgument) As function If Not theForm.onsubmit ||(theForm.onsubmit() <> False) Then theForm.__EVENTTARGET.value = eventTarget theForm.__EVENTARGUMENT.value = eventArgument theForm.submit() End If End Function Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Dim controlName As String = Request.Params.Get("__EVENTTARGET") End Sub Show quoteHide quote "BP" <blackplan***@hotmail.com> wrote in message news:u5smVPRJHHA.780@TK2MSFTNGP03.phx.gbl... > if the input field was generated in Client-side Javascript by > document.write, how to retrieve the data of the input field in code > behind? > > Thanks > > > |
|||||||||||||||||||||||