Home All Groups Group Topic Archive Search About

How to collect the data from input created by document.write() in ASP.NET?

Author
21 Dec 2006 3:22 PM
BP
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

Author
21 Dec 2006 4:27 PM
vbnetdev
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
>
>
>
Author
21 Dec 2006 4:44 PM
vbnetdev
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
>
>
>