Master C# Logo banner
Welcome to MasterCSharp.com - Master C#, the easy way... - by Saurabh Nandu

 


Creating a Poll Application - Creating the Poll module - Part 2

Add Comment
 

 
<div align="center"> <table width="75%" class="outline"> <tr> <td width="40%" class="outline"><b>Download</b></td> <td width="25%" class="outline"><b>SDK</b></td> <td class="outline"><b>Code Charge Studio</b></td> </tr> <tr> <td width="40%" class="outline"> <a class="wbox" href="../../file/pollapp-part2.zip">pollapp-part2.zip</a> (123kb)</td> <td width="25%" class="outline">v1.0.3705</td> <td class="outline">v1.0.7</td> </tr> </table> </div> <p> <span class=wboxheado>Introduction</span><br> In the <a class="wbox" target="_blank" href="http://www.mastercsharp.com/article.aspx?ArticleID=83&&TopicID=16">last part</a> of the Poll application article, I showed you how to create the Administration section of the Poll application using CodeCharge Studio. In this article I will cover the creation of the Poll module which will be used to handle the voting as well as creation of the results page that will display the results of the poll.</p> <p><span class=wboxheado>CodeCharge Studio Project</span><br> <br> <span class=wboxhead>PollModule User Control</span><br> The PollModule User Control will be used to display the poll question along with the list of the related answers. The user can select a particular answer and vote. Since generally we do not create a separate page for voting, instead we create a section within the index/home page of the site that contains the Poll module, hence we need to create this page as a <i>User Control</i> (Includable Page in CCS) so that it can be included within other pages. <br> Open the <b>PollApp</b> project we created in the last part in CodeCharge Studio and add select <i>File menu -&gt; New -&gt; Page</i> to start the <i>Add New Page</i> dialog. Enter the name of the blank page as <b>PollModule</b> and click <i>OK</i>. This will create add a new page in the project and display it in Design view. </p> <p>Since we want to create this page as a User Control we do not need the <i>Header</i> and <i>Footer</i> controls on this page, hence select the Header and Footer controls from the Design view of the PollModule page and delete them. To select a control in the Design view, click on the image of the control, this will automatically select the full control. The red rectangle in figure 1 shows the image for the Header control that should be clicked to select the Header control.</p> <p align="center"> <img border="0" src="../../img/simplepollpart201.gif" width="117" height="28"><br> <b>Figure 1:</b> Header User Control</p> Keeping the PollModule page selected in Design view move to the <i>Properties</i> window and change the <i>Includable</i> property to <b>Yes</b>. This will instruct CodeCharge Studio to convert this page into a User Control that can be included in other pages.<p align="center"> <img border="0" src="../../img/simplepollpart202.gif" width="145" height="136"><br> <b>Figure 2:</b> Includable property</p> Once our User Control has been setup, we move on to create a Record form. Select <i>Record Builder</i> from <i>Toolbox, Builders</i> tab. In the first step keep all the properties the same, since we will be using the same database connection and click <i>Next</i>. Select the <i>Data Source</i> as <b>vote_details</b>. Transfer the <b>vote_name</b> and <b>vote_desc</b> fields into the <i>Fields for the Record</i>&nbsp; listbox and click <i>Next</i>. (See figure 3 for all the properties for this step)<p align="center"> <img border="0" src="../../img/simplepollpart203.gif" width="460" height="364"><br> <b>Figure 3:</b> Data source for the Record form<p align="left"> In the actions panel for the <i>Define Record Options</i> step uncheck all the actions. This is done since we want to just display the poll question but not allow anyone to change it. Hence removing all the actions will result in just the selected fields being displayed as labels. Click <i>Next</i>, to come to the Theme step, select the Theme as <b>InLine</b> (as we have chosen it for rest of the application earlier) and click <i>Finish</i> to generate the record form. You might be presented with a warning dialog (figure 4), this dialog just informs that the Header and Footer controls were not found on the designer surface and would you like to permanently delete reference to them for this page. Click <i>Yes</i> since we do not want these controls anymore.<p align="center"> <img border="0" src="../../img/simplepollpart204.gif" width="386" height="327"><br> <b>Figure 4:</b> Synchronization warning<br></p> Once the page is generated it should look like figure 5. This would currently not resemble a standard Poll module, so we need to modify the HTML design a bit so that it looks appropriate.<p align="center"> <img border="0" src="../../img/simplepollpart205.gif" width="217" height="225"><br> <b>Figure 5:</b> PollModule page</p> Basically, I have merged to two columns, since it does not look appropriate to show the Column headers for the record. To merge the columns, select them in Design view, right-click and select <i>Merge Cells</i> from the context menu. Also select the <i>vote_name</i> label in Design view, and click the <i>Bold</i> button on the toolbar to make it bold as shown in figure 6 below.<p align="center"> <img border="0" src="../../img/simplepollpart206.gif" width="201" height="191"><br> <b>Figure 6:</b> Modified Record form</p>Record forms auto-generated by CodeCharge Studio usually take the <i>ID</i> (Unique Identity Column) field of the record in the query string of the page and display the relevant details depending upon the Record ID. And that's exactly how the current Record form is configured. <br> But in our Poll Module, we will not work with the Record ID, instead we want to show that Poll which has been marked as <i>Active</i> by the administrator. At any given time only 1 poll can be marked as active. Hence we need to modify the SQL Query used to populate this Record form so that it automatically displays the Active poll details. <p>In <i>Project Explorer</i> or Design view select the <b>vote_details</b> Record form and move to the <i>Properties window, Data</i> tab. Select the <img border="0" src="../../img/simplepollpart2-button.gif" width="18" height="18"> button from the <i>Data Source</i> property to start the SQL query designer. We use the <i>Data Source</i> dialog to modify the SQL query used to populate the Record form.</p> <p align="center"> <img border="0" src="../../img/simplepollpart207.gif" width="160" height="311">&nbsp;&nbsp;&nbsp;&nbsp; <img border="0" src="../../img/simplepollpart208.gif" width="148" height="158"><br> <b>Figure 7 :</b> Selecting the vote_details Record form in Project Explorer<br> <b>Figure 8:</b> Selecting the Data Source property of the Record form in Properties window</p> The <i>Data Source</i> dialog of CodeCharge Studio needs some explanation, since its a very important dialog and very useful while you are generating your custom queries. Figure 9 shows the various important parts of the <i>Data Source</i> dialog, the parts are marked in Red by me. <p align="center"> <img border="0" src="../../img/simplepollpart209.gif" width="566" height="435"><br> <b>Figure 9:</b> Data Source dialog</p> <p><i>1) Connection</i> - Choose the connection for your form. If you have multiple database connections in your project you can switch between them. You can also click the <img border="0" src="../../img/simplepollpart2-button.gif" width="18" height="18"> button to add/edit/remove the connection.</p> <p><i>2) Data Source Type</i> - Choose the source for your form. You can choose between <i>Table</i> / <i>Procedure</i> / <i>SQL</i>. If you choose <i>Table</i>, you can design the SQL queries using the CodeCharge Studio SQL Designer. This is the default option. Choose <i>Procedure</i> if you want your form to interact with Stored Procedures written in the database. The last <i>SQL</i> option allows you to enter your own custom SQL query directly. If your SQL query returns any results you can see the results by clicking the <i>Review Data</i> button, but remember if you SQL query takes parameters then this button will be of no use since without the parameters no data will be returned!</p> <p><i>3) Table / View</i> - This option changes depending upon the <i>Data Source Type</i> you select. If the <i>Table</i> is select as the data source, then you can select the table name for the form. Also clicking on the <i>Build Query</i> button will start the SQL query designer. </p> <p><i>4) Query Parameters</i> - In case <i>Table</i> is selected as the <i>Data Source</i>, this listbox displays all the parameters for the SQL query, generally these parameters are a part of the WHERE clause of the SQL query.</p> <p><i>5) Add Parameter</i> - Used to add new parameters for the query.</p> <p><i>6) Remove Parameter</i> - Used to remove existing parameters.</p> <p><i>7) Parameter Properties</i> - Used to configure the properties of an parameter.</p> <p><i>8) Order By</i>- Used to set the sort order of the data returned from the database. </p> Coming back to our example, select the first parameter in the <i>Data Source</i> dialog and click the minus ( - ) button to remove this parameter, since as explained above we do not want to use the default criteria to view the record. Now click the <i>Add Parameter </i>( + ) button to setup a new <i>Table Parameter</i>. <br> The <i>Table Parameter</i> dialog is very useful while setting up parameters for your SQL query (figure 10).&nbsp; There are two ways you can use this dialog by changing the <i>Condition Type</i>, either in <i>Parameter</i> mode and set things up using the given UI, or in <i>Expression</i> mode where&nbsp;you have full freedom to setup your own parameters.<br> Also a point worth mentioning is that you can define multiple source for the <i>Parameter source</i>, like <i>Expression</i> / <i>URL</i> / <i>Session</i> / <i>Application</i> / <i>Form</i> and <i>Cookie</i>. CodeCharge studio will automatically generate the necessary code to read values from the specified source. So for example you want to read the value from the query string, set the <i>Parameter source Type </i>to <i>URL</i>. <p>For our example setup the values as shown below can click <i>OK</i> and then <i>OK</i> again to close the <i>Data Source</i> dialog. Basically, we are setting the parameter such that the <b>vote_active</b> field should equal to <b>true</b>. Hence only the active record will be displayed.</p> <p align="center"> <img border="0" src="../../img/simplepollpart210.gif" width="574" height="272"><br> <b>Figure 10:</b> Table Parameter dialog</p> This finishes the setup for the Poll question, now we need to setup a radiobuttonlist that will display all the relevant options and the Vote button. <p>Keep your cursor in the <i>{vote_desc }</i> fields cell (Design view), right-click and select <i>Insert Row</i> from the context-menu to insert a new row above the current row. Again right-click and select <i>Move Row Up</i> to move the current row above the new inserted row.</p> <p>Go to the <i>Toolbox -&gt; Forms</i> tab and drag a <i>Radiobutton</i> into the newly inserted row, also drag a <i>Button</i> into the footer of the Record form. Hence the modified Record form looks like figure 11.</p> <p align="center"> <img border="0" src="../../img/simplepollpart211.gif" width="159" height="257">&nbsp; <br> <b>Figure 11:</b> Modified Record form</p> We need to setup the Radiobutton to display the appropriate options for the current Poll. Select the Radio button in Design view and then go to the <i>Properties window -&gt; Data tab</i> and set up the properties as shown in Figure 12. Setting these properties will bind the Radio button to the <b>vote_items</b> table. The text for each Radiobutton will be picked from the <b>vote_item_name</b> column and the value from the <b>vote_item_id</b> columns. Also since the value of the Radiobuttons will be of integer type, we need to setup the <i>Data Type</i> as <b>Integer</b>, please don't forget this else you might get errors! Finally, validation is set for the Radio buttons by setting the <i>Required</i> property to <b>Yes</b>.<p align="center"> <img border="0" src="../../img/simplepollpart212.gif" width="188" height="250"><br> <b>Figure 12:</b> Radiobutton Properties</p> Also we need to setup the Radiobutton to show items of the current poll only, hence we need to modify its SQL query. Click on the <img border="0" src="img/simplepollpart2-button.gif" width="18" height="18"> button next to the <i>List Data Source</i> property to open the <i>Data Source</i> dialog. in the <i>Data Source</i> dialog click the <i>Build Query</i> button to open the <i>Visual Query designer</i>. Right-Click anywhere in the designer surface and select <i>Add Table</i> from the context-menu. Select the <i>vote_details</i> table from the <i>List of Tables</i> dialog and click <i>Add</i>. You will see that the <i>Visual Designer</i> automatically links the tables based on their relation. Then check the appropriate fields from the tables as shown in figure 13 and click <i>OK</i> to close the <i>Visual Query designer</i>.<p align="center"> <img border="0" src="../../img/simplepollpart213.gif" width="288" height="223"><br> <b>Figure 13:</b> Table Relations</p> The reason we have performed the above step is to JOIN the two tables based on their relation. Now we add a parameter that will allow us to select the appropriate vote items for only the currently active poll. Click the <i>Add Parameter</i> ( + ) button in the <i>Data Source</i> dialog. Fill-up the properties for the new <i>Table Parameter</i> similar to figure 10 and click <i>OK</i> to close the <i>Table Parameter</i> dialog and then click <i>OK</i> again to close the <i>Data Source</i> dialog also. This finishes the setup of the Radiobutton.&nbsp; <p>Now we move on to configure the button which will submit the Poll. If u go through the entire tutorial you will realize that we have not even written a single line of C# code yet!! Still we have managed to generate so many functional database driven pages! This is the reason why CodeCharge Studio is so useful, since it automates a lot of your monotonous tasks for designing database driven web pages. </p> <p>Select the <i>Button</i> in Design view and from the <i>Properties window -&gt; Format</i> tab change the <i>class</i> property to <b>InLineButton</b> to set the css style for the button and the <i>Value</i> property as <b>Vote!</b>. If you remember I had mentioned in the overview of the Poll application that we will monitor the IP address of the user voting to prevent multiple votes from the same person. This calls for some custom code, rather than a simple insert statement. Hence we will have to add Custom Code for the Button's server-side <b>OnClick</b> event (Note: CodeCharge Studio's events do not necessarily map to all the events exposed by the selected control).<br> Shift to the <i>Events</i> tab in the <i>Properties</i> window and right-click the <i>Server -&gt; On Click</i> event, select <i>Add Code</i> from the context-menu (figure 14).</p> <p align="center"> <img border="0" src="../../img/simplepollpart214.gif" width="188" height="175"><br> <b>Figure 14:</b> Add custom code</p> The above action will change the Design view to the Code view and the editor will navigate to the point you should insert your custom code (figure 15).&nbsp;Also a comment is generated for you indicating the location you should insert the code. So replace the line <i>// Write your own code here.</i> with your actual code. <p><span class=wboxhead>Why to use CodeCharge Studio Events?</span><br> I am sure this question might be brewing in minds of a lot of you as to why do you need to use CodeCharge Studio event, when you can directly switch to code view and start writing your code!! <br> If you see the Code view for any page, you will find that most of the code is shown with a grey background, and if you insert any code the background turns white. The reason for this is that CodeCharge studio needs to be able to track the changes made to the code and lock/unlock it appropriately. For example, say there is some auto-generated code used to generate the Grid form and you go ahead and modify it in Code view. Now you switch back to Design view and make some changes again to the Grid, at this point CodeCharge Studio comes at a critical cross-road. Should it overwrite the changes you have made manually in Code view or should it not not allow any new changes? And another BIG question remains <i>How does CodeCharge Studio keep track changes made by the user in the code?</i> None of the two approaches are justified in all scenarios so CodeCharge takes a different path.<br> All the code auto-generated by CodeCharge Studio is shown with a grey background and the editor is free to modify it. As soon as you enter any custom code, the background for that potion of the code turns white, indicating custom code and the editor will not touch that code at all! <br> Now in normal programming its common for you to enter your code in-between CodeCharge Studio's methods, so CodeCharge Studio provides <i>Events </i>(hooks) within its own generated methods where you can enter your custom code. If you insert custom code within the CodeCharge Studio generated event, only that portion of the method will remain locked rest of the functional auto-generated code will still be available for modification to the IDE internally. </p> <p>In case you did not get my above point, just remember that if you want to add Custom Code in CodeCharge Studio always use the <i>Events</i> defined by CodeCharge Studio as we are doing now. Also in case you want to enter new methods/page level variables then you can add them in the white spaces between the auto-generated methods.</p> <p align="center"> <img border="0" src="../../img/simplepollpart215.gif" width="484" height="318"><br> <b>Figure 15:</b> Code View - Custom Action</p> Finally, its time for us to see some C# code!! Copy the code from the listing below and paste it into the CodeCharge Studio Code editor. The code below uses the <b>SqlCommand</b> object which is a custom CodeCharge Studio generated object. This object exposes a variety of methods that can be used to interface the database, in the code below we use the <b>ExecuteScalar</b> and <b>ExecuteNonQuery</b> methods of this object. This object is very useful since it interfaces the database in a Managed Provider neutral way, i.e. you use the same object to communicate with the SqlClient / OleDb or Odbc managed provider. Also this object takes care of opening and closing database connections. The constructor of the <b>SqlCommand</b> class takes two parameters, the first is the SQL Query to execute and the second is the <b>DataAccessObject</b> to use to interface the database. <br> For each <i>Connection</i> you create in your project, a <i>Static DataAccessObject</i> property is generated in the <b>Settings</b> class to access that database.<br> All CodeCharge Studio's object use the <b>DataAccessObject</b> to interface with the database.<p>The code below is pretty trivial the first SQL query selects the <b>vote_id</b> of the active record, this value is used in our consequent queries. The second query gets the count of records having the same IP address as the current user and the currently active <b>vote_id</b>. If no rows are returned it means the user if voting for the first time, so we store his vote in the third and fourth query. <br> &nbsp;</p> <table cellpadding="1" cellspacing="2" width="100%" class="code"> <tr> <td width="100%"><pre><span class=cmt>//Select the vote_id for the active Poll</span> SqlCommand voteIdCmd = new SqlCommand( &quot;SELECT vote_id FROM vote_details WHERE vote_active=true&quot;, Settings.VoteDBDataAccessObject ); string voteId = voteIdCmd.ExecuteScalar().ToString(); <span class=cmt>//Get the count of votes casted by the particular IP //for the particular vote_id</span> SqlCommand ipCmd = new SqlCommand( &quot;SELECT Count(*) FROM user_votes WHERE &quot; + &quot; vote_id=&quot; + voteId+ &quot; AND user_ip='&quot;+ Request.ServerVariables[&quot;REMOTE_ADDR&quot;] +&quot;'&quot; , Settings.VoteDBDataAccessObject ); <span class=cmt>//Check if the user has already voted</span> if( ((int)ipCmd.ExecuteScalar()) == 0) { <span class=cmt>//Update the Results</span> SqlCommand updtResults = new SqlCommand(&quot;UPDATE vote_items SET vote_results = (vote_results +1 ) WHERE vote_item_id=&quot; + item.RadioButton1.Value , Settings.VoteDBDataAccessObject ); updtResults.ExecuteNonQuery() ; <span class=cmt>//Insert the users vote</span> SqlCommand userAdd = new SqlCommand( &quot;INSERT INTO user_votes (vote_id,vote_item_id,user_ip,vote_date) &quot;+ &quot; VALUES (&quot; + voteId +&quot; , &quot;+item.RadioButton1.Value + &quot;, '&quot; + Request.ServerVariables[&quot;REMOTE_ADDR&quot;]+&quot;' , #&quot; + DateTime.Now.ToString() +&quot;#)&quot; , Settings.VoteDBDataAccessObject ); userAdd.ExecuteNonQuery() ; }</pre></td> </tr> </table> <p>This virtually completes the implementation of our PollModule, only one small tweak left is to set the <i>Return Page</i> property of the button from the <i>Property explorer -&gt; Data</i> tab. This property indicates the page where the user should be redirected after he submits the button. Ideally, this would be the <b>PollResults</b> page we will create in the next step. You can either currently set the <i>Return Page</i> property after selecting it from Design view to <b>PollResults.ccp</b> or you can do this later, but just don't forget this step !!</p> <p><span class=wboxhead>PollResults - Results Page</span><br> The PollResults page is the last step in the implementation of the Poll Application. Now, there are a lot of fancy ways you can display the results, but I will be just creating a simple page that displays PollResults.</p> <p>Go to <i>File menu -&gt; New -&gt; Page </i>and add a blank page with the name <b>PollResults</b>. Delete the Header and Footer controls that are created by default, since they relate to Administrative option. Select the Record builder from the <i>Toolbox</i> and build the first Record for similar to what you have built for the PollModule, up to figure 10. Set all the properties and make all the changes as displayed in the above steps so that your form will be able to display the currently active Poll details (see figure 16 and 17). <br> The only difference is that we delete the rows above and below the Record form, since we do not need them.</p> <p align="center"> <img border="0" src="../../img/simplepollpart216.gif" width="216" height="228">&nbsp; <img border="0" src="../../img/simplepollpart217.gif" width="152" height="180"><br> <b>Figure 16:</b> Original Poll Results form<br> <b>Figure 17:</b> Modified Poll Results form</p> The above record form will display the <i>Subject</i> and the <i>Question</i> from the <b>Vote_Details</b> table. We need to use another Grid form to display the list of options for the active Poll and its results. In Design view keep the cursor after the end of the Record form and select the <i>Grid Builder</i> from the <i>Toolbox -&gt; Builders</i> tab to start the <i>Grid Builder</i>. Click <i>Next</i> on the first screen since we are to use the same database connection. On the next screen set the <i>Data Source</i> as <b>vote_items</b> since we want to use the <b>vote_items</b> table and set up the other properties as shown in figure 18 and click <i>Next</i>. <p align="center"> <img border="0" src="../../img/simplepollpart218.gif" width="460" height="364">&nbsp; <br> <b>Figure 18:</b> Grid Data Source </p> In the <i>Search Options</i> step click <i>Next</i>, since we do not want to setup a search for our Grid form. On the <i>Define Grid Options</i> step select <i>No Sorting</i> and <i>No Page Navigator</i> options since the following functionality are not needed and click <i>Next</i>. Select the <b>InLine</b> Theme on this step and also check the <i>Alternate Records</i> checkbox so that alternate records in the Grid have different colors. Finally, click <i>Finish</i> to complete the Grid form setup, the generated grid should look like figure 19 below:<p align="center"> <img border="0" src="../../img/simplepollpart219.gif" width="336" height="141"><br> <b>Figure 19:</b> Vote Items Grid</p> The Grid of Poll items has been setup, but we need to configure it so that only the list of items from the currently active Poll are displayed. Select the Grid in Design view and click on the <img border="0" src="img/simplepollpart2-button.gif" width="18" height="18"> button from <i>Properties</i> window, <i>Data tab -&gt; Data Source</i> property, to open the <i>Data Source</i> dialog. In the <i>Data Source</i> dialog click on the <i>Build Query</i> button (see figure 9) and then from the <i>Visual Query Builder</i> link the <b>vote_items</b> and <b>vote_details</b> table as shown in figure 20 (steps to perform the link-up have already been explained earlier) and then click <i>OK</i>.&nbsp; <p align="center"> <img border="0" src="../../img/simplepollpart220.gif" width="271" height="187"><br> <b>Figure 20:</b> Table Relations</p> Even though we do not select any fields from the <b>vote_details</b> table, we need to perform the earlier step to create a join between the tables. Now click on the <i>Add Parameter</i> button (see figure 9) and setup the <i>Table Parameter</i> as shown in figure 10 and click <i>OK</i> to setup the condition for our Grid to display only items for the active Poll. Click <i>OK</i> again to close the <i>Data Source</i> dialog. <p><span class=wboxhead>Default - PollModule hosting page</span><br> The above steps being a virtual end to our implementation of the PollModule. But if you remember we have implemented the PollModule as a user control, so in order to use this User Control you need to embed it in a page. In practical implementation of the of the application, it might be the Home page of your application, but for testing purpose we will create a separate page. <br> Start the <i>New Page</i> dialog from <i>File menu -&gt; New -&gt; Page</i> and select the <i>Blank Page</i> with the name <b>Default</b> and click <i>OK</i> to create a new page. Select the Header and Footer controls added on the new page and delete them from Design view. <br> Now go to the <i>Toolbox, Forms</i> tab and select <i>Includable Page</i>, in the Include Page dialog set the <i>Control name</i> to <b>PollModule</b> and <i>Page to include</i> as <b>PollModule.ccp</b>. Always Remember you can only include pages marked as <i>Includable</i> in CodeCharge Studio. Also <i>*.ccp</i> is the file expansion used by CodeCharge Studio pages. <br> Click <i>OK</i> to close the dialog.</p> <p align="center"> <img border="0" src="../../img/simplepollpart221.gif" width="456" height="147"> <br> <b>Figure 21: </b>Include Page dialog</p> <span class=wboxheado>Testing the Application</span><br> The above steps complete the implementation of the Poll application. We can <i>Save</i> and <i>Publish</i> the project so that the project is compiled and stored on our web server. Now start the browser and point it towards <i>http://localhost/PollApp/admin.aspx</i> i.e. the link to the Admin login page. Enter <i>admin</i>/<i>admin</i> as the credentials (these were created in the last part) and login. The select the <i>Poll Details</i> link and add fill up the record form on the <i>vote_detai_list.aspx</i> page. Make sure the <i>Vote Active</i> field is checked, to make the newly added Poll active. Once the Poll is added click the <i>Vote Items</i> link in the header to move to the <i>vote_items_list.aspx</i> page. Here enter the relevant options for our Poll Items. Keep the <i>Vote Id</i> field as <b>1</b> (this is the vote_id column from the Vote Details table) and let the <i>Vote Results</i> field be <b>zero</b> (in further article we'll change this so that zero is automatically set). Once appropriate poll items have been setup, its time to test the Poll. <br> Point the browser to <i>http://localhost/PollApp/Default.aspx</i> page and you should be presented with the currently active poll with the appropriate options. Select an option and click the&nbsp; <i>Vote!</i> button, your poll should be recorded and you will be transferred to the <i>PollResults</i> page. Also remember, we are restricting the user from voting multiple times, so if you try to vote again from the same IP address then your vote will not be recorded!!<p><span class=wboxheado>Conclusion</span><br> In this 2 part's series of building a Poll Application using CodeCharge Studio, we have touched upon many important aspects of using CodeCharge Studio. Also we have clearly seen some of the advance features of CodeCharge Studio like Visual Query Designer, User Controls as well as the CodeCharge Studio Events used to enter custom code. I have taken care to touch upon detailed aspects of creating database driven application in CodeCharge Studio. In future parts I might look as some customization options.

Comments

Add Comment