<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Does DPM Support Textboxes in ASP.NET, Webform, C#, Masterpages? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-DPM-Support-Textboxes-in-ASP-NET-Webform-C-Masterpages/m-p/19640#M10809</link>
    <description>&lt;P&gt;It is modify from SIM sample code.&lt;/P&gt;&lt;P&gt;It going to be something like this&amp;nbsp; on the aspx page&lt;/P&gt;&lt;PRE&gt;&amp;lt;asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server"&amp;gt;
	&amp;lt;input type='hidden' name='x_login' id='x_login' value='&amp;lt;%=x_login%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_amount' id='x_amount' value='&amp;lt;%=x_amount%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_description' id='x_description' value='&amp;lt;%=x_description%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_invoice_num' id='x_invoice_num' value='&amp;lt;%=x_invoice_num%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_fp_sequence' id='x_fp_sequence' value='&amp;lt;%=x_fp_sequence%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_fp_timestamp' id='x_fp_timestamp' value='&amp;lt;%=x_fp_timestamp%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_fp_hash' id='x_fp_hash' value='&amp;lt;%=x_fp_hash%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' name='x_show_form' value='PAYMENT_FORM' /&amp;gt;
	&amp;lt;input type='hidden' name='x_relay_response' value='TRUE' /&amp;gt;
	&amp;lt;asp:Button ID="btnSubmit" runat="server" Text="Complete the Purchase" ClientIDMode="Static"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CssClass="button" /&amp;gt;
&amp;lt;/asp:Content&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Notice that it set the value like value='&amp;lt;%=x_fp_hash%&amp;gt;'&lt;/P&gt;&lt;P&gt;Then, on the codebehind&lt;/P&gt;&lt;PRE&gt;private string p_x_login;&lt;BR /&gt;protected string x_login&lt;BR /&gt;{&lt;BR /&gt;     get { return p_x_login; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; set { p_x_login = value; }&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This is the property for x_login input&amp;nbsp; value='&amp;lt;%=x_login%&amp;gt;', and do it for the rest of the fields.&lt;/P&gt;&lt;P&gt;and on the page_load&lt;/P&gt;&lt;PRE&gt;x_login = "10charcode";&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 03 Dec 2011 01:18:00 GMT</pubDate>
    <dc:creator>RaynorC1emen7</dc:creator>
    <dc:date>2011-12-03T01:18:00Z</dc:date>
    <item>
      <title>Does DPM Support Textboxes in ASP.NET, Webform, C#, Masterpages?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-DPM-Support-Textboxes-in-ASP-NET-Webform-C-Masterpages/m-p/19634#M10806</link>
      <description>&lt;P&gt;When I use the following: &amp;lt;asp:TextBox ID="x_zip" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My value shows up here: ctl00$MainContent$x_zip&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I use: &amp;lt;input id="x_zip" type="text" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My value shows up properly here: x_zip&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, is it possible to use a textbox instead of a basic html input field to post to x_... fields? If so, can you provide sample code for both the .aspx and code behind pages (including where the code is place, pageload, button click event, etc.)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main reason I want to stick to the asp textboxes is for data validation purposes. Is there good reason I shouldn't use a textbox and should stick to the html input fields?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2011 23:14:56 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-DPM-Support-Textboxes-in-ASP-NET-Webform-C-Masterpages/m-p/19634#M10806</guid>
      <dc:creator>john1379</dc:creator>
      <dc:date>2011-12-02T23:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Does DPM Support Textboxes in ASP.NET, Webform, C#, Masterpages?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-DPM-Support-Textboxes-in-ASP-NET-Webform-C-Masterpages/m-p/19636#M10807</link>
      <description>&lt;P&gt;If you are on framework 4.0. You should be able to set the ClientIDMode="Static"&amp;nbsp; on the textbox.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2011 23:48:06 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-DPM-Support-Textboxes-in-ASP-NET-Webform-C-Masterpages/m-p/19636#M10807</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2011-12-02T23:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Does DPM Support Textboxes in ASP.NET, Webform, C#, Masterpages?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-DPM-Support-Textboxes-in-ASP-NET-Webform-C-Masterpages/m-p/19638#M10808</link>
      <description>&lt;P&gt;I'm in ASP.NET 4.0 and setting the clientID to static didn't change anything. Here's a test of me trying to use a textbox to insert the zip into x_zip.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a simplified version of my aspx code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;%@ Page Title="Store" Language="C#" AutoEventWireup="false" CodeFile="Store_SIM_TXBX.aspx.cs"
  MasterPageFile="~/MasterPages/Site.master" Inherits="Confirm" ViewStateMode="Disabled" %&amp;gt;

&amp;lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&amp;gt;
&amp;lt;/asp:Content&amp;gt;
&amp;lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&amp;gt;
  &amp;lt;div&amp;gt;
    &amp;lt;br /&amp;gt;
    &amp;lt;br /&amp;gt;
    Zip:
    &amp;lt;asp:TextBox ID="x_zip" runat="server" ClientIDMode="Static"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
    &amp;lt;div style="text-align: center;"&amp;gt;
      &amp;lt;asp:Button ID="btnSubmit" runat="server" Text="Complete the Purchase" ClientIDMode="Static"
        CssClass="button" /&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/asp:Content&amp;gt;&lt;/PRE&gt;&lt;P&gt;And simplified Code Behind&lt;/P&gt;&lt;PRE&gt;using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

partial class Confirm : System.Web.UI.Page
{
  protected void Page_Load(object sender, System.EventArgs e)
  {
    btnSubmit.PostBackUrl = "&lt;A href="https://developer.authorize.net/tools/paramdump/index.php" target="_blank"&gt;https://developer.authorize.net/tools/paramdump/index.php&lt;/A&gt;";//shows fields submitted
    strAuthorizeNet_x_amount = "99.99";
    strAuthorizeNet_x_login = ConfigurationManager.AppSettings.Get("AUTHORIZE_NET_API_LOGIN");
    strAuthorizeNet_x_fp_timestamp = AuthorizeNet.Crypto.GenerateTimestamp().ToString();
    strAuthorizeNet_x_test_request = "TRUE";//does not show in unsettled
  }
  private string strAuthorizeNet_x_fp_timestamp;
  public string AuthorizeNet_x_fp_timestamp
  {
    get { return strAuthorizeNet_x_fp_timestamp; }
  }

  private string strAuthorizeNet_x_login;
  public string AuthorizeNet_x_login
  {
    get { return strAuthorizeNet_x_login; }
  }
  private string strAuthorizeNet_x_test_request;
  public string AuthorizeNet_x_test_request
  {
    get { return strAuthorizeNet_x_test_request; }
  }
  private string strAuthorizeNet_x_amount;
  public string AuthorizeNet_x_amount
  {
    get { return strAuthorizeNet_x_amount; }
  }

  public string CardNumber
  {
    get
    {
      if (strAuthorizeNet_x_test_request.Equals("TRUE"))
      {
        return "4111111111111111";
      }
      return "";
    }
  }

  public string ExpirationDate
  {
    get
    {
      if (strAuthorizeNet_x_test_request.Equals("TRUE"))
      {
        return DateTime.Now.AddMonths(1).ToString("MM-yy");
      }
      return "";
    }
  }

  public string CCV
  {
    get
    {
      if (strAuthorizeNet_x_test_request.Equals("TRUE"))
      {
        return "123";
      }
      return "";
    }
  }
  public Confirm()
  {
    Load += Page_Load;
  }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the results&lt;/P&gt;&lt;PRE&gt;Field Name	Field Value
__EVENTTARGET	
ctl00$MainContent$x_zip	90210
ctl00$MainContent$btnSubmit	Complete the Purchase
__VIEWSTATE	/wEPDwUKMTUyMDk1...
__EVENTARGUMENT	
__EVENTVALIDATION	/wEWBALz78Ax...
__PREVIOUSPAGE	RsRhW_on3HU...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2011 00:18:59 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-DPM-Support-Textboxes-in-ASP-NET-Webform-C-Masterpages/m-p/19638#M10808</guid>
      <dc:creator>john1379</dc:creator>
      <dc:date>2011-12-03T00:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Does DPM Support Textboxes in ASP.NET, Webform, C#, Masterpages?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-DPM-Support-Textboxes-in-ASP-NET-Webform-C-Masterpages/m-p/19640#M10809</link>
      <description>&lt;P&gt;It is modify from SIM sample code.&lt;/P&gt;&lt;P&gt;It going to be something like this&amp;nbsp; on the aspx page&lt;/P&gt;&lt;PRE&gt;&amp;lt;asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server"&amp;gt;
	&amp;lt;input type='hidden' name='x_login' id='x_login' value='&amp;lt;%=x_login%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_amount' id='x_amount' value='&amp;lt;%=x_amount%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_description' id='x_description' value='&amp;lt;%=x_description%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_invoice_num' id='x_invoice_num' value='&amp;lt;%=x_invoice_num%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_fp_sequence' id='x_fp_sequence' value='&amp;lt;%=x_fp_sequence%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_fp_timestamp' id='x_fp_timestamp' value='&amp;lt;%=x_fp_timestamp%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' runat="server" name='x_fp_hash' id='x_fp_hash' value='&amp;lt;%=x_fp_hash%&amp;gt;' /&amp;gt;
	&amp;lt;input type='hidden' name='x_show_form' value='PAYMENT_FORM' /&amp;gt;
	&amp;lt;input type='hidden' name='x_relay_response' value='TRUE' /&amp;gt;
	&amp;lt;asp:Button ID="btnSubmit" runat="server" Text="Complete the Purchase" ClientIDMode="Static"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CssClass="button" /&amp;gt;
&amp;lt;/asp:Content&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Notice that it set the value like value='&amp;lt;%=x_fp_hash%&amp;gt;'&lt;/P&gt;&lt;P&gt;Then, on the codebehind&lt;/P&gt;&lt;PRE&gt;private string p_x_login;&lt;BR /&gt;protected string x_login&lt;BR /&gt;{&lt;BR /&gt;     get { return p_x_login; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; set { p_x_login = value; }&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This is the property for x_login input&amp;nbsp; value='&amp;lt;%=x_login%&amp;gt;', and do it for the rest of the fields.&lt;/P&gt;&lt;P&gt;and on the page_load&lt;/P&gt;&lt;PRE&gt;x_login = "10charcode";&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2011 01:18:00 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-DPM-Support-Textboxes-in-ASP-NET-Webform-C-Masterpages/m-p/19640#M10809</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2011-12-03T01:18:00Z</dc:date>
    </item>
  </channel>
</rss>

