Showing posts with label forms. Show all posts
Showing posts with label forms. 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!

Monday, March 26, 2012

Suggestion please..

I have a scenario, need your suggestion..
Our clients are already using the forms authentication where we check the
User/Pwd from SQL svr Database. We also have some SETTINGS for the user save
d
in the database(helps us to restrict the user access some things) .
We wanted to implement AD authentication for the same and also keep the
existing SQL SVr User DB.
My Q would be how to MAP the LDAP user to the SQL svr User, so we can get
the SETTINGS defined for the user in the SQL svr Database.
Any suggestion is appreciated..
Thanks
Vinay
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
--_,>/'_--
(_) \(_)
--Following URL maybe is helpful:
http://msdn.microsoft.com/library/d...
d16.asp
Elton Wang
"vinay" wrote:

> I have a scenario, need your suggestion..
> Our clients are already using the forms authentication where we check the
> User/Pwd from SQL svr Database. We also have some SETTINGS for the user sa
ved
> in the database(helps us to restrict the user access some things) .
> We wanted to implement AD authentication for the same and also keep the
> existing SQL SVr User DB.
> My Q would be how to MAP the LDAP user to the SQL svr User, so we can get
> the SETTINGS defined for the user in the SQL svr Database.
> Any suggestion is appreciated..
> Thanks
> Vinay
> --
> http://pathidotnet.blogspot.com
> =====
> vInAypAtHi
> o__
> --_,>/'_--
> (_) \(_)
> --
Elton
Thanks for the link, i have done the LDAP authentication already.
I am looking for a way to link the LDAP user to the existing SQL svr user.
Thanks
--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
--_,>/'_--
(_) \(_)
--
"Elton W" wrote:
> Following URL maybe is helpful:
> http://msdn.microsoft.com/library/d...r />
mod16.asp
> Elton Wang
>
> "vinay" wrote:
>

Suggestion please..

I have a scenario, need your suggestion..

Our clients are already using the forms authentication where we check the
User/Pwd from SQL svr Database. We also have some SETTINGS for the user saved
in the database(helps us to restrict the user access some things) .

We wanted to implement AD authentication for the same and also keep the
existing SQL SVr User DB.

My Q would be how to MAP the LDAP user to the SQL svr User, so we can get
the SETTINGS defined for the user in the SQL svr Database.

Any suggestion is appreciated..

Thanks

Vinay

--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
--_,>/'_--
(_) \(_)
-----Following URL maybe is helpful:

http://msdn.microsoft.com/library/d...ml/secmod16.asp

Elton Wang

"vinay" wrote:

> I have a scenario, need your suggestion..
> Our clients are already using the forms authentication where we check the
> User/Pwd from SQL svr Database. We also have some SETTINGS for the user saved
> in the database(helps us to restrict the user access some things) .
> We wanted to implement AD authentication for the same and also keep the
> existing SQL SVr User DB.
> My Q would be how to MAP the LDAP user to the SQL svr User, so we can get
> the SETTINGS defined for the user in the SQL svr Database.
> Any suggestion is appreciated..
> Thanks
> Vinay
> --
> http://pathidotnet.blogspot.com
> =====
> vInAypAtHi
> o__
> --_,>/'_--
> (_) \(_)
> -----
Elton

Thanks for the link, i have done the LDAP authentication already.

I am looking for a way to link the LDAP user to the existing SQL svr user.

Thanks
--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
--_,>/'_--
(_) \(_)
-----

"Elton W" wrote:

> Following URL maybe is helpful:
> http://msdn.microsoft.com/library/d...ml/secmod16.asp
> Elton Wang
>
> "vinay" wrote:
> > I have a scenario, need your suggestion..
> > Our clients are already using the forms authentication where we check the
> > User/Pwd from SQL svr Database. We also have some SETTINGS for the user saved
> > in the database(helps us to restrict the user access some things) .
> > We wanted to implement AD authentication for the same and also keep the
> > existing SQL SVr User DB.
> > My Q would be how to MAP the LDAP user to the SQL svr User, so we can get
> > the SETTINGS defined for the user in the SQL svr Database.
> > Any suggestion is appreciated..
> > Thanks
> > Vinay
> > --
> > http://pathidotnet.blogspot.com
> > =====
> > vInAypAtHi
> > o__
> > --_,>/'_--
> > (_) \(_)
> > -----

suggestion to improve cookieless session state

Whidbey finally gives us cookieless forms authentication, which is a great new feature. But, to make it even better the .Net team gave us more than a simple true/false setting. Instead, we can set the "cookieless" attribute of the <forms> element to "UseUri", "UseCookies", "AutoDetect", or "UseDeviceProfile". This level of control and flexibility is amazing, but it got me thinking... why not add this same feature to the <sessionState> element? Currently, the "cookieless" attribute of the <sessionState> element only accepts a true/false value. Would it be possible to extend it to support the same set of values that the <forms> element now accepts? Of course, it would still have to accept true/false as well for backward compatability.I think it's a great idea.

Saturday, March 24, 2012

Suggestions for Printing Form letters from web page?

What would be a good tool to use to print out form letters. I would also like to be able to have variables in these forms that could be used for names addresses dates and whatevers. All these forms are in either .doc or pdf format right now. I would also need the ablity to save copies of these forms in various Dir's with the names etc. Any suggestions. I don't want to go broke on this either. ThanksHi,
What exactly you mean by form letters?

Do you even need a web app? If so, look into the Office Automation Tools.
Jeff


There are about a 12 differant forms that are used to notify clients of meetings or upcomming actions and a variety of other things. The only changeing in the forms is the names dates and addresses. Where would I look for the office automation info. Alot of this is new to me. Thanks.


Are these viewed via the web?
I think we're all a little confused as to what the connection is to ASP.NET with mail-merge documents.

I need for these forms to be viewed over the office network web site. They won't be view by the WWW. Just in the local office. These are not really mail merger docs.The names addresses etc will need to be able to be inbeded in the documents. I guess another way of saying this is like this. I have a button set up that allows me to select which form I want to see and print if needed. I need to be able to bring this from up with the current clients name, address etc being put into the form where needed. Does this help? I appreciate any help/advice. Thanks


Ok... couple things as I see it.
1) how to get the docs to show.
2) how to get the docs to merge the client info into it.
3) how to print.
Well, the 3rd is right out without a component. window.print() is about the best you can do for accessing the clients printer from the IIS server.
Lets back up though. The docs can be anywhere that the IIS box can get to them, no biggie.
Simply supply a list that refers to this location.
As for pulling the client's info into the doc, you got two options. Try to manually do this from asp.net or build your docs/templates to retrieve from a db, then you just need to pass the clientID (or whatever identifier).
The whole scenario really sounds like an ideal candiate for a reporting tool or some type of PDF tool ideally.

Take a look at:

http://msdn2.microsoft.com/en-us/library/d2tx7z6d.aspx
Jeff

Suggestions to prevent VICIOUS data input?

Using ASP.NET 2.0/SQL Express...

In places where I allow data input by users (sign up forms, comments,
etc...) do I need to manually safeguard my site against vicious attacks (SQL
injection, etc...)? Should I just run all input thru a filter that removes
all special characters, like asterick, semicolon, etc...? Or, is this
handled internally so I don't have to worry about it? Any suggestions?

Thanks.VB Programmer wrote:
> Using ASP.NET 2.0/SQL Express...
> In places where I allow data input by users (sign up forms, comments,
> etc...) do I need to manually safeguard my site against vicious attacks (SQL
> injection, etc...)? Should I just run all input thru a filter that removes
> all special characters, like asterick, semicolon, etc...? Or, is this
> handled internally so I don't have to worry about it? Any suggestions?
> Thanks.

It depends... You can validate your form entries with regular
expressions (client side AND server side) and the like. Other than that,
the main thing is using parameterized queries - *NOT* string
concatenation to make your SQL queries (that's really asking for
trouble). That would be a good start :) ASP.NET also does protect you to
some extent.
john smith wrote:
> VB Programmer wrote:
> > Using ASP.NET 2.0/SQL Express...
> > In places where I allow data input by users (sign up forms, comments,
> > etc...) do I need to manually safeguard my site against vicious attacks (SQL
> > injection, etc...)? Should I just run all input thru a filter that removes
> > all special characters, like asterick, semicolon, etc...? Or, is this
> > handled internally so I don't have to worry about it? Any suggestions?
> > Thanks.
> It depends... You can validate your form entries with regular
> expressions (client side AND server side) and the like. Other than that,
> the main thing is using parameterized queries - *NOT* string
> concatenation to make your SQL queries (that's really asking for
> trouble). That would be a good start :) ASP.NET also does protect you to
> some extent.

What he said ^

Also, when using regular expressions, look for GOOD input, and reject
anything that doesn't match. Doing it the other way around, you're
bound to miss something...

Damien
Hi, as part of your research, you should investigate a product I wrote that
handles SQL Injection and Cross Site Scripting attacks. It is VAM: Visual
Input Security. (http://www.peterblum.com/vise/home.aspx)

-- Peter Blum
www.PeterBlum.com
Email: PLBlum@.PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"VB Programmer" <dont@.emailme.com> wrote in message
news:eGdttg6JGHA.916@.TK2MSFTNGP10.phx.gbl...
> Using ASP.NET 2.0/SQL Express...
> In places where I allow data input by users (sign up forms, comments,
> etc...) do I need to manually safeguard my site against vicious attacks
> (SQL injection, etc...)? Should I just run all input thru a filter that
> removes all special characters, like asterick, semicolon, etc...? Or, is
> this handled internally so I don't have to worry about it? Any
> suggestions?
> Thanks.

Suggestions to prevent VICIOUS data input?

Using ASP.NET 2.0/SQL Express...
In places where I allow data input by users (sign up forms, comments,
etc...) do I need to manually safeguard my site against vicious attacks (SQL
injection, etc...)? Should I just run all input thru a filter that removes
all special characters, like asterick, semicolon, etc...? Or, is this
handled internally so I don't have to worry about it? Any suggestions?
Thanks.VB Programmer wrote:
> Using ASP.NET 2.0/SQL Express...
> In places where I allow data input by users (sign up forms, comments,
> etc...) do I need to manually safeguard my site against vicious attacks (S
QL
> injection, etc...)? Should I just run all input thru a filter that remove
s
> all special characters, like asterick, semicolon, etc...? Or, is this
> handled internally so I don't have to worry about it? Any suggestions?
> Thanks.
>
It depends... You can validate your form entries with regular
expressions (client side AND server side) and the like. Other than that,
the main thing is using parameterized queries - *NOT* string
concatenation to make your SQL queries (that's really asking for
trouble). That would be a good start :) ASP.NET also does protect you to
some extent.
john smith wrote:
> VB Programmer wrote:
> It depends... You can validate your form entries with regular
> expressions (client side AND server side) and the like. Other than that,
> the main thing is using parameterized queries - *NOT* string
> concatenation to make your SQL queries (that's really asking for
> trouble). That would be a good start :) ASP.NET also does protect you to
> some extent.
What he said ^
Also, when using regular expressions, look for GOOD input, and reject
anything that doesn't match. Doing it the other way around, you're
bound to miss something...
Damien
Hi, as part of your research, you should investigate a product I wrote that
handles SQL Injection and Cross Site Scripting attacks. It is VAM: Visual
Input Security. (http://www.peterblum.com/vise/home.aspx)
-- Peter Blum
www.PeterBlum.com
Email: PLBlum@.PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"VB Programmer" <dont@.emailme.com> wrote in message
news:eGdttg6JGHA.916@.TK2MSFTNGP10.phx.gbl...
> Using ASP.NET 2.0/SQL Express...
> In places where I allow data input by users (sign up forms, comments,
> etc...) do I need to manually safeguard my site against vicious attacks
> (SQL injection, etc...)? Should I just run all input thru a filter that
> removes all special characters, like asterick, semicolon, etc...? Or, is
> this handled internally so I don't have to worry about it? Any
> suggestions?
> Thanks.
>