I am newbie to paypal. I want to implement direct payment api for my website. Means i will be having a buy button when i click on that it will expand and in that iframe i will be having the url for paypal direct payment. I have written the code like
string address = "https://api-3t.sandbox.paypal.com/nvp?USER=user&COUNTRYCODE=US&ZIP=95131&STATE=CA&CITY=San Jose&FIRSTNAME=John&LASTNAME=Smith&STREET=1asfasdfSt&CVV2=123&ACCT=4683075410516684&IPADDRESS=192.168.0.62&PWD=1357635822&EXPDATE=042011&VERSION=58.0&SIGNATURE=signature&METHOD=DoDirectPayment&CREDITCARDTYPE=Visa&AMT=10.00&PAYMENTACTION=Sale&RETURNURL=http://returnurl&CANCELURL=http://cancnelurl";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address);
HttpWebResponse response2 = (HttpWebResponse)request.GetResponse();
Stream stream = response2.GetResponseStream();
StreamReader rdr = new StreamReader(stream);
string req = rdr.ReadToEnd();
But the req contains the failure message. I don't know what credentials i am missing.
Any help is appreciated.
The error message states that its the expiry date thats the problem.
You are passing EXPDATE=042011 which looks to me like a date in the past.
Edit:
10500 Invalid Configuration This transaction cannot be processed due to an invalid merchant configuration.
Occurs when you have not agreed to the billing agreement.
10501 Invalid Configuration This transaction cannot be processed due to an invalid merchant configuration.
Occurs when the billing agreement is disabled or inactive.
As it was already mentioned, the error that you are getting is because pro is not enabled on the account you are using the credentials for. Express Checkout does not require any special billing agreement, this is why your Express Checkout calls were working.
I have enabled to pro service on your test sandbox account, and you should be able to test with it now.
<html>
<head>
<title>PayPal Merchant SDK - DoDirectPayment API</title>
<link rel="stylesheet" href="../Common/sdk.css"/>
<script language="JavaScript">
function generateCC(){
var cc_number = new Array(16);
var cc_len = 16;
var start = 0;
var rand_number = Math.random();
switch(document.DoDirectPaymentForm.creditCardType.value)
{
case "Visa":
cc_number[start++] = 4;
break;
case "Discover":
cc_number[start++] = 6;
cc_number[start++] = 0;
cc_number[start++] = 1;
cc_number[start++] = 1;
break;
case "MasterCard":
cc_number[start++] = 5;
cc_number[start++] = Math.floor(Math.random() * 5) + 1;
break;
case "Amex":
cc_number[start++] = 3;
cc_number[start++] = Math.round(Math.random()) ? 7 : 4 ;
cc_len = 15;
break;
}
for (var i = start; i < (cc_len - 1); i++) {
cc_number[i] = Math.floor(Math.random() * 10);
}
var sum = 0;
for (var j = 0; j < (cc_len - 1); j++) {
var digit = cc_number[j];
if ((j & 1) == (cc_len & 1)) digit *= 2;
if (digit > 9) digit -= 9;
sum += digit;
}
var check_digit = new Array(0, 9, 8, 7, 6, 5, 4, 3, 2, 1);
cc_number[cc_len - 1] = check_digit[sum % 10];
document.DoDirectPaymentForm.creditCardNumber.value = "";
for (var k = 0; k < cc_len; k++) {
document.DoDirectPaymentForm.creditCardNumber.value += cc_number[k];
}
}
</script>
</head>
<body>
<div id="wrapper">
<div id="header">
<h3>DoDirectPayment</h3>
<div id="apidetails">Process a credit card payment.</div>
</div>
<div id="request_form">
<form method="POST" action="DoDirectPayment.php"
name="DoDirectPaymentForm">
<div class="params">
<div class="param_name">Payment type</div>
<div class="param_value">
<select name="paymentType">
<option value="Sale" selected="selected">Sale</option>
<option value="Authorization">Authorization</option>
</select>
</div>
</div>
<div class="params">
<div class="param_name">First name</div>
<div class="param_value">
<input type="text" name="firstName" value="John"/>
</div>
</div>
<div class="params">
<div class="param_name">Last name</div>
<div class="param_value">
<input type="text" name="lastName" value="Doe"/>
</div>
</div>
<div class="params">
<div class="param_name">Card type</div>
<div class="param_value">
<select name="creditCardType"
onChange="javascript:generateCC(); return false;">
<option value="Visa" selected="selected">Visa</option>
<option value="MasterCard">MasterCard</option>
<option value="Discover">Discover</option>
<option value="Amex">American Express</option>
</select>
</div>
</div>
<div class="params">
<div class="param_name">Card number</div>
<div class="param_value">
<input type="text" size="19" maxlength="19" name="creditCardNumber">
</div>
</div>
<div class="params">
<div class="param_name">Expiry date</div>
<div class="param_value">
<select name="expDateMonth">
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
<select name="expDateYear">
<option value="2013">2013</option>
<option value="2014" selected>2014</option>
<option value="2015">2015</option>
<option value="2016">2016</option>
<option value="2017">2017</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
</select>
</div>
</div>
<div class="params">
<div class="param_name">CVV</div>
<div class="param_value">
<input type="text" size="3" maxlength="4" name="cvv2Number" value="962">
</div>
</div>
<div class="params">
<div class="param_name">Amount</div>
<div class="param_value">
<input type="text" size="5" maxlength="7" name="amount" value="1.00"> USD
</div>
</div>
<div class="section_header">Billing address</div>
<div class="params">
<div class="param_name">Address 1</div>
<div class="param_value">
<input type="text" size="25" maxlength="100" name="address1" value="1 Main St">
</div>
</div>
<div class="params">
<div class="param_name">Address 2 (optional)</div>
<div class="param_value">
<input type="text" size="25" maxlength="100" name="address2" value="">
</div>
</div>
<div class="params">
<div class="param_name">City</div>
<div class="param_value">
<input type="text" size="25" maxlength="40" name="city" value="San Jose">
</div>
</div>
<div class="params">
<div class="param_name">State</div>
<div class="param_value">
<select id=state name="state">
<option value=""></option>
<option value="AK">AK</option>
<option value="AL">AL</option>
<option value="AR">AR</option>
<option value="AZ">AZ</option>
<option value="CA" selected>CA</option>
<option value="CO">CO</option>
<option value="CT">CT</option>
<option value="DC">DC</option>
<option value="DE">DE</option>
<option value="FL">FL</option>
<option value="GA">GA</option>
<option value="HI">HI</option>
<option value="IA">IA</option>
<option value="ID">ID</option>
<option value="IL">IL</option>
<option value="IN">IN</option>
<option value="KS">KS</option>
<option value="KY">KY</option>
<option value="LA">LA</option>
<option value="MA">MA</option>
<option value="MD">MD</option>
<option value="ME">ME</option>
<option value="MI">MI</option>
<option value="MN">MN</option>
<option value="MO">MO</option>
<option value="MS">MS</option>
<option value="MT">MT</option>
<option value="NC">NC</option>
<option value="ND">ND</option>
<option value="NE">NE</option>
<option value="NH">NH</option>
<option value="NJ">NJ</option>
<option value="NM">NM</option>
<option value="NV">NV</option>
<option value="NY">NY</option>
<option value="OH">OH</option>
<option value="OK">OK</option>
<option value="OR">OR</option>
<option value="PA">PA</option>
<option value="RI">RI</option>
<option value="SC">SC</option>
<option value="SD">SD</option>
<option value="TN">TN</option>
<option value="TX">TX</option>
<option value="UT">UT</option>
<option value="VA">VA</option>
<option value="VT">VT</option>
<option value="WA">WA</option>
<option value="WI">WI</option>
<option value="WV">WV</option>
<option value="WY">WY</option>
<option value="AA">AA</option>
<option value="AE">AE</option>
<option value="AP">AP</option>
<option value="AS">AS</option>
<option value="FM">FM</option>
<option value="GU">GU</option>
<option value="MH">MH</option>
<option value="MP">MP</option>
<option value="PR">PR</option>
<option value="PW">PW</option>
<option value="VI">VI</option>
</select>
</div>
</div>
<div class="params">
<div class="param_name">Zip code</div>
<div class="param_value">
<input type="text" size="10" maxlength="10" name="zip" value="95131"> (5 or 9 digits)
</div>
</div>
<div class="params">
<div class="param_name">Country</div>
<div class="param_value">
<input type="text" size="10" maxlength="10" name="country" value="US">
</div>
</div>
<div class="params">
<div class="param_name">Phone</div>
<div class="param_value">
<input type="text" size="10" maxlength="10" name="phone" value="">
</div>
</div>
<div class="params">
<div class="param_name">IPN listener URL</div>
<div class="param_value">
<input type="text" size="80" maxlength="200" name="notifyURL" value="">
</div>
</div>
<div class="params">
<div class="param_name"></div>
<div class="param_value">
</div>
</div>
<div class="submit">
<input type="submit" name="DoDirectPaymentBtn"
value="DoDirectPayment" />
</div>
</form>
Home
</div>
</div>
<script language="javascript">
generateCC();
</script>
</body>
</html>
Related
I am doing a .NET Core MVC project. In a partial view, I want some information from user to fill as HTML form. That information is variables of a model, so every filled list is an object. After user filled the objects, I want to send that object to my controller as a List of that object. User may send 3 forms or 5 forms or 1 form. My question is, when it is only 1 form to send, everything was ok, I gave variables names' of model as name attribute to my HTML inputs in a form tag and my object was filling. But in that case which I don't know how many objects will come, I could not figure out how can I get list of objects. I hope it is clear.
Here is my View:
#model List<EpubAdmin.Models.KyProducts>
#{
ViewData["Title"] = "AddBook";
Layout = null;
}
#foreach(var product in Model)
{
<div class="col col-xl-12">
<div class="row justify-content-center">
<div class="col-xl-5 col-lg-5 ">
<form method="post" action="/File/AddProductFile" enctype="multipart/form-data" id="myForm">
<br />
<b>Kitap Adı: </b>
<input class="form-control" value="#(Html.Raw(product.Name))" name="Name"/>
<br />
<b>Sayfa Sayısı: </b>
<input class="form-control" value="#product.PageNumber" name="PageNumber" />
<br />
<b>Product Id: </b>
<input class="form-control" value="#product.KyProductId" name="KyProductId" readonly />
<br />
<b>Barkod: </b>
<input class="form-control" value="#product.Barcode" name="Barcode" readonly />
<input class="form-control" value="#product.Author" name="Author" hidden />
<input class="form-control" value="#product.ImageId" name="ImageId" hidden />
<input class="form-control" value="#product.PublisherName" name="PublisherName" hidden />
<input class="form-control" value="#product.PublisherId" name="PublisherId" hidden />
<br />
#*<select class="selectpicker" data-live-search="true" data-show-subtext="true">
<option value="0">Tarih</option>
<option value="1">Çocuk</option>
<option value="2">Psikoloji</option>
<option value="3">Kültür</option>
</select>*#
#if (product.IsDuplicate)
{
<div class="alert alert-danger">
<p>* Bu kitap zaten ekli.</p>
</div>}
else
{
<h5>Kategori Seç</h5>
<select class="form-select ml-0" data-live-search="true">
<option selected>Tarih</option>
<option value="1">Çocuk</option>
<option value="2">Psikoloji</option>
<option value="3">Kültür</option>
</select>
<select class="form-select ml-5">
<option selected>Tarih</option>
<option value="1">Çocuk</option>
<option value="2">Psikoloji</option>
<option value="3">Kültür</option>
</select>
<select class="form-select ml-5">
<option selected>Tarih</option>
<option value="1">Çocuk</option>
<option value="2">Psikoloji</option>
<option value="3">Kültür</option>
</select>
<br />
<br />
<label for="file">Yüklenecek kitabı seçin.</label>
<input type="file" class="form-control-file" id="File" accept=".epub" name="File">
}
</form>
<br />
<br />
</div>
</div>
<br />
<hr />
<br />
</div>
}
<div class="float-right">
<button class="btn btn-info w-100" onclick="onclk()">Ekle</button>
</div>
<br />
<br />
<script>
function onclk() {
$("#myForm").submit();
alert("a");
}
</script>
Controller:
[HttpPost]
public IActionResult AddProductFile(List<KyProducts> model)
{
foreach(var product in model)
{
if (product.file == null || product.KyProductId == 0 || product.PublisherId == 0)
{
return RedirectToAction("List", "Books");
}
}
}
I thought about using for instead of foreach in my view so I can get indexes and can name my HTML attributes as name="id+#i" but that did not seem best practice to me and wasn't sure if it works. I also thought about putting hidden submit buttons for every form and on click of main submit button, triggering all hidden submit buttons but that didn't seem to be best practice again... What are your ideas?
If you want to pass a list to your action,try to put the form outside foreach,and change the name of inputs:
#model List<EpubAdmin.Models.KyProducts>
#{
ViewData["Title"] = "AddBook";
Layout = null;
}
<form method="post" action="/File/AddProductFile" enctype="multipart/form-data" id="myForm">
#{ var i = 0;}
#foreach (var product in Model)
{
<div class="col col-xl-12">
<div class="row justify-content-center">
<div class="col-xl-5 col-lg-5 ">
<br />
<b>Kitap Adı: </b>
<input class="form-control" value="#(Html.Raw(product.Name))" name="model[#i].Name" />
<br />
<b>Sayfa Sayısı: </b>
<input class="form-control" value="#product.PageNumber" name="model[#i].PageNumber" />
<br />
<b>Product Id: </b>
<input class="form-control" value="#product.KyProductId" name="model[#i].KyProductId" readonly />
<br />
<b>Barkod: </b>
<input class="form-control" value="#product.Barcode" name="model[#i].Barcode" readonly />
<input class="form-control" value="#product.Author" name="model[#i].Author" hidden />
<input class="form-control" value="#product.ImageId" name="model[#i].ImageId" hidden />
<input class="form-control" value="#product.PublisherName" name="model[#i].PublisherName" hidden />
<input class="form-control" value="#product.PublisherId" name="model[#i].PublisherId" hidden />
<br />
#if (product.IsDuplicate)
{
<div class="alert alert-danger">
<p>* Bu kitap zaten ekli.</p>
</div>}
else
{
<h5>Kategori Seç</h5>
<select class="form-select ml-0" data-live-search="true">
<option selected>Tarih</option>
<option value="1">Çocuk</option>
<option value="2">Psikoloji</option>
<option value="3">Kültür</option>
</select>
<select class="form-select ml-5">
<option selected>Tarih</option>
<option value="1">Çocuk</option>
<option value="2">Psikoloji</option>
<option value="3">Kültür</option>
</select>
<select class="form-select ml-5">
<option selected>Tarih</option>
<option value="1">Çocuk</option>
<option value="2">Psikoloji</option>
<option value="3">Kültür</option>
</select>
<br />
<br />
<label for="file">Yüklenecek kitabı seçin.</label>
<input type="file" class="form-control-file" id="File" accept=".epub" name="File">
}
<br />
<br />
</div>
</div>
<br />
<hr />
<br />
</div>
i++;
}
<input type="submit" value="submit"/>
</form>
So that when you click the button,it will pass the whole list to action.
ViewData["ComponenteId"] = new SelectList(await GetComponentes(Geometria.MatrizId), "Nome", "Nome", Geometria.Componente);
here is the view
<div class="form-row">
<div class="form-group col-md-4">
<label asp-for="Geometria.Componente" class="control-label"></label>
<select asp-for="Geometria.Componente" class="custom-select" asp-items="ViewBag.ComponenteId">
<option value="">Selecione um Componente</option>
</select>
<span asp-validation-for="Geometria.Componente" class="text-danger"></span>
</div>
</div>
no matter what it won't bind and i don't understand why when basically the value and text are the same property.
this is how it is rendered in html
<select class="custom-select input-validation-error" data-val="true" data-val-required="The Componente POE field is required." id="Geometria_Componente" name="Geometria.Componente" aria-describedby="Geometria_Componente-error" aria-invalid="true">
<option value="">Selecione um Componente</option>
<option value="M130291">M130291</option>
<option value="M130559">M130559</option>
<option value="M140004">M140004</option>
<option value="M140040">M140040</option>
<option value="SA00367A300">SA00367A300</option>
<option value="SS98940A100">SS98940A100</option>
</select>
UPDATE
It seems the reason it was not binding it is because the value had whitespaces even before i started using Entity Framework Core. The old data type was varchar hence why it was not recognizing it.
I have a set of html select tags that serve to accomplish a a set of search parameters for a vehicle catalogue.
The html is as follows:
<div class="clearfix select-form padding-bottom-50">
<div class="my-dropdown min-years-dropdown max-dropdown">
<select name="year" class="css-dropdowns" tabindex="1" id="txtYear" runat="server" >
<option value="">Search by Year</option>
<option value="2018">2018</option>
<option value="2017">2017</option>
<option value="2016">2016</option>
<option value="2015">2015</option>
<option value="2014">2014</option>
<option value="2013">2013</option>
<option value="2012">2012</option>
<option value="2011">2011</option>
<option value="2010">2010</option>
<option value="2009">2009</option>
<option value="2008">2008</option>
<option value="2007">2007</option>
<option value="2006">2006</option>
<option value="2005">2005</option>
<option value="2004">2004</option>
</select>
</div>
<div class="my-dropdown min-years-dropdown max-dropdown">
<select name="make" class="css-dropdowns" tabindex="1" id="txtMake" runat="server" >
<option value="">Search by Make</option>
<option value="BMW">BMW</option>
<option value="FORD">FORD</option>
</select>
</div>
<div class="my-dropdown min-years-dropdown max-dropdown">
<select name="transmission" class="css-dropdowns" tabindex="1" id="txtTrans" runat="server" >
<option value="">Search by Transmission</option>
<option value="Automatic">Automatic</option>
<option value="Manual">Manual</option>
</select>
</div>
<div class="my-dropdown min-years-dropdown max-dropdown">
<select name="price" class="css-dropdowns" tabindex="1" id="txtPrice" runat="server" >
<option value="">Search by Price</option>
<option value="50000">< R50,000</option>
<option value="100000">< R100,000</option>
<option value="150000">< R150,000</option>
<option value="200000">< R200,000</option>
</select>
</div>
<input type="button" value="Search" class="pull-left btn-inventory margin-bottom-none md-button" runat="server" id="btnSearch" onserverclick="btnSearch_ServerClick1" />
</div>
</div>
<div class="clearfix"></div>
</div>
On Codebehind:
protected void btnSearch_ServerClick1(object sender, EventArgs e)
{
Response.Redirect("usedsearch.aspx?make=" + txtMake.Value + "&year=" + txtYear.Value + "&trans=" + txtTrans.Value + "&price=" + txtPrice.Value);
}
When browsing the site on an iphone, the values from the select tags are not passed to the URL Parameters(Parameter value is blank -> eg www.....com?Make=&Year=...).
However, on an android device, it works perfectly. Really confused.
Using C# with Razor syntax
I cannot figure out what is wrong...
I have a simple HTML form (I'm going to convert it to HTML Helpers soon). I have a form and within the form I have two <select> elements that contain names. For some reason the data is posting, but without any parameters
HTML
<form method="post" action="~/modules/parts/bom_ervd.cshtml">
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<div class="col-md-3">
<div class="input-group">
<label>Unit Size<span class="req">*</span></label>
<select class="form-control isReq" name="ervd_unitsize" id="sel_ervd_custom_unitsize">
<option value="">--Select--</option>
<option value="101" disabled>Box 1 (1,500 to 3,000CFM)</option>
<option value="102">Box 2 (2,000 to 4,800CFM)</option>
<option value="103">Box 3 (3,500 to 7,500CFM)</option>
<option value="104">Box 4 (5,000 to 10,000CFM)</option>
</select>
</div>
</div>
<div class="col-md-3">
<div class="input-group">
<label>Power<span class="req">*</span></label>
<select class="form-control isReq" name="ervd_power" id="sel_ervd_custom_power">
<option value="">--Select--</option>
<option value="208/3/60" data-val="7" data-typ="0">208/3/60</option>
<option value="230/3/60" data-val="12" data-typ="0">230/3/60</option>
<option value="460/3/60" data-val="20" data-typ="1">460/3/60</option>
<option value="575/3/60" data-val="23" disabled>575/3/60</option>
</select>
</div>
</div>
<div class="col-md-3"></div>
<div class="col-md-3"></div>
</div>
<div id="form_subcomponents">
<div class="col-md-12">
<hr class="hr1" style="margin-top:40px !important;" />
<input class="btn-block btn btn-info" type="submit" id="btn_ervd_custom_submit" value="Submit"/>
</div>
</div><!-- end form sub components-->
</div><!-- end row -->
</form><!-- end form -->
Here's the code for page: bom_ervd.cshtml
#{
if (isPost) {
if (Request.Form["ervd_unitsize"] == null) {
/* this is what I'm seeing */
<p>I'm getting null values</p>
}
else {
<p>The value is: #Request.Form["ervd_unitsize"].ToString()</p>
}
}
else {
<p>No Data posted!</p>
}
}
In this scenario I ensure I select an option that has a value
I have also tried Request["ervd_unitsize"] and still get null values
Why is it Posting but getting null values?
What am I doing wrong?
So for a school project I need to create login + sign up forms using aspx files.
I decided to make it one page 2 forms style that changes the form on a button press.
Now what I need to do at this point is to display the entered username after pressing the submit button in a new page.
this is the HTML
<%--Register--%>
<section>
<div id="container_demo">
<!-- hidden anchor to stop jump -->
<a class="hiddenanchor" id="toregister"></a>
<a class="hiddenanchor" id="tologin"></a>
<div id="wrapper">
<div id="login" class="animate form">
<form autocomplete="on" runat="server" name="signin" method="post" id="signin">
<h1>התחבר</h1>
<p>
<label for="username" class="uname" data-icon="u">אימייל או שם משתמש: </label>
<input <%--id="username"--%> id="signUsername" required="required" type="text" placeholder="myusername or mymail#mail.com" />
</p>
<p>
<label for="password" class="youpasswd" data-icon="p">סיסמה : </label>
<input id="lPassword" name="password" required="required" type="password" placeholder="eg. X8df!90EO" />
</p>
<p class="keeplogin">
<label for="loginkeeping">השאר אותי מחובר</label>
<input type="checkbox" name="loginkeeping" id="loginkeeping" value="loginkeeping" />
</p>
<p class="login button">
<input type="submit" value="התחבר" />
</p>
<p class="change_link">
אין משתמש?
הצטרף
</p>
</form>
</div>
<div id="register" class="animate form">
<form action="mysuperscript.php" autocomplete="on" onsubmit="return checkForm()">
<h1>הירשם </h1>
<p>
<label for="usernamesignup" <%--class="uname"--%> data-icon="u">שם משתמש</label>
<input id="usernamesignup" name="loginUsername" required="required" type="text" placeholder="mysuperusername690" pattern=".{3,}" oninvalid="this.setCustomValidity('שם משתמש קצר')" oninput="setCustomValidity('')" />
</p>
<p>
<label for="fNmae" class="fname" data-icon="u">שם פרטי</label>
<input id="fName" class="fnamesign" required="required" type="text" placeholder="איציק" />
</p>
<p>
<label for="lName" class=" lNaem" data-icon="u">שם משפחה</label>
<input id="lName" class="lNamesign" required="required" type="text" placeholder="פלדמן" />
</p>
<p>
<label for="emailsignup" class="youmail" data-icon="e">אימייל</label>
<input id="emailsignup" name="emailsignup" required="required" type="email" placeholder="mysupermail#mail.com" />
</p>
<p>
<label for="Password" class="youpasswd" data-icon="p">סיסמה </label>
<input id="Password" name="passwordsignup" required="required" type="password" placeholder="eg. X8df!90EO" />
</p>
<p>
<label for="cPassword" class="youpasswd" data-icon="p">אשר סיסמה </label>
<input id="cPassword" name="passwordsignup_confirm" required="required" type="password" placeholder="eg. X8df!90EO" />
</p>
<label for="bday">יום הולדת</label>
<p id="birthday">
<select name='day' id='dayddl'>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
<option value='7'>7</option>
<option value='8'>8</option>
<option value='9'>9</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
<option value='13'>13</option>
<option value='14'>14</option>
<option value='15'>15</option>
<option value='16'>16</option>
<option value='17'>17</option>
<option value='18'>18</option>
<option value='19'>19</option>
<option value='20'>20</option>
<option value='21'>21</option>
<option value='22'>22</option>
<option value='23'>23</option>
<option value='24'>24</option>
<option value='25'>25</option>
<option value='26'>26</option>
<option value='27'>27</option>
<option value='28'>28</option>
<option value='29'>29</option>
<option value='30'>30</option>
<option value='31'>31</option>
</select>
<select name='month' id='monthddl'>
<option value='1'>ינואר</option>
<option value='2'>פבואר</option>
<option value='3'>מרץ</option>
<option value='4'>אפריל</option>
<option value='5'>מאי</option>
<option value='6'>יוני</option>
<option value='7'>יולי</option>
<option value='8'>אוגוסט</option>
<option value='9'>ספטמבר</option>
<option value='10'>אוקטובר</option>
<option value='11'>נובמבר</option>
<option value='12'>דצמבר</option>
</select>
<input id="byear" name="byear" required="required" type="number" placeholder="2016" min="1970" max="2016" />
</p>
<p id="tel">
<label for="phone">מספר טלפון</label>
<br />
<input type="text" maxlength="3" id="phone" placeholder="050" class="bphone" />
-
<input type="text" maxlength="7" placeholder="1234567" class="ephone" />
</p>
<div id="mof">
<p>
<label for="gedner">מין</label>
<br />
<input type="radio" name="gender" value="male" checked />זכר
<input type="radio" name="gender" value="female" />נקבה
</p>
<p>
<label>סגנון האהוב</label>
<br />
<input type="radio" name="style" value="rock" required="required" />רוק
<br />
<input type="radio" name="style" value="metal" required="required" />מאטל
<br />
<input type="radio" name="style" value="classic" required="required" />
קלאסי
<br />
</p>
</div>
<p class="signin button">
<input type="submit" value="הירשם" id="sub" />
</p>
<p class="change_link">
יש משתמש ?
התחבר
</p>
</form>
</div>
</div>
</div>
</section>
</div>
And this .cs file
public partial class Login_N_register_ : System.Web.UI.Page
{
public string st = "";
protected void Page_Load(object sender, EventArgs e)
{
//Signin vars
string signUser = ((TextBox)signin.FindControl("signUsername")).Text;
//Login vars
string loginUser = Request.Form["loginUsername"];
st +="<h3 style='postition:absolute;top:50%;z-index:999;'>"+ signUser+"</h3>";
}
}
For some reason the .cs file won't show the entered text.
Didn't get to it because I want able to make one form to work but because its a 2 form one page I need it to only display the textbox which is on the page for example:
I log in as: x: nothing that relates to the signup form won't run and after pressing submit the .cs file add it to MasterPage code and I will be transferred to a new page (action="Main.master" I think)
And the other why around
Hope I was clear thanks in advanced