- 热门文章:
- · Form code generator V1.1 by Steve Schofield[bate2 等级:中级](转载:aspfree)
- · asp.net key considerations(一)从前用惯了asp的朋友看看这个吧,大家常问的如Request等问题解答得很清楚
- · 使用DataList进行3层编历
- · part1: ShowIssueCat.aspx.cs
- · part2: ShowIssueCat.aspx
- · DataNavigateUrlFormatString的使用方法
- · ASP.NET XML/XSL Transforms(转载www.aspalliance.com)
- · Hiding/Manipulating Databound Items(转载www.aspalliance.com)
- · 无刷新的聊天室的制作兼谈组件制作和ClientSide Script(一)
- · 关于异常捕获
- · 无刷新的聊天室的制作兼谈组件制作和ClientSide Script(二)
- · 转贴:用ASP.NET结合XML制作广告管理程序
WebPoll in C#[Vs.net Bate2 等级:中 高]
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
相关文章:
- · 转贴:用ASP.NET结合XML制作广告管理程序(2)
- · ASP.NET: Dynamically set Text and Value fields for a DropDownList
- · asp.net优化(二)
- · DotNet中定制自己的表格
- · 回答讨饭猫之asp.net优化(一)
- · Common ASP.NET Code Techniques (DPC&DWC Reference)--8
- · Common ASP.NET Code Techniques (DPC&DWC Reference)--7
- · Common ASP.NET Code Techniques (DPC&DWC Reference)--9
- · 转转: ASP 内建对象Request和Respones
- · 关于.net的自定义控件(请各位大虾指正)
- · 转: ASP.NET高级应用 (2)
- · 转: ASP.NET高级应用 (1)
- · 转: ASP.NET高级应用 (3)
- · DPC: Creating a multicolumn Dropdownlist[等级:初 中]
- · DPC:Hiding Columns In A DataGrid[等级:初 中]
- · DPC:Creating a DataBound List of Radio Buttons--PART1[等级:中]
- · DPC:Creating a DataBound List of Radio Buttons--PART2[等级:中]
- · DPC:Creating a DataBound List of Radio Buttons--预览页面source code[等级:中]
- · .NET几大热点问题(转)
- · DataList控件也玩分页 (转自aspcn.com)
- · 用 StringBuilder 类替代 String
- · 杂志目录(页面部分CodeBehind)
- · 杂志目录(数据库访问部分)
- · 杂志目录(页面部分)
- · 推荐一个免费的CSharp编辑器
- · 使用JScript.NET创建asp.net页面(二)
- · 使用JScript.NET创建asp.net页面(三)
- · 使用JScript.NET创建asp.net页面(四)
- · 使用JScript.NET创建asp.net页面(五)
- · 使用JScript.NET创建asp.net页面(六)
- · 使用JScript.NET创建asp.net页面(七)
- · 有好东西不要自己藏着,拿出来大家分享啊,这是我的:关于bate2的MD5加密方法.
- · 转:ASP.NET验证控件详解
- · 在ASP.NET中获取文件属性
- · datalist分页(codebehind部分)
- · datalist分页(cj168.DataAccess.MagsDB中的2个方法)
- · datalist分页(页面部分)
- · .net beta2 操作cookie的例子(转)
