Basically I want to place a url in the form action method.
The ltlUrl.text value is added on the server side in pageLoad.
How do i use the ltlUrl as the action method?
<form action="<%# ltlurl.text%>" enctype="multipart/form-data">
<input type="text" name="title" value="test" />
<input type="file" name="file" />
<input type="submit" />
</form>
Since you are populating the text control on code behind, you can simply do this:
this.Page.Form.Action = "http://someour";
I believe the VB.NET syntax would be:
Me.Page.Form.Action = "http://someurl"
Related
heloo,
i have a html form which is posting data to a link like
<body onload="javascript:document.E_FORM.submit();">
<form action= method="POST" name="E_FORM">
<input type="hidden" name="a" value="1" size="100"><br />
<input type="hidden" name="b" value="2"><br />
<input type="hidden" name="c" value="3"><br />
</form>
i want to submit this form using code behind using string builder to create form and then submit using WebClient.
I have done an interswitch payment gateway in my regular asp.net webform and asp.net mvc.
But I have a requirement to do the same in dotnetnuke which i know i can through module.
In my pay now pay of my application i have a form to send data across to interswitch webservice the form is below
<form name="form1" action="https://stageserv.interswitchng.com/test_paydirect/pay"
method="post">
<input name="product_id" type="hidden" value="XX" />
<input name="pay_item_id" type="hidden" value="XX" />
<input name="amount" type="hidden" value="XXXXXXX" />
<input name="currency" type="hidden" value="566" />
<input name="site_redirect_url" type="hidden" value="http://abc.com /getresponse”/>
<input name="txn_ref" type="hidden" value=" XXXAFTXXX”" />
<input name="hash" type="hidden" value="BB292DF9268F05CB9CBBC5E0C13CC1B13ACA34DC" />
</form>
I need someone to help me out on how i can implement this in my dotnetnukes module.
I faced a similar problem and asked this question. The accepted answer here is how I ended up doing it.
I just added the input fields to the page and then changed the "Pay" buttons PostBackUrl
This way you don't need to add an additional form to the page, and when the user clicks the button, it will submit those fields, so obviously it will pick up the ones it's looking for.
So in your case it would be:
<%-- other page content before --%>
<input name="product_id" type="hidden" value="XX" />
<input name="pay_item_id" type="hidden" value="XX" />
<input name="amount" type="hidden" value="XXXXXXX" />
<input name="currency" type="hidden" value="566" />
<input name="site_redirect_url" type="hidden" value="http://ipsum.com/getresponse”/>
<input name="txn_ref" type="hidden" value=" XXXAFTXXX”" />
<input name="hash" type="hidden" value="BB292DF9268F05CB9CBBC5E0C13CC1B13ACA34DC" />
<%-- pay button would look like this --%>
<asp:Button ID="btnPayNow" runat="server" PostBackUrl="https://stageserv.interswitchng.com/test_paydirect/pay" Text="Pay Now!" />
<%-- other page content after --%>
Of course if you have multiple payment gateway options you can set the PostBackUrl programatically before you display the form: btnPayNow.PostBackUrl = "http://<url>.com"
If you are posting to another site, not even anything on your site then you don't need a module at all.
With DNN you cannot include another form on your site like that. But you could make that a .html page and include that on your site as an iframe or something like that.
That should post to that other service fine.
How to call a Session and use it as a value of Text Box Form. I am using asp.net
<form id="frmLog" name="frmLog" method="post" action="/Page/">
<input type="text" name="UserId" value="<%=Sessiopn["UserID"] %>">" />
</form>
Thanks!
Correct it to this. You have a typing mistake.
<input type="text" name="UserId" value="<%=Session["UserID"] %>" />
you have error on variable name (without p)
Sessiopn -> Session
I have next form and some ashx
<form action="FileUpload.ashx" method="POST" enctype="multipart/form-data" id="frmUpload">
<input id="fileupload" type="file" name="files[]" />
<input id="viewId" type="hidden" />
<input id="moduleId" type="hidden" />
<button id="btnUpload" type="submit">Upload</button>
</form>
I can get file inside of ProcessRequest(HttpContext context)
context.Request.Files - file containe file information, but context.Request.Form["viewId"] is empty.
That should I do to get hidden fields values ?
Thanks.
You need to add the name="viewid" also. The name attribute is used when you make post, not the id
read also: HTML input - name vs. id in the line "Used on form elements to submit information"
I have a simple asp.net page where a form action is done, which it takes to the 3d party url and that will return some data as a response. How can I achieve the job done without using static form action.
Below is the form action:
<form name="theForm" method="GET" action="page.aspx" >
<input type="hidden" name="asp" value="hidden values" />
<input type="hidden" name="url" value="http://www.google.com" />
<input type="submit" name="submit" />
</form>
Thanks in Advance.