Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP:NET
How to use html from and post method in asp .net(4.0) using c#.
e.g
<form name="ecom" method="post" action="redirecting url">
<input type="hidden" name="field1" value="<%= field %>">
<input type="hidden" name="field2" value="<%= field2 %>">
<input type="hidden" name="field3" value="<%= field3 %>">
<input type="submit" name="submit" value="Submit">
</form>
 
I want to use this,as we write in classic ASP or jsp
Posted 13-Nov-12 23:26pm
Edited 14-Nov-12 0:18am
digimanus30.9K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

What do you want to do with this?
  Permalink  
Comments
avikGhosh87 at 14-Nov-12 5:23am
   
Actually i am working on a 3rd party url.
I need to redirect a page using post method.
I can not understand how i do this using asp .net
so if you have any suggestion please share it.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

<form id="form1" runat="server">
<div>
    <asp:Literal ID="Literal1" runat="server" /><br />
    User Name: <asp:TextBox ID="UserName" runat="server" /><br />
    Password:  <asp:TextBox ID="Password" runat="server" /><br />
    <asp:Button ID="Login" runat="server"  Text="Log In" />
</div>
</form>
 

And change the onclick event on the button to redirect
  Permalink  
Comments
avikGhosh87 at 14-Nov-12 5:38am
   
but how can i specified method POST ??
digimanus at 14-Nov-12 5:50am
   
you can still use your POST command in the FORM object if you really want to. The button has an OnClick-event which does the same.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 300
1 Sergey Alexandrovich Kryukov 287
2 OriginalGriff 195
3 Zoltán Zörgő 149
4 Peter Leow 115
0 OriginalGriff 7,510
1 DamithSL 5,519
2 Sergey Alexandrovich Kryukov 5,044
3 Maciej Los 4,961
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 14 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100