Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #21 (permalink)  
Old October 7th, 2008, 02:50 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

There's a not-too-hard way to do this, I think.

This is ASP.NET, yes? So you have one <FORM> that is always the main <FORM> on the page.

But there's no rule that says you can't create another one, by hand.

So *AFTER* the </FORM> of the main form, plunk in this code:
Code:
<FORM name="HiddenForm" method="Post">
<%
Dim fld As String
For Each fld In Request.Form
%>
    <INPUT Type=Hidden Name="<%=fld%>" Value="<%=Request.Form(fld)%>">
<%
Next
%>
</FORM>
And now you can invoke
    window.opener.document.HiddenForm.submit( );
to effectively refresh the page!

I haven't tried this with ASP.NET, only with ASP, but I keep thinking about what has to be happening under the covers, and I believe it would work.

Understand, all that fancy stuff that ASP.NET uses--viewstate and the rest--has to be sent to the browser and then sent *back* from browser to server using standard HTTP Request protocol and standard browser methodology. And browsers *ignore* IDs when it come to deciding what to send from a <FORM> posting. Only the form field *names* are utilized and sent in the POST data in the same manner as a query string:
Code:
name1=value1&name2=value2&name3=this+is+value+with+space+and+question+mark%3F
(that is, with appropriate URL encoding as needed).

So if you copy *ALL* the form fields that *GOT* you to the current page display in the browser into this hidden form, then submitting the hidden form should produce a refreshed version of this same page.

Make sense?
  #22 (permalink)  
Old October 8th, 2008, 07:45 AM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Never tried working with multiple forms, but this sounds plausible. Thanks!




Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal report Freeze detail section. dpkbahuguna Beginning VB 6 0 August 23rd, 2007 05:29 AM
Change size of the Detail section of Forms/Report sinajs Access 1 February 13th, 2007 01:05 PM
Shrink Detail section on a report TimLB Access 2 January 23rd, 2007 08:45 AM
Access Report Detail lgpatterson Access 2 January 31st, 2005 08:19 PM
Formatting Report Detail Section rickf Access 3 February 3rd, 2004 07:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.