Call a javascript when i call an aspx page with a form html not running on server
Call a javascript when i call an aspx page with a form html not running on server
am 25.01.2008 18:16:22 von Fabio Mastria
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
Re: Call a javascript when i call an aspx page with a form html not running on server
am 25.01.2008 18:32:02 von Patrice
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='MyValue' 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-A2BA4989C0F1@microsoft.com...
> 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
Re: Call a javascript when i call an aspx page with a form html not running on server
am 25.01.2008 18:41:31 von Patrice
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" a écrit dans le message de news:
ukji0g3XIHA.484@TK2MSFTNGP06.phx.gbl...
> 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='MyValue' 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-A2BA4989C0F1@microsoft.com...
>> 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
>
>
RE: Call a javascript when i call an aspx page with a form html not ru
am 25.01.2008 19:10:00 von adwb
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
>
>
Re: Call a javascript when i call an aspx page with a form html not running on server
am 28.01.2008 10:05:14 von Fabio Mastria
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
method="post" >
hiddenfield1
hiddenfield2
....
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?