ASP.NET Regular Expression - Dont allow website url - asp.net

I am using ASP.net 4.5 with bootstrap.
Below is the code I have to allow only certain characters.
How can I change this to allow the characters a-zA-Z0-9_. /,&|()!- but not allow the user to put in http or www.
<input type="text" class="form-control" name="subject" id="subject" placeholder="Enter subject"
data-bv-message="The subject is not valid."
data-bv-notempty="true" data-bv-notempty-message="The subject is required and cannot be empty."
data-bv-regexp="true" data-bv-regexp-regexp="^[a-zA-Z0-9_. /,&|()!-]+$" data-bv-regexp-message="The subject can only consist of alphabetical, number, dot and underscore."
/>

I would say you might have to add groups for the words you don't want to have in your input value.
((!|www)|(!|http))
You can also take a look at this answer to a similar question, there you should get enough input to fix your expression

Related

HTML5 input pattern not working in input type="number"

I used input pattern in input type="text" its working
its working code
<input name="name" required pattern=".{4,}" title="Please Enter Correct Name" type="text" />
But when I used input pattern in input type="number" its not working
<input name="number" required type="number" pattern=".{9,20}" title="Please Enter Your Number at least 9 Digit" />
From MDN
A regular expression that the control's value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is text, search, tel, url, email, or password, otherwise it is ignored.
The pattern attributes only works with text, date, search, url, tel, email, and password input types: HTML5 input specification. Scroll down a bit and you will see a table telling you which attributes can be used with the different input types.
You should use javascript to achieve what you want to do.
The pattern attribute works with the following input types: text, date, search, url, tel, email, and password.
Therefore you can't use it with input number
You can check here
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
https://www.w3.org/TR/html5/forms.html#the-input-element

chart.apis.google.com returns error 400

Yesterday I have run extensive DNS tests with namebench, since my current DNS server is giving me lots of problems. The problem is that all resulting Google Charts are failing to load. This never happened to me, though. I looked at the source for the HTML page returned by namebench, and opened the links for the graphs, and they return the HTTP error 400.
One sample URL:
http://chart.apis.google.com/chart?chxt=y%2Cx%2Cx&chd=e%3AEmE8FXFeFfFqFwFxFxFzF9GEGGGKGLGOGQGRGSGSGTGWGYGcGdGdGdGeGhGiGjGlGqGqGqGqGvGwGxGxG0G0G0G1G2G4G5G7G9G-G-HAHAHEHGHKHLHMHMHNHPHRHWHWHYHYHZHaHeHiHiHjHkHkHlHmHnHnHoHoHpHqHsHtHtHuHwHxHyHzHzH0H1H2H2H7H9H9H-H-H.H.IAIAIBIBICIDIEIGIHILINININIOIQIRIRISIWIWIZIaIdIdIhIiIiIlImInIoIqIqIsIsIwIyIyIzI0I0I4I4I8I9I.JBJBJBJCJCJCJCJGJGJHJJJKJMJPJRJSJUJUJXJXJYJYJZJaJbJdJdJeJfJgJgJnJoJpJpJpJqJsJsJtJuJvJvJxJzJ3J7J-J-J.KAKAKBKCKCKDKEKFKFKGKIKLKMKMKOKPKQKQKRKSKSKSKTKUKVKWKXKaKaKcKjKjKmKrKsKtKuKxKzKzK2K3K3K4K4K5K6K7LALALBLBLELFLGLHLILILMLOLPLRLVLVLaLaLdLeLjLpLpLrLsLvLxLzLzL1L4L4L6L6L8L-MBMBMBMCMGMHMIMJMJMLMUMWMaMcMcMcMgMiMiMmMoMqMvMyM2M2M5M7M8M8M-M.NANMNZNdNoNqNrN0N2OFOGOPOWOcOiOqO6O7PBPDPRPSPhPvPxQeQrQsRQRtSOSUSgTBTVTkUKU9VIWQYWY0ZRZsaNbPbYcEc8dkftmvpTtEuZ4d.7&chxp=0%7C2%2C1155&chxr=1%2C0%2C2570%7C2%2C-128.5%2C2698.5&chxtc=1%2C-720&chco=0000ff&chbh=a&chs=720x415&cht=bhg&chxl=0%3A%7CSuomi%204%20FI%7CDiveo%20MX%7CNetscalibur%20IT%7CTDA%20DZ%7CGlobecomm%20Systems%20A2%7C128.199.248.105%7C192.71.211.211%7CPokoeln%20DE%7C103.241.0.207%7CGaoland-2%20FR-2%7C41.185.78.25%7C103.25.56.238%7C84.200.83.161%7C163.47.20.30%7CFortressITX%20US%7C163.47.21.44%7C103.25.202.192%7CReynwood%20Comm%20US%7C151.236.20.236%7C295.ca-2%20CA-2%7C106.185.41.36%7CChristiania%20DK%7CGradwell-2%20GB%7C213.183.57.55%7Crdsar%20RO%7CIPLAN-2%20AR%7C192.71.218.218%7CTelefonica%20Centroamerica%20SV%7C192.71.247.247%7CAS520.net%20EU%7C178.17.170.67%7CFast%20GB%7CCETIC%20Algeria%20DZ%7COpole%20PL%7CGaoland-1%20FR%7CIsik%20Universitesi%20TR%7CBatelco-2%20JO%7CHamilton%20Hydro%20/%20FibreWired%20CA%7C88.82.109.9%7C31.220.5.106%7CMeganet%20US%7CnFrame-1%20US%7CRDSNet-2%20RO-2%7CGlobal%20Crossing%20snv%20US%7CDNS-Roots%20NYC%20US%7CUnifiedroot-2%20NL%7CCaucasus%20Online%20GE%7C217.78.6.191%7COceanic%20Cable%20US%7CFirmRadio%20UA%7CCodetel%20DO%7CUnifiedroot-1%20NL%7CRDS%20Pitesti%20RO%7CGlobalNet-2%20MT%7C8e6%20Technologies%20US%7CGibNet/Sapphire%20GI%7C151.236.29.92%7CUnifiedroot-6%20NL%7CGibnet/Sapphire-2%20GI%7CSunrise-3%20CH%7CCA-DNS/Verizon-2%20CA%7CVozTelecom%20ES%7CComput%20RU%7CInfoTelecom%20ES%7CSATCOM%20Systems%20A2%7Ceuroweb%20RO%7CInternap-2%20US%7C23.226.230.72%7CSloboda%20UA%7CPlant%20Telecom/InfoAve%204%20US%7CNeo%20ES%7C104.245.33.185%7CInFlow%20San%20Diego%20US%7CFrii-2%20US%7CDPN%20Duss%20DE%7CETB%20CO-3%7CMobtel%20Srbija%20SR%20RS%7C192.71.249.249%7C104.219.55.89%7C62.141.38.230%7CEUItalia%204%20IT%7CAmnet%20Honduras%20HN%7CEUItalia%203%20IT%7CStarnet%20MD%7CG-Tel%20Azteca%20MX%7CMkData%20SE%7CTtnet%2039%20TR%7CDiveo-2%20MX%7CRSSPNet%20RU%7CMiconet%20PL%7CNeterra%20BG%7CETB-2%20CO%7CMovistar-2%20ES%7Cbbsyd%20DK%7CTelusMobility%203%20CA%7CAll2Easy/Modesto%20US%7CHydro%20One%20CA%7C37.187.0.40%7CETB%20CO-2%7CTtnet%2040%20TR%7CADAM%20ES%7CUni-Ljubljana%20SI%7CPLD-2%20US%7C78.47.34.12%7CInfracom%20Network%20Application%20IT%7CCellNet%20BG%7CUltraVPN-2%20FR%7CMT-2%20MK%7CTelcel-1%20MX%7CAirbites%20Lviv-2%20UA%7CTelio-2%20NO%7CDTAG%20L%20DE%7CMaxcom%20MX%7C31.220.43.191%7CRadiant-2%20CA%7CIndigo%20IE%7CProfiber%20DK%7CETB%20CO%7CTelcel-2%20MX%7CBatelco-1%20JO%7C178.79.174.162%7CAPUA%20inet-2%20AG%7CBresnan-2%20US%7Clandsraad%20ES%7CaltoHiway-2%20GB%7CTNG-2%20DE%7CNavega-2%20GT%7CCable.net%20CO%7CUU%20EU%200702%20DE%7CZugernet%20CH%7CBHI-2%20US%7CCesnet%20CZ%7Cxtdnet%20NL%7CAmigo-2%20GT%7CDTAG%20H%20DE%7CBerlin%20CCC%20DE%7CEOL-2%20HU%7C108.61.210.58%7CUni%20Ulm%20DE%7CSWISP-2%20GB%7CWiBand%20CA%7CMindark%20SE%7CCyberus-3%20CA%7CAlharbitelecom%20GB%7CBright/Horizontel%20US%7CHurricane%20Electric%7CAvalonia%20DK%7C95.85.9.86%7CVTX%20Datacomm%20CH%7CUSB%20Skynet%20VE%7CByteCamp-2%20DE%7CMIPPS%20INC%20CA%7CKELCOM/Cybersurf-2%20CA%7CClearwire%20WAR%20US%7CKELCOM/Cybersurf%20CA%7CWIND-2%20IT%7CO2%20Ireland-2%20IE%7CNavega%20GT%7CSWISP%20GB%7CNTT%20EU%20GB%7C69.28.67.83%7CReflact%20DE%7CPLD%20US%7CNefarious%3F%20US%7CClara.net%20DE%7CBlueWin%20CH%7CDTAG-F%20DE%7CUU%20EU%200300%20FR%7CAvalonia-3%20DK%7CNumericable-2%20FR%7CGorgeNet-2%20US%7C104.245.39.112%7CWiTopia%20US%7CSprint%20PCS/brbnca-2%20US%7CTelefonica%20CentroAmerica%20GT%7CSATCOM%20Systems-2%20A2%7Cmtweb/transaria%20US%7CBT%20Alliance/INFONET%20US%7CBluewin%202%20CH%7CAEBC-4%20CA%7CInternap%20US%7CMonzoon%20ZRH-2%20CH%7CAvalonia-2%20DK%7CBluewin-4%20CH%7Calharbitelecom%20GB%7CBsoCom%20FR%7CSvenskaKyrkan%20SE%7COpalSolutions-3%20GB%7CCirque%20DK%7CUU%20EU%20206%7CIndigo%20IE-2%7CTital%20Internet%20GB%7CTime%20Warner%20TOSA-2%20US%7CPaeTec%20Ana-7%20US%7CSpeakeasy%20Seattle%20US%7CCSInet%20US%7CGreat%20Lakes%20Internet%20US%7CMultiband%20Corporation%20US%7CUU%20EU-3%20GB%7CColo4Dallas%20US%7CUU%20EU-201%20NL%7CHerakles%20Sacremento%20US%7CBestel-2%20MX%7CNetworkOnline%20US%7CUU%20EU%20400%7CUnited%20Online%20VGS%20US%7CSprint%20PCS%20Chi-2%20US%7CIntrinsec%20FR%7CEircom-2%20IE%7CTELUS%20Mobility-2%20CA%7CU.%20of%20British%20Columbia%20CA%7CUU%20EU%205a%20GB%7CCox-7%20US%7CRIO%20Networks%20US%7CAmigo%20GT%7CBHI%20US%7CFortalnet%20BR%7CSprint%20PCS%20brbncar12%20US%7CUUnet-EU4%20GB%7CUU%20EU%200703%20DE%7CAirband%20US%7CCityNet%203%20US%7CMonzoon%20CH%7CG-Tel%20Maya%20MX%7CGlobal%20Crossing%20Phoenix-2%20US%7CExceed%20Tech%20US%7CInternap%20Seattle-2%20US%7CInFlow%20ATL%20US%7CU%20of%20Houston-1%20US%7CTriad%20Telecom%20US%7CHorizon%20Cable%20Stinson-2%20US%7CPOBOX%20internet%20GB%7CCox-6%20US%7CO1%204%20US%7CVerizon%20Seattle%20US%7CDynGuide-2%7CPNAP-LON-2%20GB%7CSungard%20Inflow%20US%7CTELUS%20Mobility%20CA%7CACNUSA%7CEU%20BT%20AMS%20NL%7CGigaDNS%20BR%7CNeonova%20Network%20Services%20US%7CVerizon%20Dial-Up%20TX%20US%7CCA-DNS/Verizon%20CA%7CSYS-127.0.0.1%7CGEUS%7CExeculink%20CA%7C295.ca%20CA-2%7CInternap%20Seattle%20US%7CCyberNet%20Comm%20US%7CInterap%20LAX-2%20US%7CHydro%20One-2%20CA%7CUmich%20ITD-2%20US%7CVT%20ISB%20US%7CPrimary%20US%7CU.%20of%20Texas%20at%20San%20Antonio%20US%7CCox%20Oklahoma%20City-2%20US%7CInternap%20LAX%20US%7CMSU%20ATS%20US%7CSpeedNet%20Michigan%20US%7CSprintlink%7CSpirit%20Telecom%20US%7CSprint%20PCS/ekrg-2%20US%7CAPI%20Digital%20US%7CTelwest%20US%7CU%20of%20Houston-2%20US%7CPaeTec%20Chicago%20CA%7CInternap%20SJE%20US%7CVerizon%20NC%20Opt-Out%20US%7CSogetel-2%20CA%7CPathway%20CA%7CInternap%20Denver%20US%7CCybersurf%20CA%7CSprint%20PCS%20Ft.%20Worth%20US%7CEasytel%203%20US%7CSprint%20PCS/atlng%20US%7CDistributel-2%20CA%7CExeculink%20CA-2%7CUU%20Cache-6%20US%7CCable%20%26%20Wireless%20DE-3%7CISP%20Alliance%2C%20INC%20US%7CDnet-3%20US%7CDSL%20Extreme-2%20US%7CInternap%20ACS%20US%7CSBC/AT%26T%20Global-2%20US%7CPNAP%20London%20GB%7CUOL%20BR%7CVerizionBusiness%20US%7CInternap%20Houston%20US%7CCox%20Oklahoma%20City%20US%7CDSL%20Extreme-5%20US%7CSprint%20PCS%20Ft.%20Worth-2%20US%7CMCI-3%20US%7CFlow%20Jamaica-4%20JM%7CSecureDesigns-2%20US%7CDynGuide%7CUnited%20Online%20DCA%20US%7CU.%20of%20Michigan%20US-2%7CWvfiber%20US%7CVerizon%20NY%20Opt-Out%20US%7CAPI%20Digital-2%20US%7CiPrimus%20NJ%203%20US%7CInternap%20CHI%20US%7CBright.net%20US%7CCable%20%26%20Wireless%20DE%7CNetStar%20US%7CTerra-2%20BR%7CYMAX%20US%7CAlma%20Telco-2%20US%7CDnet-4%20US%7CAlma%20Telco%20US%7CUU%20Dial%2060%20US%7CSBC%20Clobal%20TX-2%20US%7CVerizon%20Dallas%20US%7CUltraDNS-2%7CLevel%203/GTEI-2%7CComodo%20Secure%20DNS%7CRadiant%20Alberta%20CA%7CSpeedNet-2%20Michigan%20US%7CEarthlink%20Opt-Out%20US-2%7CUU%20Cache%20US%7CMetConnect-1%20US%7CEarthlink%20Opt-Out%20US%7CUU%20Cache-2%20US%7CQwest-2%20US%7CAccess%20Northeast%20US%7CIntap%20US%7CComodo%20Secure%20DNS-2%7CVideotron%20Phone-4%20CA%7CUU%20Cache-7%20US%7CVerizon%20Boston%20US%7CInternap%20WDC%20US%7CTDS%208%20US%7C1scom%20US%7CVerizon%20NC%20US%7CEarthlink%20Ms%20US%7CNTT-2%7CInternap%20CHG%20US%7CQwest%20Redirect%20US%7CUU%20Cache-5%20US%7CSBC/AT%26T%20Global%20US%7CCIMCO-2%20US%7CLevel3-R2%7CUU%20Cache-4%20US%7CNorton%20DNS-2%20US%7CUU%20Cache-3%20US%7CBullEye%20Telecom%20US%7CCIMCO%20US%7CQwest%20US%7CWtechlink/Pacinfo/AT%26T-2%20US%7CInternap%20CHG-2%20US%7CUU%20Cache-2%20US-2%7CInternap%20Boston%20US%7CInternap%20Philadelphia%20US%7CWtechlink/AT%26T-2%20US%7CInternap%20NYC-2%20US%7CLevel3-R1%7CRCN%20ATW-2%20US%7CCogent%20WDC%20US%7CVerizon%20Philadelphia%20US%7CLevel%203/GTEI-4%7CAT%26T%20ASM%20US%7CSBC%20San%20Diego%20US%7CAT%26T%20New%20Orleans%20US%7CInternap%20NYC%20US%7COpenDNS%7COpenDNS-3%7CGenuity%20BAK%7CGoogle%20Public%20DNS-2%7CGoogle%20Public%20DNS%7C1%3A%7C0%7C320%7C640%7C960%7C1280%7C1600%7C1920%7C2240%7C2560%7C2570%7C2%3A%7CDuration%20in%20ms.
The whole HTML file I have uploaded here.
Created a fiddle with your code.
From the google developers image charts documentation
Specifying your chart as a URL in your browser or an tag is
called a GET request. Making a GET request is simple, but GET URLs are
limited to 2K characters. What if you have more data than that?
Luckily, the Chart API supports HTTP POST for chart requests up to 16K
long. The trade-off is the added complexity of using POST.
The first solution becomes using a POST . The link also contains examples of POST using either a form element, javascript or php.
The URL length limitation -
The maximum length of a URL is not determined by the Google Chart API,
but rather by web browser and web server considerations. The longest
URL that Google accepts in a chart GET request is 2048 characters in
length, after URL-encoding (e.g., | becomes %7C). For POST, this limit
is 16K.
The second solution: The same link provides the next type of solution, which is actually reducing the URL length :
If you are using a text encoding data format, remove leading zeros from numbers, remove trailing zeros after decimal points, and round or truncate the numbers after decimal points.
If that does not shorten the URL enough, use simple (1 character) or
extended (2 character) encoding.
Sample data less frequently; i.e., reduce granularity.
Remove accoutrements and decorations, such as colors, labels, and
styles, from your chart.
The first solution
This one applies for the first 2 charts , which have around 8000 characters which fit in a POST request (<16000):
<h2>Mean Response Duration</h2>
<h3>Fastest Individual Response Duration</h3>
i.e. you will have to write a POST through one of the methods described.
The second solution
This applies for the last 2 charts for which you get a 413 (Request Entity Too Large) status on get. These last 2 characters have around 20 000 characters, and the last 60 000 characters.
<h3>Response Distribution Chart (First 200ms)</h3>
<h3>Response Distribution Chart (Full)</h3>
Here you will indeed need to make the URL shorter through one of the methods advised. That is, shorter than 16000.
For testing purposes you could use a form such as this and change the parameters with what you need. Working fid
<form action='https://chart.googleapis.com/chart' method='POST' target="graph_target">
<input type="hidden" name="cht" value="lc" />
<input type="hidden" name="chtt" value="This is | my chart" />
<input type='hidden' name='chs' value='600x200' />
<input type="hidden" name="chxt" value="x,y" />
<input type='hidden' name='chd' value='t:40,20,50,20,100'/>
<input type="submit" />
</form>
<iframe name='graph_target' src='' style='width:600px;height:200px;'></iframe>
<script type="text/javascript">
document.forms["graphform"].submit();
</script>

RegEx stops working when placed into ValidationExpression

I have a text box where a user enters their email address. I need to prevent people using certain email addresses, as this is for corporate (B2B) use.
Can anyone help me with the RegEx which would return false if email addresses contain #gmail or #yahoo?
So far I have this (thanks to #Sabuj) #(yahoo|gmail)\. but when placed into a RegularExpressionValidator it doesn't work:
<asp:RegularExpressionValidator ValidationExpression='#(yahoo|gmail)\.' runat="server" ControlToValidate="txt_email" />
Having read MSDN for more info, I've also tried this but it still returns true regardless of the content entered:
<asp:RegularExpressionValidator ValidationExpression='^(#(yahoo|gmail)\.)$' runat="server" ControlToValidate="txt_email" />
Since e-mail addresses have a complex syntax (more complex than most people realise, for instance, they can contain comments [RFC 822 ยง 3.4.3]), I'd suggest not using regex at all for this. Instead, use a "proper" e-mail parser, then ask the parser for the domain part of the address.
Use this:
<asp:RegularExpressionValidator ValidationExpression=".*#(?!(yahoo|gmail)).*" ControlToValidate="txt_email" runat="server" ErrorMessage="Yahoo and Gmail disallowed"></asp:RegularExpressionValidator>
The validation expression property should be set to match the entire string.
But my regex .*#(?!(yahoo|gmail)).* matches the whole email. So it works :)
You don't need ^ or $ since the string is gonna be a single line.
Also don't forget to add type="email" to your txt_email. It will automatically take care of whether it is a valid email or not.
If the error msg appears, then it isn't valid, but if it doesn't appear, then it is absolutely valid.
I've come up with ^.*#(?!(yahoo|gmail)).*$
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" ValidationExpression="^.*#(?!(yahoo|gmail)).*$" runat="server" ControlToValidate="txt_email" Text="No free email accounts allowed" />
This will allow any text to pass the validator that doesn't contain #yahoo or #gmail.
Don't forget to check Page.IsValid in your code behind, and to include an <asp:ValidationSummary runat="server" /> in your .aspx.
You can use this regex to check whether the mentioned emails are containing or not:
#(gmail|yahoo|mailinator|guerrillamail|dispostable)\.

Classic ASP: How to see list of parameters passed from form submission?

I'm coming from Rails so I'm a little lost since this is my first time touching ASP.
I'm working on a legacy ASP app and I have a form in classic ASP and there are two inputs. How would I view and use the parameters so that I can use them to update my records? Are they stored in some sort of variable by default? And do I do this on the page of the form or the page after?
My input:
<input class="textboxsm" type="text" onkeypress="return numbersonly(window.event.keyCode,1)" onblur="poswarnings(1);updateTotals();" onfocus="rowfocus=0" value="2" maxlength="4" size="2" name="ia1" style="text-align:right;">
And this is the button that submits the form:
<input width="116" type="image" height="70" onmouseout="this.src='art/order_continue.gif'" onmouseup="this.src='art/order_continue.gif'" onmousedown="this.src='art/down_order_continue.gif'" onclick="return orderdone()" name="submitorder" alt="Done" src="art/order_continue.gif">
So how would I extract the value from my input?
Values sent via POST are stored in the Request.Forms collection. Items passed via query string are in the Request.QueryString collection.
Depending on your setup, you can access the values a number of different ways. Most commonly, people know what form fields to expect, so if you have:
<input type="text" name="Title" maxlength="200" size="90" />
Assuming your form method is POST, you would retrieve it on the page the form is posted to by:
strTitle = Request.Form("Title")
This does assume you have already defined strTitle, and the value is not null/empty/etc. and/or that you are checking for that later on...
You're pulling the value of the form item named "Title" from the Request.Form collection and assigning it to the variable strTitle (which should have been defined earlier) From there you can do whatever validation you need to do.
The only thing that would change if you were sending the request via GET instead of POST is you would use the Request.QueryString collection - like so:
strTitle = Request.QueryString("Title") 'Same assumption as before...

Handling Arrays of HTML Input Elements with Request.Form Like PHP

How can I properly receive these Array of Inputs on asp.net?
<input type=hidden name='field[name][]' value='alex' />
<input type=hidden name='field[name][]' value='mark' />
<input type=hidden name='field[name][]' value='helen' />
<input type=hidden name='field[age][]' value='22' />
<input type=hidden name='field[age][]' value='30' />
<input type=hidden name='field[age][]' value='29' />
In php you can access field by $field = $_POST["field"]
$field["name"] and $field["age"] are simply arrays containing names and ages.
actually, it does exist with asp.net. - you can use
string[] MyTest = Request.Form.GetValues("MyTest");
or
string[] MyTest = Request.QueryString.GetValues("MyTest");
You can use a standard string split - this is all php does for you behind the scenes. PHP is not a strongly typed language however which means that it is a LOT easier for them to provide the "appearance" of this functionality.
The reality is that php is just allowing you to provide comma delimited input and it automatically splits it for you.
So... if you want to do this in asp.net, you can use the same input name a number of times and it will be returned with the request object as a comma delimited list. I would not recommend using this approach for user entered input, but it will work fine if you are contrrolling the input like combining a list into a hidden input from a jquery script.
To get your head around what is happening (with php too.. all web dev techs are using the same http rules), just try posting a form with an input (don't set runat server) that is there twice.
<input type="text" name="MyTest" value="MyVal1" />
<input type="text" name="MyTest" value="MyVal2" />
On pageload add this
if(IsPostBack)
{
Response.Write(Request["MyTest"]);
}
You should see
MyVal1,MyVal2
On the screen.
Now, if you want this into an array, you can:
string[] myvals = Request["MyTest"].Split(',');
if you want Integers or other datatypes (php doesn't know/care what a datatype is really), you will have to loop through it and parse it into another array/generic list.
I don't know what your wanting as an end result, but understanding what the browser posts back is the first step and the short answer is...
Yes, ASP.NET can do this to (just a little more manually).
These are not arrays of inputs. HTML doesn't have a concept of arrays.
These are simply groups of inputs with the same name.
What are you trying to achieve? Why are you not using server side controls?
Update:
You can access the Request.Forms collection - it will hold the posted form elements.
Alternatively, use server side controls - you will be able to access these by ID.

Resources