Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Saturday, March 31, 2012

Submitting Data to Another Page Using ASP.NET

I need to post an ASP.NET form between sites for report processing.
Site A contains the asp.net forms and site B contains Java Servlets for
report processing.

All form fields values must be passed to the reporting servlet via http
post method. No parameters can be transmitted by URL. The report must
display in a NEW browser window. Does anyone know how to set a target
using httpwebrequest or is there another alternative?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Hi Dennis,

I've had success doing that using the Webclient class. You need to know
exactly what form field names the target expects.

Not sure about setting it to open in a new page.

Anyway, here's some code to give you an idea:

Sub DoPost()
Dim uriString As String = _
"http://localhost/p4320work/mySpecialPage.aspx"
Dim strGoName As String
strGoName = TextBox1.Text
' Create a new WebClient instance.
Dim myWebClient As New System.Net.WebClient
Dim myNameValueCollection As New _
System.Collections.Specialized.NameValueCollection
myNameValueCollection.Add("go1", strGoName)
myNameValueCollection.Add("Button1", "")
Dim responseArray As Byte() = myWebClient.UploadValues _
(uriString, "POST", myNameValueCollection)
' Response.Redirect("http://msdn.microsoft.com/")
End Sub

Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Call DoPost()
End Sub

<form id="Form1" method="post" runat="server">
<P>
<asp:TextBox id="TextBox1" runat="server">test</asp:TextBox></P>
<P>
<asp:Label id="Label1" runat="server">Label</asp:Label></P>
<P>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
</form
Ken
Microsoft MVP [ASP.NET]
Toronto

<Dennis E. Jones>; "Jr." <djone2@.jcpenney.com> wrote in message
news:e1jFoNTCFHA.520@.TK2MSFTNGP09.phx.gbl...
>I need to post an ASP.NET form between sites for report processing.
> Site A contains the asp.net forms and site B contains Java Servlets for
> report processing.
> All form fields values must be passed to the reporting servlet via http
> post method. No parameters can be transmitted by URL. The report must
> display in a NEW browser window. Does anyone know how to set a target
> using httpwebrequest or is there another alternative?
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Yes, that works...but I still need a solution for the target attribute.
Thanks for your help.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
If all you want is a submit button that opens your servlet in a new
window, .NET never comes into play:

<form action="yourServlet.jsp" target="_blank" method="post">
<input type=...>
<input type="submit">
</form
Retarget your form from the HTML side.
Jason
http://www.expatsoftware.com
If I do not use .NET, then my server controls also go away....I guess a
javascript injected into the page on postback would work, but only for
those browsers that support Javascript.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Submitting Data to Another Page Using ASP.NET

I need to post an ASP.NET form between sites for report processing.
Site A contains the asp.net forms and site B contains Java Servlets for
report processing.
All form fields values must be passed to the reporting servlet via http
post method. No parameters can be transmitted by URL. The report must
display in a NEW browser window. Does anyone know how to set a target
using httpwebrequest or is there another alternative?
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!Hi Dennis,
I've had success doing that using the Webclient class. You need to know
exactly what form field names the target expects.
Not sure about setting it to open in a new page.
Anyway, here's some code to give you an idea:
Sub DoPost()
Dim uriString As String = _
"http://localhost/p4320work/mySpecialPage.aspx"
Dim strGoName As String
strGoName = TextBox1.Text
' Create a new WebClient instance.
Dim myWebClient As New System.Net.WebClient
Dim myNameValueCollection As New _
System.Collections.Specialized.NameValueCollection
myNameValueCollection.Add("go1", strGoName)
myNameValueCollection.Add("Button1", "")
Dim responseArray As Byte() = myWebClient.UploadValues _
(uriString, "POST", myNameValueCollection)
' Response.Redirect("http://msdn.microsoft.com/")
End Sub
Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Call DoPost()
End Sub
<form id="Form1" method="post" runat="server">
<P>
<asp:TextBox id="TextBox1" runat="server">test</asp:TextBox></P>
<P>
<asp:Label id="Label1" runat="server">Label</asp:Label></P>
<P>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
</form>
Ken
Microsoft MVP [ASP.NET]
Toronto
<Dennis E. Jones>; "Jr." <djone2@.jcpenney.com> wrote in message
news:e1jFoNTCFHA.520@.TK2MSFTNGP09.phx.gbl...
>I need to post an ASP.NET form between sites for report processing.
> Site A contains the asp.net forms and site B contains Java Servlets for
> report processing.
> All form fields values must be passed to the reporting servlet via http
> post method. No parameters can be transmitted by URL. The report must
> display in a NEW browser window. Does anyone know how to set a target
> using httpwebrequest or is there another alternative?
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
Yes, that works...but I still need a solution for the target attribute.
Thanks for your help.
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
If I do not use .NET, then my server controls also go away....I guess a
javascript injected into the page on postback would work, but only for
those browsers that support Javascript.
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!

Thursday, March 22, 2012

support language

sir
is .net support java ?
thanks"sachin_himcs" <sachin_himcs.26v5tp@.mail.codecomments.com> wrote in message
news:sachin_himcs.26v5tp@.mail.codecomments.com...

> is .net support java ?
What do you actually mean?
sir
I want to know that
..net support many language .is java one of them language.
Microsoft's J# is supported, yes. Otherwise it isn't actually about MS, but
if a compiler is written for the specific language which emits CLS-compliant
MSIL. So basically if someone has written .NET compiler for full-blown Java,
then yes
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"sachin_himcs" <sachin_himcs.270ptp@.mail.codecomments.com> wrote in message
news:sachin_himcs.270ptp@.mail.codecomments.com...
> sir
> I want to know that
> ..net support many language .is java one of them language.
>
> --
> sachin_himcs
> ---
> Posted via http://www.codecomments.com
> ---
>

support language

sir

is .net support java ?

thanks

--
sachin_himcs
----------------------
Posted via http://www.codecomments.com
----------------------"sachin_himcs" <sachin_himcs.26v5tp@.mail.codecomments.com> wrote in message
news:sachin_himcs.26v5tp@.mail.codecomments.com...

> is .net support java ?

What do you actually mean?

support language

sir

I want to know that
...net support many language .is java one of them language.

--
sachin_himcs
----------------------
Posted via http://www.codecomments.com
----------------------Microsoft's J# is supported, yes. Otherwise it isn't actually about MS, but
if a compiler is written for the specific language which emits CLS-compliant
MSIL. So basically if someone has written .NET compiler for full-blown Java,
then yes

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"sachin_himcs" <sachin_himcs.270ptp@.mail.codecomments.com> wrote in message
news:sachin_himcs.270ptp@.mail.codecomments.com...
> sir
> I want to know that
> ..net support many language .is java one of them language.
>
> --
> sachin_himcs
> ----------------------
> Posted via http://www.codecomments.com
> ----------------------