Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

595 lines
21 KiB

  1. <%@ Page Language="C#" Inherits='UDDI.Web.UddiPage' %>
  2. <%@ Import Namespace="System.Web.Mail" %>
  3. <%@ Import Namespace="System.Text.RegularExpressions" %>
  4. <%@ Import Namespace="UDDI" %>
  5. <%@ Register TagPrefix="uddi" Namespace="UDDI.Web" Assembly="uddi.web" %>
  6. <%@ Register Tagprefix='uddi' Tagname='Header' Src='../controls/header.ascx' %>
  7. <%@ Register Tagprefix='uddi' Tagname='Footer' Src='../controls/footer.ascx' %>
  8. <%@ Register Tagprefix='uddi' Tagname='SideMenu' Src='../controls/sidemenu.ascx' %>
  9. <script runat='server'>
  10. private const string EmailSubjectBase = "UDDI Contact Us Inquiry: {{SITE}}";
  11. private const string CountryList = "United States|Canada|Afghanistan|Albania|"+
  12. "Algeria|American Samoa|Andorra|Angola|"+
  13. "Anguilla|Antarctica|Antigua and Barbuda|"+
  14. "Argentina|Armenia|Aruba|Australia|Austria|"+
  15. "Azerbaijan|Bahamas|Bahrain|Bangladesh|"+
  16. "Barbados|Belarus|Belgium|Belize|Benin|"+
  17. "Bermuda|Bhutan|Bolivia|Bosnia and Herzegovina|"+
  18. "Botswana|Bouvet Island|Brazil|"+
  19. "British Indian Ocean Territories|Brunei Darussalam|"+
  20. "Bulgaria|Burkina Faso|Burundi|Cambodia|Cameroon|"+
  21. "Canada|Cape Verde|Cayman Islands|"+
  22. "Central African Republic|Chad|Chile|"+
  23. "China, People's Republic of|Christmas Island|"+
  24. "Cocos Islands|Colombia|Comoros|Congo|Cook Islands|"+
  25. "Costa Rica|Cote D'ivoire|Croatia|Cuba|Cyprus|"+
  26. "Czech Republic|Denmark|Djibouti|Dominica|"+
  27. "Dominican Republic|East Timor|Ecuador|Egypt|"+
  28. "El Salvador|Equatorial Guinea|Eritrea|EemailTonia|"+
  29. "Ethiopia|Falkland Islands|Faroe Islands|Fiji|"+
  30. "Finland|France|France, Metropolitan|French Guiana|"+
  31. "French Polynesia|French Southern Territories|FYROM|"+
  32. "Gabon|Gambia|Georgia|Germany|Ghana|Gibraltar|"+
  33. "Greece|Greenland|Grenada|Guadeloupe|Guam|"+
  34. "Guatemala|Guinea|Guinea-Bissau|Guyana|Haiti|"+
  35. "Heard Island And Mcdonald Islands|Honduras|Hong Kong|"+
  36. "Hungary|Iceland|India|Indonesia|Iran|Iraq|"+
  37. "Ireland|Israel|Italy|Jamaica|Japan|Jordan|"+
  38. "Kazakhstan|Kenya|Kiribati|"+
  39. "Korea, Democratic People's Republic of|Korea, Republic of|"+
  40. "Kuwait|Kyrgyzstan|Lao Peoples Democratic Republic|"+
  41. "Latvia|Lebanon|Lesotho|Liberia|Libyan Arab Jamahiriya|"+
  42. "Liechtenstein|Lithuania|Luxembourg|Macau|Madagascar|"+
  43. "Malawi|Malaysia|Maldives|Mali|Malta|Marshall Islands|"+
  44. "Martinique|Mauritania|Mauritius|Mayotte|Mexico|Micronesia|"+
  45. "Moldova|Monaco|Mongolia|Montserrat|Morocco|Mozambique|"+
  46. "Myanmar|Namibia|Nauru|Nepal|Netherlands|Netherlands Antilles|"+
  47. "New Caledonia|New Zealand|Nicaragua|Niger|Nigeria|Niue|"+
  48. "Norfolk Island|Northern Mariana Islands|Norway|Oman|Pakistan|"+
  49. "Palau|Panama|Papua New Guinea|Paraguay|Peru|Philippines|"+
  50. "Pitcairn|Poland|Portugal|Puerto Rico|Qatar|Reunion|"+
  51. "Romania|Russian Federation|Rwanda|Saint Helena|"+
  52. "Saint Kitts and Nevis|Saint Lucia|Saint Pierre and Miquelon|"+
  53. "Saint Vincent and The Grenadines|Samoa|San Marino|"+
  54. "Sao Tome and Principe|Saudi Arabia|Senegal|Seychelles|"+
  55. "Sierra Leone|Singapore|Slovakia|Slovenia|Solomon Islands|"+
  56. "Somalia|South Africa|South Georgia and Sandwich Islands|Spain|"+
  57. "Sri Lanka|Sudan|Suriname|Svalbard and Jan Mayen|Swaziland|"+
  58. "Sweden|Switzerland|Syrian Arab Republic|Taiwan|Tajikistan|"+
  59. "Tanzania|Thailand|Togo|Tokelau|Tonga|Trinidad and Tobago|"+
  60. "Tunisia|Turkey|Turkmenistan|Turks and Caicos Islands|Tuvalu|"+
  61. "Uganda|Ukraine|United Arab Emirates|United Kingdom|United States|"+
  62. "United States Minor Outlying Islands|Uruguay|Uzbekistan|Vanuatu|"+
  63. "Vatican City State|Venezuela|Vietnam|Virgin Islands (British)|"+
  64. "Virgin Islands (U.S.)|Wallis And Futuna Islands|Western Sahara (Morocco)|Yemen|"+
  65. "Yugoslavia|Zaire|Zambia|Zimbabwe";
  66. private const string IndustryList = "Select Industry|Accounting|Architecture|Automotive|Banking Services|Communications|Construction|Consulting|Government|Health Care|Hospitality|Insurance|Legal|Marketing|Real Estate|Retail|Travel|Other";
  67. private const string EmailBodyBase = "" +
  68. @"
  69. <HTML>
  70. <HEAD>
  71. <STYLE>
  72. TABLE { font-family: tahoma; font-size: 10pt; text-align: left }
  73. .header { font-weight: bold; background-color: #11455D; color: white; border-bottom: 1px solid white; padding: 4px; padding-left: 5px; padding-right: 5px }
  74. .item { background-color: #eeeeee; color: black; border-bottom: 1px solid white; padding: 4px; padding-left: 5px; padding-right: 5px }
  75. </STYLE>
  76. </HEAD>
  77. <BODY>
  78. <TABLE cellspacing='0' cellpadding='0' border='0'>
  79. <TR><TD class='header'>First Name:</TD><TD class='item'>{{FNAME}}</TD></TR>
  80. <TR><TD class='header'>Last Name:</TD><TD class='item'>{{LNAME}}</TD></TR>
  81. <TR><TD class='header'>Email:</TD><TD class='item'>{{EMAIL}}</TD></TR>
  82. <TR><TD class='header'>Phone:</TD><TD class='item'>{{PHONE}}</TD></TR>
  83. <TR><TD class='header'>Company:</TD><TD class='item'>{{COMPANY}}</TD></TR>
  84. <TR><TD class='header'>Company Website:</TD><TD class='item'>{{COMPANYURL}}</TD></TR>
  85. <TR><TD class='header'>Address:</TD><TD class='item'>{{ADDRESS}}</TD></TR>
  86. <TR><TD class='header'>City:</TD><TD class='item'>{{CITY}}</TD></TR>
  87. <TR><TD class='header'>State/Province:</TD><TD class='item'>{{STATE}}</TD></TR>
  88. <TR><TD class='header'>Zip/Postal Code:</TD><TD class='item'>{{ZIP}}</TD></TR>
  89. <TR><TD class='header'>Country/Region:</TD><TD class='item'>{{COUNTRY}}</TD></TR>
  90. <TR><TD class='header'>Job Title/Function:</TD><TD class='item'>{{JOBTITLE}}</TD></TR>
  91. <TR><TD class='header'>Industry:</TD><TD class='item'>{{INDUSTRY}}</TD></TR>
  92. <TR><TD class='header'>Other Industry:</TD><TD class='item'>{{INDUSTRYTEXT}}</TD></TR>
  93. <TR><TD class='header'>Question Submitted From:</TD><TD class='item'>{{SITE}}</TD></TR>
  94. <TR><TD class='header' colspan='2'>Message Body:</TD></TR><TR><TD class='item' colspan='2'>{{QUESTION}}</TD></TR>
  95. </TABLE>
  96. </BODY>
  97. </HTML>
  98. ";
  99. protected string SiteName
  100. {
  101. get
  102. {
  103. if( 1==Config.GetInt( "Web.TestSite", 0 ) )
  104. {
  105. //
  106. // Test Site
  107. //
  108. return "Test Site";
  109. }
  110. else if( 1==Config.GetInt( "Web.BetaSite", 0 ) )
  111. {
  112. //
  113. // Beta Site
  114. //
  115. return "Beta Site";
  116. }
  117. else
  118. {
  119. //
  120. // Production Site
  121. //
  122. return "Production Site";
  123. }
  124. }
  125. }
  126. protected void Page_Load( object sender, EventArgs e )
  127. {
  128. PopulateDDL( Country, CountryList );
  129. PopulateDDL( Industry, IndustryList );
  130. }
  131. protected void Submit_Click( object sender, EventArgs e )
  132. {
  133. if( Page.IsValid )
  134. {
  135. string body = FormatEmailBody();
  136. string subject = EmailSubjectBase.Replace( "{{SITE}}", SiteName );
  137. MailMessage mail = new MailMessage();
  138. mail.Body = body;
  139. mail.Subject = subject;
  140. mail.To = Config.GetString( "Web.HelpEmail" , "[email protected]" );
  141. mail.From = Email.Text;
  142. mail.BodyFormat = MailFormat.Html;
  143. //
  144. // TODO: Review if we need to do custom error handling.
  145. //
  146. SmtpMail.Send( mail );
  147. RequestForm.Visible = false;
  148. CompleteForm.Visible = true;
  149. }
  150. }
  151. protected string FormatEmailBody()
  152. {
  153. string email = EmailBodyBase;
  154. email = email.Replace( "{{FNAME}}", FName.Text );
  155. email = email.Replace( "{{LNAME}}",LName.Text );
  156. email = email.Replace( "{{EMAIL}}",Email.Text );
  157. email = email.Replace( "{{PHONE}}",Phone.Text );
  158. email = email.Replace( "{{COMPANY}}", Company.Text );
  159. email = email.Replace( "{{COMPANYURL}}", CompanyUrl.Text );
  160. email = email.Replace( "{{ADDRESS}}", Address.Text );
  161. email = email.Replace( "{{CITY}}", City.Text );
  162. email = email.Replace( "{{STATE}}", State.Text );
  163. email = email.Replace( "{{ZIP}}", PostalCode.Text );
  164. email = email.Replace( "{{COUNTRY}}", ((null!=Country.SelectedItem) ? Country.SelectedItem.Text : "" ) );
  165. email = email.Replace( "{{INDUSTRY}}", ((null!=Industry.SelectedItem) ? Industry.SelectedItem.Text : "" ) );
  166. email = email.Replace( "{{INDUSTRYTEXT}}", IndustryText.Text );
  167. email = email.Replace( "{{QUESTION}}", Question.Text );
  168. email = email.Replace( "{{JOBTITLE}}", JobTitle.Text );
  169. email = email.Replace( "{{SITE}}", SiteName );
  170. return email;
  171. }
  172. protected void PopulateDDL( DropDownList ddl, string list )
  173. {
  174. string[] items = list.Split( "|".ToCharArray() );
  175. ddl.Items.Clear();
  176. foreach( string item in items )
  177. {
  178. ddl.Items.Add( item );
  179. }
  180. }
  181. </script>
  182. <uddi:StyleSheetControl
  183. Runat='server'
  184. Default='../stylesheets/uddi.css'
  185. Downlevel='../stylesheets/uddidl.css'
  186. />
  187. <uddi:PageStyleControl
  188. Runat='server'
  189. OnClientContextMenu='Document_OnContextMenu()'
  190. ShowHeader='true'
  191. Title="TITLE"
  192. AltTitle="TITLE_ALT"
  193. />
  194. <uddi:ClientScriptRegister
  195. Runat='server'
  196. Source='../client.js'
  197. Language='javascript'
  198. />
  199. <uddi:SecurityControl
  200. Runat='server'
  201. Id='security'
  202. />
  203. <form enctype='multipart/form-data' Runat='server'>
  204. <table width='100%' border='0' height='100%' cellpadding='0' cellspacing='0' >
  205. <asp:PlaceHolder
  206. Id='HeaderBag'
  207. Runat='server'
  208. >
  209. <tr height='95'>
  210. <td>
  211. <!-- Header Control Here -->
  212. <uddi:Header
  213. Runat='server'
  214. />
  215. </td>
  216. </tr>
  217. </asp:PlaceHolder>
  218. <tr>
  219. <td valign='top'>
  220. <TABLE width='100%' height='100%' cellpadding='0' cellspacing='0' border='0'>
  221. <tr>
  222. <td valign='top' bgcolor='#F1F1F1' width='200'>
  223. <uddi:SideMenu
  224. Runat='server'
  225. SelectedIndex='17'
  226. />
  227. </td>
  228. <td valign='top' >
  229. <TABLE width='100%' height='100%' cellpadding='10' cellspacing='0' border='0'>
  230. <tr>
  231. <td valign='top'>
  232. <table width='100%' cellpadding='0' cellspacing='0' border='0'>
  233. <tr height='15'>
  234. <td colspan='3'>&nbsp;</td>
  235. </tr>
  236. <tr valign='top'>
  237. <td width='100'>
  238. <IMG src='/images/trans_pixel.gif' border='0' width='1' height='1'>
  239. </td>
  240. <td>
  241. <IMG src='/images/contactus.gif' border='0'>
  242. </td>
  243. <td width='10'>
  244. <IMG src='/images/trans_pixel.gif' border='0' width='1' height='1'>
  245. </td>
  246. </tr>
  247. <tr valign='top'>
  248. <td colspan='3'>
  249. <hr color='#629ACE' size='1' width='95%' >
  250. </td>
  251. </tr>
  252. <tr valign='top'>
  253. <td width='20'>
  254. <IMG src='/images/trans_pixel.gif' border='0' width='1' height='1'>
  255. </td>
  256. <td>
  257. <asp:Panel
  258. Runat='server'
  259. Id='RequestForm'
  260. Visible='true'
  261. >
  262. <!-- BEGIN RequestForm -->
  263. <table width='100%' cellpadding='0' cellspacing'0' border='0' >
  264. <tr>
  265. <td>
  266. <p>
  267. The answers to your UDDI questions can be found fastest in:
  268. <br>
  269. <b>a.</b> <a href="/about/FAQ.aspx" style="font-weight=bold;">Frequently Asked
  270. Questions</a> (FAQ�s) on this site
  271. <br>
  272. <b>b.</b> <a href="/help/default.aspx" style="font-weight=bold;">Help</a> on
  273. this site � for the how-to basics
  274. <br>
  275. <b>c.</b> At <a href="http://www.uddi.org" style="font-weight=bold;" target="_new">
  276. www.uddi.org</a> (Technical queries, in particular).
  277. </p><br>
  278. </td>
  279. </tr>
  280. <tr>
  281. <td>
  282. <table width='100%' cellpadding='3' cellspacing'3' border=0' >
  283. <tr>
  284. <td width='250'>
  285. First Name*
  286. <asp:RequiredFieldValidator
  287. Runat='server'
  288. ControlToValidate='FName'
  289. Text='(Required)'
  290. CssClass='Error'
  291. />
  292. </td>
  293. <td>
  294. <uddi:UddiTextBox
  295. Runat='server'
  296. Id='FName'
  297. Width='250'
  298. />
  299. </td>
  300. </tr>
  301. <tr>
  302. <td width='250'>
  303. Last Name*
  304. <asp:RequiredFieldValidator
  305. Runat='server'
  306. ControlToValidate='LName'
  307. Text='(Required)'
  308. CssClass='Error'
  309. />
  310. </td>
  311. <td>
  312. <uddi:UddiTextBox
  313. Runat='server'
  314. Id='LName'
  315. Width='250'
  316. />
  317. </td>
  318. </tr>
  319. <tr>
  320. <td width='250'>
  321. Email Address*
  322. <asp:RequiredFieldValidator
  323. Runat='server'
  324. ControlToValidate='Email'
  325. Text='(Required)'
  326. CssClass='Error'
  327. />
  328. <uddi:EmailValidator
  329. Runat='server'
  330. ControlToValidate='Email'
  331. ResolveHost='false'
  332. Text='(Invalid Email)'
  333. />
  334. </td>
  335. <td>
  336. <uddi:UddiTextBox
  337. Runat='server'
  338. Id='Email'
  339. Width='250'
  340. />
  341. </td>
  342. </tr>
  343. <tr>
  344. <td width='250'>
  345. Phone
  346. </td>
  347. <td>
  348. <uddi:UddiTextBox
  349. Runat='server'
  350. Id='Phone'
  351. Width='250'
  352. />
  353. </td>
  354. </tr>
  355. <tr>
  356. <td width='250'>
  357. Company
  358. </td>
  359. <td>
  360. <uddi:UddiTextBox
  361. Runat='server'
  362. Id='Company'
  363. Width='250'
  364. />
  365. </td>
  366. </tr>
  367. <tr>
  368. <td width='250'>
  369. Company Website
  370. </td>
  371. <td>
  372. <uddi:UddiTextBox
  373. Runat='server'
  374. Id='CompanyUrl'
  375. Width='250'
  376. />
  377. </td>
  378. </tr>
  379. <tr>
  380. <td width='250'>
  381. Address
  382. </td>
  383. <td>
  384. <uddi:UddiTextBox
  385. Runat='server'
  386. Id='Address'
  387. Width='250'
  388. />
  389. </td>
  390. </tr>
  391. <tr>
  392. <td width='250'>
  393. City
  394. </td>
  395. <td>
  396. <uddi:UddiTextBox
  397. Runat='server'
  398. Id='City'
  399. Width='250'
  400. />
  401. </td>
  402. </tr>
  403. <tr>
  404. <td width='250'>
  405. State/Province
  406. </td>
  407. <td>
  408. <uddi:UddiTextBox
  409. Runat='server'
  410. Id='State'
  411. Width='250'
  412. />
  413. </td>
  414. </tr>
  415. <tr>
  416. <td width='250'>
  417. Zip/Postal Code
  418. </td>
  419. <td>
  420. <uddi:UddiTextBox
  421. Runat='server'
  422. Id='PostalCode'
  423. Width='250'
  424. />
  425. </td>
  426. </tr>
  427. <tr>
  428. <td width='250'>
  429. Country/Region
  430. </td>
  431. <td>
  432. <asp:DropDownList
  433. Runat='server'
  434. Id='Country'
  435. Width='250'
  436. />
  437. </td>
  438. </tr>
  439. <tr>
  440. <td width='250'>
  441. Job Title/Function
  442. </td>
  443. <td>
  444. <uddi:UddiTextBox
  445. Runat='server'
  446. Id='JobTitle'
  447. Width='250'
  448. />
  449. </td>
  450. </tr>
  451. <tr>
  452. <td width='250'>
  453. Industry
  454. </td>
  455. <td>
  456. <asp:DropDownList
  457. Runat='server'
  458. Id='Industry'
  459. Width='250'
  460. />
  461. </td>
  462. </tr>
  463. <tr>
  464. <td width='250'>
  465. If other industry, specify:
  466. </td>
  467. <td>
  468. <uddi:UddiTextBox
  469. Runat='server'
  470. Id='IndustryText'
  471. Width='250'
  472. />
  473. </td>
  474. </tr>
  475. <tr>
  476. <td width='250'>
  477. What is your question?
  478. </td>
  479. <td>
  480. <uddi:UddiTextBox
  481. Runat='server'
  482. Id='Question'
  483. TextMode='MultiLine'
  484. Height='100'
  485. Width='250'
  486. />
  487. </td>
  488. </tr>
  489. <tr>
  490. <td align='right' valign='bottom'>
  491. </td>
  492. <td><uddi:UddiButton
  493. Runat='server'
  494. Id='Submit'
  495. Text='Submit'
  496. OnClick='Submit_Click'
  497. /></td>
  498. </tr>
  499. </table>
  500. </td>
  501. </tr>
  502. </table>
  503. <!-- END RequestForm -->
  504. </asp:Panel>
  505. <asp:Panel
  506. Runat='server'
  507. Id='CompleteForm'
  508. Visible='false'
  509. >
  510. <!-- BEGIN CompleteForm -->
  511. Your email has been sent.<br><br>
  512. Thank you,<br>
  513. &nbsp;&nbsp;<b><i>UDDI Team</i></b><br>
  514. <!-- END CompleteForm -->
  515. </asp:Panel>
  516. </td>
  517. <td width='10'>
  518. <IMG src='/images/trans_pixel.gif' border='0' width='1' height='1'>
  519. </td>
  520. </tr>
  521. </table>
  522. </td>
  523. </tr>
  524. <tr>
  525. <td>
  526. <asp:PlaceHolder
  527. Id='FooterBag'
  528. Runat='server'
  529. >
  530. <tr height='95'>
  531. <td>
  532. <!-- Footer Control Here -->
  533. <uddi:Footer
  534. Runat='server'
  535. />
  536. </td>
  537. </tr>
  538. </asp:PlaceHolder>
  539. </td>
  540. </tr>
  541. </table>
  542. </td>
  543. </tr>
  544. </table>
  545. </td>
  546. </tr>
  547. </table>
  548. </form>