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

B

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
 
V

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','');
}
 
V

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top