国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

WebPoll in C#[Vs.net Bate2 等級:中 高]

2024-07-10 12:58:16
字體:
來源:轉載
供稿:網友

webpoll in c# is implemented as a user control in a vs.net  beta2 project. the database behind the control is sql server, but it could easily be moved to access. i needed a webpoll for my site, saw one done on asptoday in vbscript for regular asp. i made a few modifications and converted the project to .net and c#.  a working copy of the webpoll can be viewed at http://72t.net (what i really do in life) or at http://dn.yyyz.net (the initial conversion of my personal site).  

as you play, please send me any changes and suggestions for improving the code - i'm still learning both .net and c#.  if you implement the poll on your site, you should probably use at least two answers to each question - a one question poll doesn't make much sense. the number of answers isn't limited - enter as many as you like. using different poll ids, you can have multiple polls running on the same site at the same time.

things to look for in the code:

construction of a table with rows and cells in the c# code behind page.
adding radio buttons and text to individual table cells.
implementing a submit button and handler from the code behind page.
stepping through a group of radio buttons to query for the checked button.
use of cookies to overcome multiple answers from the same computer.
use of classes for both the question and answers
main files:

default.aspx - a page used to implement the control. the control is registered. two items, the poll id and the connection string are passed to the webpoll control
webpoll.ascx - the html portion of the control. this page only has a placeholder control that is used as a place holder. all the code (tables, etc.) are constructed in the code behind class.
webpoll.ascx.cs - the code behind class - the control is built entirely in the .cs code behind page. look through the actual page for comments and explanation. it builds two tables, one to ask the questions and one to show the results.
webpoll.sql - the sql query file (created by sql 2000) that will create the tables used by the webpoll control - questions go in  'pollquestions' table and the answers go in the 'pollanswers '.
webpoll.htm - this page
possible improvements (if you make any, please let me know) :

a user interface that could be used to add or delete questions - in this version, you have to enter the items into the database tables manually.
a button that would allow viewing the results of previous polls.
converting the existing usercontrol to a full web control.
source code
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 镇安县| 襄樊市| 镇平县| 淮北市| 安泽县| 定襄县| 达日县| 东至县| 巧家县| 梓潼县| 罗田县| 夏邑县| 沈阳市| 南开区| 东明县| 柞水县| 鞍山市| 莱阳市| 桂平市| 柯坪县| 安阳县| 恩平市| 泽普县| 盱眙县| 邵武市| 揭东县| 沙洋县| 西丰县| 临西县| 米脂县| 绥阳县| 寿光市| 哈密市| 英德市| 嵊泗县| 宁晋县| 饶河县| 汶上县| 松滋市| 虹口区| 崇文区|