blank.gif
triangle.gif Du er her: /  Forsiden  /  Javascript  /  Asp-net-c-sharp    
blank.gif
blank.gif
tl.gif Curriculum Vitae (da) tr.gif tl.gif Certificeringer tr.gif tl.gif Erhvervskvalifikationer tr.gif tl.gif Java-udvikler tr.gif tl.gif Kurser tr.gif tl.gif Personlighed tr.gif tl.gif Profil tr.gif tl.gif Projekter tr.gif tl.gif Resultater tr.gif tl.gif Sprogkundskaber tr.gif tl.gif Uddannelse tr.gif
blank.gif
blank.gif
arrow-headline.gif Navigation
arrow-headline.gif Artikler
 

Demo af følgende javascript funktionalitet

De følgende demo samples viser dig hvordan man opretter en singleton i javascript og hvordan man kan kode en dato formatter og formatere et beløb med det locale der er gældende for dit område

Demo af javascript og ASP med inklude filer

Denne kode viser dig, hvordan du kan inkludere javascript som ASP filer C# and .NET framework

Eksemplet viser hvordan man ved hjælp af javascript og ASP inklude filer med .NET framework og C# kan formatere et beløb og en dato

<%
'/**
' * Test of the *.js
' * @package javascript 
' * @filesource 
' * @see index.php
' * @copyright (c) http://Finn-Rasmussen.com
' * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
' * @author http://Finn-Rasmussen.com
' * @version 1.11
' * @since 27-nov-2009
' */
%>
<html>
<head>
<title>Test of ASP and .NET and C# javascript include files</title>
<script type="text/javascript">
<%
'// First you must include the js - jsp files to use
%>
<!-- #include file="CountryCode.js.asp" -->
<!-- #include file="LanguageCode.js.asp" -->
<!-- #include file="Locale.js.asp" -->
<!-- #include file="DateFormat.js.asp" -->
<!-- #include file="Amount.js.asp" -->
<!-- #include file="AmountFormat.js.asp" -->
<!-- #include file="Request.js.asp" -->
<%
'// Get the current Locale
dim language
dim country
language = "da" ' Danish
country  = "DK" ' Denmark
%>
var thisLocale = Locale.getInstance('<%=language%>', '<%=country%>');
</script>
</head>
<body>
<h4>Test of javascript date and amount formatters with asp include</h4>
<p>This demo file will show you have to use the javascript asp include files</p>
<p>First you have to include the javascript js.asp files, like this:</p>
<ul><li><script type="text/javascript" 
   src="/myphp-1.11/myphp-1.11-js/html/asp/CountryCode.js.asp"></script> </li></ul>
<p>Then you must create the form elements like this:</p>
<ul><li><input type="text" name="date[0]"   value="$date0"    size="10" 
     maxlength="10" onblur="this.value=DateFormat.format(this.value)" /></li></ul>
<%
'// Test data
dim date0
dim date1
dim date2
dim date3
dim amount0
dim amount1
dim amount2
dim amount3

date0 = "01-01-2007"
date1 = "31-12-2007"
date2 = "11-12-2007"
date3 = "30-11-2007"
amount0 = "1,01"
amount1 = "100.001,00"
amount2 = "1.234.567,89"
amount3 = "10,00"
%>
<style type="text/css">
.AlignRight { text-align: right; }
</style>
<form name="theForm">
  <label>Paymentdate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Amount</label><br />
  
  <input type="text" name="date[0]"   value="<%=date0%>"    
  size="10" maxlength="10" onblur="this.value=DateFormat.format(this.value)" />
  
  <input type="text" name="amount[0]" value="<%=amount0%>"  
  size="15" maxlength="40" onblur="this.value=AmountFormat.format(this.value)" 
  class="AlignRight" /><br />
  
  <input type="text" name="date[1]"   value="<%=date1%>"    
  size="10" maxlength="10" onblur="this.value=DateFormat.format(this.value)" />
  
  <input type="text" name="amount[1]" value="<%=amount1%>"  
  size="15" maxlength="40" onblur="this.value=AmountFormat.format(this.value)" 
  class="AlignRight" /><br />
  
  <input type="text" name="date[2]"   value="<%=date2%>"    
  size="10" maxlength="10" onblur="this.value=DateFormat.format(this.value)" />
  
  <input type="text" name="amount[2]" value="<%=amount2%>"  
  size="15" maxlength="40" onblur="this.value=AmountFormat.format(this.value)" 
  class="AlignRight" /><br />
  
  <input type="text" name="date[3]"   value="<%=date3%>"    
  size="10" maxlength="10" onblur="this.value=DateFormat.format(this.value)" />
  
  <input type="text" name="amount[3]" value="<%=amount3%>"  
  size="15" maxlength="40" onblur="this.value=AmountFormat.format(this.value)" 
  class="AlignRight" /><br />
</form>

<script type="text/javascript">
document.theForm['date[0]'].focus();
document.theForm['date[0]'].select();
</script>
</body>
</html>
triangle.gif

Dansk

Deutch

English (UK)

France

Italy

Norsk

Svensk

English (USA)


 
blank.gif
triangle.gif Copyright @ 1999-2010 www.Finn-Rasmussen.com Powered by myPHP Version (5.3.3-7+squeeze3) 1.11
blank.gif
Valid XHTML 1.0 Strict Valid CSS!