Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Call a javascript when i call an aspx page with a form html not running on server

Reply
Thread Tools

Call a javascript when i call an aspx page with a form html not running on server

 
 
Fabio Mastria
Guest
Posts: n/a
 
      01-25-2008
My application has to call a webpage with some hidden field, fill their
values with some parameters and then call the submit to the form which has
the action property set to a page of another web application.

all of this, did via javascript.

how can i send the data to fill the hidden fields to this web form?

Please help me, thank you!
Fabio

 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      01-25-2008
Not sure what is the particular problem. The simplest would be to create the
page server side with those hidden fields already filled with values. If you
have to get them from client side inputs you could use
getElementById('MyClientSideControlID').value='MyV alue' to fill the value of
a field form. The "form.submit" method allows to programmatically submit the
form...

My personal preference would be likely to do that server side using
System.Net.WebClient (it allows to send a POST query with form values to a
particular target page and get the response).

If you prfer doing still cleint side, you may want to be a bit more specific
about the exact point that causes the problem (not sure if it's filling the
hidden fields, submitting the data or whatever else...)


--
Patrice

"Fabio Mastria" <> a écrit dans le message de
news: F9063969-6616-46FA-82EF-...
> My application has to call a webpage with some hidden field, fill their
> values with some parameters and then call the submit to the form which has
> the action property set to a page of another web application.
>
> all of this, did via javascript.
>
> how can i send the data to fill the hidden fields to this web form?
>
> Please help me, thank you!
> Fabio



 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      01-25-2008
Ah. If I finally understood the page that contains those hidden fields is
not yours.

Your application must submit to this page values as if they were coming from
those hidden fields...You'll have then to send a request to this page with
the same field names (either by "reproducting" this page client side or by
sending a request server side by using System.Net.WebClient).

Note though that the page that contains those hidden fields could also
perform additional checks to see if data are coming from itself instead from
an external source (i.e. in most cases the site owner should document how to
do this, else it could be even not possible if the appropriate safety
measures have been implemented to prevent this).

--
Patrice

"Patrice" <http://www.chez.com/scribe/> a écrit dans le message de news:
...
> Not sure what is the particular problem. The simplest would be to create
> the page server side with those hidden fields already filled with values.
> If you have to get them from client side inputs you could use
> getElementById('MyClientSideControlID').value='MyV alue' to fill the value
> of a field form. The "form.submit" method allows to programmatically
> submit the form...
>
> My personal preference would be likely to do that server side using
> System.Net.WebClient (it allows to send a POST query with form values to a
> particular target page and get the response).
>
> If you prfer doing still cleint side, you may want to be a bit more
> specific about the exact point that causes the problem (not sure if it's
> filling the hidden fields, submitting the data or whatever else...)
>
>
> --
> Patrice
>
> "Fabio Mastria" <> a écrit dans le message
> de news: F9063969-6616-46FA-82EF-...
>> My application has to call a webpage with some hidden field, fill their
>> values with some parameters and then call the submit to the form which
>> has the action property set to a page of another web application.
>>
>> all of this, did via javascript.
>>
>> how can i send the data to fill the hidden fields to this web form?
>>
>> Please help me, thank you!
>> Fabio

>
>



 
Reply With Quote
 
adwb
Guest
Posts: n/a
 
      01-25-2008
What type of application are you writing? Is it an ASP.NET app running on
your server that users will interact with to fill form fields and submit a
form on a page running on another server?

"Fabio Mastria" wrote:

> My application has to call a webpage with some hidden field, fill their
> values with some parameters and then call the submit to the form which has
> the action property set to a page of another web application.
>
> all of this, did via javascript.
>
> how can i send the data to fill the hidden fields to this web form?
>
> Please help me, thank you!
> Fabio
>
>

 
Reply With Quote
 
Fabio Mastria
Guest
Posts: n/a
 
      01-28-2008
adwb wrote:
> What type of application are you writing? Is it an ASP.NET app
> running on your server that users will interact with to fill form
> fields and submit a form on a page running on another server?
>


asp.net web application.

Patrice wrote:
> Ah. If I finally understood the page that contains those hidden
> fields is not yours.


The page with the hidden fields, is in my application.

this page has to be submitted to another page which is not in my
application.

After some operation, i have to call my page, fill the hidden fields and
submit via post the form to that page which is not in my application.

My page sounds like

<form id="form1" action=www.notmyapplication.com/notmypage.aspx
method="post" >

hiddenfield1

hiddenfield2

....

</form>

the notmypage read the hiddens, and call a page in my application with some
value to read via Request object.

That's it.

A question: can I use a server form with action and method using then a
server button which submit the form? This to send post to the
notmypage.aspx...

In this case, I can fill via server side the hiddend fields values..



> Your application must submit to this page values as if they were
> coming from those hidden fields...You'll have then to send a request
> to this page with the same field names (either by "reproducting" this
> page client side or by sending a request server side by using
> System.Net.WebClient).



sorry I don't know how to use the webclient class, have you some example?



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When JavaScript is disabled, do not display HTML form and form elements patricksabourin@hotmail.com Javascript 5 08-10-2006 05:32 AM
Syntax for call from aspx page to .cs file then to different aspx page MadHatter51 ASP .Net 1 05-17-2006 10:43 AM
Help: Call an ASPX page from a main ASPX page Progman ASP .Net 2 02-13-2006 01:39 AM
adding main.aspx.vb & main.aspx.resx under aspx John M ASP .Net 1 05-29-2005 09:27 PM
include other aspx/html in my aspx page Mr. x ASP .Net 1 11-30-2003 11:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57