国产探花免费观看_亚洲丰满少妇自慰呻吟_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
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 三台县| 特克斯县| 陵川县| 扶余县| 全椒县| 彰化市| 通山县| 饶阳县| 壤塘县| 麦盖提县| 沭阳县| 台前县| 堆龙德庆县| 密云县| 四会市| 丰都县| 水富县| 忻城县| 平阴县| 若羌县| 略阳县| 赤水市| 鸡西市| 天津市| 攀枝花市| 常熟市| 时尚| 宝丰县| 中阳县| 澄江县| 偏关县| 五莲县| 安多县| 高尔夫| 军事| 靖宇县| 贵南县| 梁山县| 台南市| 石棉县| 眉山市|