Asked by:
The PollControl add-on for the club site starter kit.

Question
-
User-1941076836 posted
Hi all,
I've developed a PollControl add-on for the club site starter kit. You can find all information about it on this page:
http://www.blogs.jpworks.be/Tom/PermaLink.aspx?guid=a090d4ad-5473-4657-b466-359f50c01979
Have fun!
Tom van de Kerkhof
Wednesday, June 21, 2006 3:08 AM
All replies
-
User654902800 posted
Very tidy clean code Tom, cascading deletes, love those, keeps it all clean. It looks very good, I will try it out in the next few days. One comment - would use nvarchar in case somebody wants to react in Japanese or something
Um, my name is in your readme file - which I am flattered and glad to see that
IN NO EVENT SHALL MARK BRACEWELL BE LIABLEHa ha Lol!! ;-)
You're cool.
Wednesday, June 21, 2006 4:02 AM -
User654902800 posted
P.S. the Budweiser we get in the states is nasty, how about you send us a case of Stella so we're all on the same (web) page ;-) ??Wednesday, June 21, 2006 4:06 AM -
User-1941076836 posted
Damn! :-)
Well, it was late when I finished the PollControl last night. I had to do is a Search & Replace on your name in the readme file. :-D
Thanks for your feedback.
Tom
Wednesday, June 21, 2006 4:15 AM -
User-1941076836 posted
Maybe I will. ;-)Wednesday, June 21, 2006 4:17 AM -
User380413204 posted
Very cool Tom,
Can't use it in VB site though, sigh.........
Nevertheless great stuff,
Lex
Wednesday, June 21, 2006 9:22 AM -
User-1941076836 posted
Lex,
It's not that hard to convert the code to VB.NET. Just a matter of syntax...
It only takes time to convert it. If you search for C# to VB.NET convertors in your favorite search site, you'll definetly find some convertors.
Maybe I will convert it to VB.NET in a few days. Can't promise you when dough.
Greetz,
Tom
Wednesday, June 21, 2006 10:02 AM -
User380413204 posted
He Tom,
That would be great of course. Momentarily I am still busy with the links Mark gave me concerning RSS.
I am fighting at many (ASP) fronts at the same time, but being new at all facets almost the simplest of things (in the eyes of guys that can really shift some code, like you and Mark) ) are a hugh challenge to me.
Nevertheless I am enjoying it very much and occasionally get something right too.
Best regards,
Lex
Wednesday, June 21, 2006 10:12 AM -
User654902800 posted
I converted it to VB - I'll get it to Tom somehow so he can put it in the package, it was just 2 files.Wednesday, June 21, 2006 3:04 PM -
User380413204 posted
Great Mark,
Can't wait.
Lex
Wednesday, June 21, 2006 5:14 PM -
User654902800 posted
I left Tom a private message about where he can get the VB code.
How's that RSS stuff coming?
Wednesday, June 21, 2006 5:44 PM -
User380413204 posted
Hi guys,
Thank you both,
It works like a charm. One of these days i'll try to convert the Poll_view page to VB so I can show the Poll in Default.aspx.
Also I am looking forward to the proposed alterations. I think they make sense.
RSS basically works (see other thread) Lots of cosmetic changes and improvements to be made still.
You guys rock,
Lex
Thursday, June 22, 2006 8:41 AM -
User-1941076836 posted
You're welcome!
Thursday, June 22, 2006 9:04 AM -
User380413204 posted
Hi,
Ok, so i got a bit enthousiastic and tried to convert Poll_View from C# to VB.
The first section gives an enigmatic (for me anyhow) response: Tried a few Convertors, but gave the same error. (probably the same Convertor......)
The rest it seems to translate fine (no obvious errors, but then again could'nt test it yet. Is this something you guys can easily solve?
Thanks in advance,
Lex
Original code: public
partial class Poll_View : System.Web.UI.PageConverter output:
Class Poll_View
Inherits System.Web.UI.Page
'
'ToDo: Error processing original source shown below
'
'public partial class Poll_View : System.Web.UI.Page
'--------^--- 'class', 'struct', 'interface' or 'delegate' expected
'
'ToDo: Error processing original source shown below
'
'public partial class Poll_View : System.Web.UI.Page
'----------------^--- Syntax error: ';' expectedThursday, June 22, 2006 9:14 AM -
User380413204 posted
Hi,
Found another Converter that did the job,
So now it's in Default.aspx (VB) in a nice small column,
looks great
Lex
Thursday, June 22, 2006 12:28 PM -
User380413204 posted
Hi,
When I want to edit a Poll I get this:
(is it just me?)
Regards,
Lex
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 48: e.NewValues["Question"] = "Vraag?"; Line 49: } Line 50: if(String.IsNullOrEmpty(e.NewValues["Active"].ToString())) Line 51: { Line 52: e.NewValues["Active"] = 0;
Thursday, June 22, 2006 12:35 PM -
User380413204 posted
I sincerely apologize for being an ass,
The whole exercise of converting Poll_Vies.aspx to VB was not necessary at all.
Just pasted the Control <Club:PollControl ID="PollControl1" runat="server" /> at another spot and now it works fine, must have picked an awkward spot earlier.
Lex
Thursday, June 22, 2006 1:59 PM -
User380413204 posted
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
When I want to edit a Poll I get this: <o:p></o:p>
(is it just me?)<o:p></o:p>
Regards,<o:p></o:p>
Lex<o:p></o:p>
Object reference not set to an instance of an object. <o:p></o:p>
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error: <o:p></o:p>Line 48: e.NewValues["Question"] = "Vraag?";<o:p></o:p>
Line 49: }<o:p></o:p>
Line 50: if(String.IsNullOrEmpty(e.NewValues["Active"].ToString()))<o:p></o:p>
Line 51: {<o:p></o:p>
Line 52: e.NewValues["Active"] = 0;<o:p></o:p>
<o:p> </o:p>
Thursday, June 22, 2006 2:00 PM -
User-1941076836 posted
Hi Lex,
Just remove line 50 - 53. This was functionality that I left out at the last moment. It will be in the next release to make a poll active / inactive.
Greetz,
Tom
Friday, June 23, 2006 3:34 AM -
User380413204 posted
Hi Tom,
Did that, now i get:
Must declare the scalar variable "@memberid".
Does this have something to do with DataKeyNames?
Lex
Friday, June 23, 2006 9:49 AM -
User-302016627 posted
Hey Tom,
Good work dude !
BTW who's the host of your Club demo website.
I couldn't help noticing it runs blaaaazing fast !
Kinda much faster than even on my local DEV http://localhost
Did U do any special tune-ups, or heavy page-caching or something?
Great work !
Friday, June 23, 2006 4:49 PM -
Saturday, June 24, 2006 9:35 AM
-
User-1941076836 posted
Lex,
I've put a new version (1.0.3) on my demosite for the clubcontrol: http://clubdemo.jpworks.be/default.aspx
You don't need to pass the memberid parameter in the update because you want to store the member who has created the poll.
Greetz,
Tom
Saturday, June 24, 2006 11:21 AM -
User380413204 posted
Hi Tom,
Thanks,
Editing a poll goes well now, however editing an answer still throws an error:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 79: } Line 80: Line 81: if (String.IsNullOrEmpty(e.NewValues["QuestionId"].ToString())) Line 82: { Line 83: e.NewValues["QuestionId"] = PollId;
Best regards,
Lex
Saturday, June 24, 2006 12:10 PM -
User-1065173911 posted
Hi Tom,
I have downloaded your source and I am going to try and implement it on my clubsite starter. I too need it for a VB site and will attempt to convert as Lexy has. If interested, I will post any feedback I have here. Thanks for the source.
My Club Site: taylorsoutheast.org
Sunday, June 25, 2006 6:14 PM -
User-1941076836 posted
Hi,
You don't need to convert it, since Mark has already converted it to VB.NET. Thanks again Marik. I've included these converted .vb files in the zip.
Greetz,
Tom
Monday, June 26, 2006 2:16 AM -
User2069888697 posted
Great Job!
I added it to my site with no problem. and the funtionality is great.
I also added a link to your blog and the demo site for my members.
Monday, June 26, 2006 9:57 AM -
User2069888697 posted
Upgrade suggestion,
Restrict each member to one reaction comment with the ability to edit it should they choose.
Monday, June 26, 2006 10:35 AM -
User-1065173911 posted
Tom,
Thanks. I have implemented your classes and aspx pages on my site. I am having one problem with IE7. IE7 throws this error when I click on the green rollover, Manage Polls button, on my default page when logged on as admin:
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
I get this error on my local server and remote server when rendering with IE7. Firefox does not throw this error. I read through the forum for a fix, but mostly found the workaround of adding
"<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never" />",to the web config. I have looked at a few other sites, but all recommend the same, or recommend using the same <machine> key on each server, but I am not utilizing a web farm or multitple server configuration.
Any ideas on why I would be throwing this error? Hope this feedback helps and thanks ahead of time for any insight you can provide, or to anyone else who may come across this thread that may of had the same error and can lend some insight.
Tuesday, June 27, 2006 12:15 AM -
User-1941076836 posted
Fixed in version 1.0.4
Tuesday, June 27, 2006 4:55 PM -
User-1941076836 posted
Hi Tom,
Thanks,
Editing a poll goes well now, however editing an answer still throws an error:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 79: } Line 80: Line 81: if (String.IsNullOrEmpty(e.NewValues["QuestionId"].ToString())) Line 82: { Line 83: e.NewValues["QuestionId"] = PollId;
Best regards,
Lex
Fixed in version 1.0.4
Tuesday, June 27, 2006 4:56 PM -
User380413204 posted
Awesome!
Great work Tom,
Ever more flexible your Pollsystem.
One small thing, but that might be a problem of my own, since I haven't yet thoroughly tested it.
When I leave Rank blank I get:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 84: } Line 85: Line 86: if (string.IsNullOrEmpty(e.NewValues["Rank"].ToString())) Line 87: { Line 88: e.NewValues["Rank"] = 10;
While the code seems to want to prevent an empty Rank control, or am I mistaken?
Best regards,
Lex
Wednesday, June 28, 2006 11:24 AM -
User-1941076836 posted
Hi Lex,
That's a copy/paste error. Sorry about that. You can just change it to the following:
if (e.NewValues["Rank"] == null)
{
e.NewValues["Rank"] = 10;
}Just the same as in the DetailsView1_ItemInserting event handler.
Tom
Tuesday, July 4, 2006 4:05 PM -
User380413204 posted
Got it Tom,
Thanks,
Should have picked that up myself. But I am sort of apprehensive when it comes to C#
Still having trouble enough with VB :-))
Lex
Tuesday, July 4, 2006 4:56 PM -
User-1941076836 posted
Version 1.1.0 of the PollControl is released:
Changes:
- fixed some small bugs
- Linkbuttons for answers are replaced with radiobuttons and a submitbutton to vote.
You can download it here: http://clubdemo.jpworks.be/default.aspx
Greetz,
Tom
Tuesday, July 4, 2006 5:57 PM -
User380413204 posted
This looks nice Tom,
Tried to convert the code of Pollcontrol.cs to Pollcontrol.vb but converter could not do the job.
One of the problems: rlb.Click +=
New EventHandler(SubmitButton_Click)Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC32022: 'Public Event Click(sender As Object, e As System.EventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
Source Error:
Line 128: Dim rlb As RolloverButton = New RolloverButton() Line 129: rlb.Text = "Submit" Line 130: rlb.Click += New EventHandler(SubmitButton_Click) Line 131: Me.Controls.Add(rlb) Line 132: End If
Source File: C:\Webs\App_Code\PollControl.vb Line: 130
So I guess my question is who can help me convert this into VB?
Thanks in advance,
Lex
Wednesday, July 5, 2006 3:19 AM -
User-1941076836 posted
Hi Lex,
Sorry, I forgot to convert it to VB.NET [:S]
But the problem here is the syntax. You need to use toe AddHandler keyword:
AddHandler rlb.Click, AddressOf SubmitButton_Click
I'll try to convert it to VB.NET this weekend. However it's a nice practice, if you did it yourself ;-)
Greetz,
Tom
Wednesday, July 5, 2006 3:50 AM -
User380413204 posted
Hi Tom,
Don't get me wrong, this was no demand on you per se.
I am at the moment trying to do it myself. Almost there I think
This is one of them
Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.RadioButtonList'.
Description: An unhandled exception occurred during the execution of the current web
Line 193: End Sub Line 194: Protected Sub SubmitButton_Click(ByVal sender As Object, ByVal e As EventArgs) Line 195: If Not (CType(Me.Controls(5), RadioButtonList)).SelectedValue Is Nothing Then Line 196: Poll.Vote(Question.PollId, New Guid((CType(Me.Controls(5), RadioButtonList)).SelectedValue), New Guid(Membership.GetUser().ProviderUserKey.ToString())) Line 197:
And I am trying to figure out why the control is now shifted 1 cm. to the right.
Best regards,
Lex
Wednesday, July 5, 2006 4:13 AM -
User380413204 posted
Hi Tom,
I think its working. Can I somehow send you the code so you can incorporate it in your zip?
(In which case perhaps it would be good advice to do a little final check [:D])
Best regards,
Lex
Wednesday, July 5, 2006 4:39 AM -
User-1941076836 posted
Great job!
You can find my email address at the right column on my blog: http://blogs.jpworks.be/tom
Tom
Wednesday, July 5, 2006 4:55 AM -
User380413204 posted
Hi,
Can't get the RadioButtons to lign-up directly to the left.
http://80.126.181.96/web34/ (to see how it now)
http://tumblegum.wgg.com/ClubWebSite/Forum_Topics.aspx (to see how I want it to line up)
I feel it should be simple, but can't seem to get it done.
Thanks in advance,
Lex
Thursday, July 6, 2006 3:49 AM -
User380413204 posted
Got this from Mark,
Me.Controls.Add(New LiteralControl("<ul class='pollquestionlist'>"))
and the stylesheet has
.pollquestionlist
{
margin: 16px;
padding-left: 0px;
}(check out his forum guys, its awesome...)
http://tumblegum.wgg.com/ClubWebSite/)
Lex
Thursday, July 6, 2006 4:53 PM -
User-1941076836 posted
Hi Lex,
I've solved the alignement issues. I'll put the code online this weekend. You have to use some .css stuff to get it right. Just as Mark has done.
Greetz,
Tom
Thursday, July 6, 2006 4:57 PM -
User706866991 posted
Hey Tom,
Just downloaded the Poll Control and am up to step 7 of the install. Being new to this, I am having some difficulty understanding where this goes on the page. It seems no matter where I put it I get the following error. Any thoughts?
Server Error in '/prccdevsite' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] ClubSite.PollControl.CreateControls() +443 ClubSite.PollControl.CreateChildControls() +7 System.Web.UI.Control.EnsureChildControls() +97 System.Web.UI.Control.PreRenderRecursiveInternal() +50 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5731
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Friday, July 28, 2006 12:17 PM -
User-1941076836 posted
Hi,
Just do what the exception is telling you:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>Then you got more detailed information about the exception.
Greetz,
Tom
Thursday, August 3, 2006 2:20 AM -
User-2006636666 posted
I love the Poll Control. It's awesome!!!
I have placed this on the default.aspx page and it works great. I would however, like to restrict it so that only people in a role = "Homeowner" can vote on the poll. Any thoughts on the best way to do this? Right now, as long as they are registered they can participate in the poll.
Thanks in advance for your help.
-Doug
Thursday, August 24, 2006 4:41 PM -
User-1826205667 posted
This is great..thanks for releasing this to the public...much thanks to youSaturday, September 9, 2006 4:53 AM -
User-2138102261 posted
Hi all
The Poll control looks great, but I am stuck at step 6 in the readme!
6. Run the sql script
clubPoll.sqlI am a newbie, how do I do this?
Where do I put the sql?
I ran it but it put the tables in to a master.mdf located C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DataDoing something wrong - but no clue...
Can Anyone help?
Wednesday, October 4, 2006 3:59 AM -
User-1941076836 posted
Make sure you connect to your clubsite database. Probably Club.mdf
Greetz,
Tom
Wednesday, October 4, 2006 4:47 AM -
User-2138102261 posted
Alright! Thanks Tom for pointing me in the right direction.
For all U others out there that are new to this, to get this to run on your PC, I did the following:
opened up SQL Server Management Studio Express
Connected up to my local Service
In the right side, clicked on databases
Right click on white area - select attach add
find the club.mdf table and then this part is done.
Close the appIn explorer, find the clubPoll.sql
double click on it - SQL Server Management Studio Express should open - connect in, and the sql should be there.
U will see "master" in the toolbar, change this to the "club MDF" that U just added in the first step.
hit execute and the sql will run and install Tom's tables.Wednesday, October 4, 2006 12:20 PM -
User706866991 posted
Tom,
I was working on posting my updated site that includes the Polls today. Everything worked well locally on my laptop in vwd, but when posted to the host site I get the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 111: 'Question
Line 112: Dim questionLabel As Label = New Label()
Line 113: questionLabel.Text = Question.Question
Line 114: questionLabel.Style.Add(HtmlTextWriterStyle.FontWeight, "bold")
Line 115: Me.Controls.Add(questionLabel)
Source File: d:\hosting\rhhanson63\App_Code\PollControl.vb Line: 113
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ClubSite.PollControl.CreateControls() in d:\hosting\rhhanson63\App_Code\PollControl.vb:113
ClubSite.PollControl.CreateChildControls() in d:\hosting\rhhanson63\App_Code\PollControl.vb:89
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360Any thoughts?
Bob
Wednesday, October 11, 2006 5:26 PM -
User-1941076836 posted
Hi, Most likely the Question object is null. But I'm sure you figured that out yourself. You said that it worked well locally. Strange because the only thing that's different probably is your connectionstring to another database. Normally, the pollcontrol works just fine when there are no questions (polls) yet... You can try to change your connectionstring to the host's database and debug it locally. Greetz, TomThursday, October 12, 2006 5:05 AM -
User-1223469344 posted
Hy Tom!
How can I put the pollcontrol to the default.aspx page?
I read your readme .txt file.
1-6 step ok!
Please help me!
Best regards zooleebaa
Monday, October 16, 2006 3:05 PM -
User-1941076836 posted
Just include the following code in your default.aspx (html view) <!-- start of PollControl --><Club:PollControl ID="PollControl1" runat="server" />Piece of cake! Greetz Tom http://blogs.jpworks.be/TomThursday, October 19, 2006 11:22 AM -
User-1941076836 posted
Just include the following code in your default.aspx (html view)
<!-- start of PollControl -->
<div class="leftblock">
<Club:PollControl ID="PollControl1" runat="server" />
</div/>
Piece of cake! Greetz Tom http://blogs.jpworks.be/TomThursday, October 19, 2006 11:40 AM -
User-2006636666 posted
Any ideas on securing this so that only people in a specific "Role" can vote? Right now all they have to do is be registered. I have the rest of the site secured so that I place people in a "HomeOwner" role before they can actually do anything on the site. As implemented right now people can vote immediately after they register. I'd like to keep it a little more secured to a role, but still be able to show the poll on the default.aspx page.
Thanks in advance.
Saturday, October 21, 2006 2:58 PM -
User-1223469344 posted
Hy Tom!
Thank you for your help. But I have another question:-) Some character in my language (Hungarian) don't appear. Like ö,ő,ú,ű.
The collation SQL_Latin1_General_CP1_CI_AS. I try change this SQL_Hungarian_CP1250_CI_AS, but there is one error in my log.
Esemény típusa: Figyelmeztetés
Esemény forrása: ASP.NET 2.0.50727.0
Esemény kategóriája: Webes esemény
Esemény azonosítója: 1309
Kivételadatok:
Kivétel típusa: SqlException
Kivételüzenet: Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\HÁLÓZATSZOLGÁLTATÁS'.How can i resolving my problem???
Thank's zooleebaa
Saturday, October 21, 2006 5:09 PM -
User2068891794 posted
Hi all,
I have installed the poll on my site but I have got two problems. I am using VB.Net and SQL Server 2005. Poll works fine apart from the Poll_view doesnt show the reactions and Poll_View doesnt show the list of polls? i know there is no data sorce on these pages? I think I may have to add these but tried that and think my SQL statements are incorrect.
Any ideas? is it because Im using VB.NET. I can manage polls as administrator okay and vote in polls etc?
Tuesday, October 24, 2006 11:15 AM -
User-1876377467 posted
I too have this exact error. Any help would be appreciated.
Thanks!
Monday, January 8, 2007 8:48 PM -
User-1876377467 posted
Tom,
I was working on posting my updated site that includes the Polls today. Everything worked well locally on my laptop in vwd, but when posted to the host site I get the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 111: 'Question
Line 112: Dim questionLabel As Label = New Label()
Line 113: questionLabel.Text = Question.Question
Line 114: questionLabel.Style.Add(HtmlTextWriterStyle.FontWeight, "bold")
Line 115: Me.Controls.Add(questionLabel)
Source File: d:\hosting\rhhanson63\App_Code\PollControl.vb Line: 113
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ClubSite.PollControl.CreateControls() in d:\hosting\rhhanson63\App_Code\PollControl.vb:113
ClubSite.PollControl.CreateChildControls() in d:\hosting\rhhanson63\App_Code\PollControl.vb:89
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360Any thoughts?
Bob
Sorry, meant to quote Box last time. This is the error I was getting. Any help would be appreciated.
Monday, January 8, 2007 8:51 PM -
User-455069872 posted
Hello all. I just attempted to install the PollControl and ran into this error off right away:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 111: 'Question
Line 112: Dim questionLabel As Label = New Label()
Line 113: questionLabel.Text = Question.Question
Line 114: questionLabel.Style.Add(HtmlTextWriterStyle.FontWeight, "bold")
Line 115: Me.Controls.Add(questionLabel)
Source File: d:\hosting\rhhanson63\App_Code\PollControl.vb Line: 113
I downloaded the control 1-10-07
I didn't see any finally to this so I hope I can proivde a solution.
This problem only occurs in the versions 1.0.4 when "PollControl.vb" is being used. I conpared the cs and vb files and found that the VB code is a little off.TO FIX THIS, do the following
Around Line 104 you should find an "End If" statement, this is right after an "Else" statement
Cut the "End if" statement
Paste the "End If" statement above the "End Sub" around line 204
IT should look like
" adminLinkButton.Text = "Manage Polls"
Me.Controls.Add(adminLinkButton)
End If"End if <!-- This is the newly pasted End if -->
End Sub
Thats it, It should work fine. The code was trying to load the Question when none was available.
I will attempt to email Tom so he can update his downloadables.
R/
ahengserWednesday, January 10, 2007 1:36 PM -
User-1876377467 posted
I love the PollControl add-on, but I'd like to be able to have a poll with more than one question. Has anyone re-worked the code for this?
Thanks so much!
Wednesday, January 10, 2007 5:32 PM -
User-556004692 posted
help me please, i don't know how to fixed it, because always occurs this error.
somebody help me, i'm in desparate bout this....
why this occurs??????
this my error list in web :
Server Error in '/ika' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 111: 'Question
Line 112: Dim questionLabel As Label = New Label()
Line 113: questionLabel.Text = Question.Question
Line 114: questionLabel.Style.Add(HtmlTextWriterStyle.FontWeight, "bold")
Line 115: Me.Controls.Add(questionLabel)
Source File: F:\ika\App_Code\PollControl.vb Line: 113
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ClubSite.PollControl.CreateControls() in F:\ika\App_Code\PollControl.vb:113
ClubSite.PollControl.CreateChildControls() in F:\ika\App_Code\PollControl.vb:89
System.Web.UI.Control.EnsureChildControls() +97
System.Web.UI.Control.PreRenderRecursiveInternal() +50
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5731Tuesday, June 5, 2007 7:45 AM -
User1622140578 posted
hope for a vb codes[:)]
Friday, June 8, 2007 4:39 AM -
User1622140578 posted
Hoping for a vb codes[:)]
....sorry for the double post
Friday, June 8, 2007 4:40 AM -
User1622140578 posted
have installed it and run but only the word "No poll available" is visible, no any managing controls. have any idea? by the way, i just manually created the tables and proceures (i have problems in running sql scipts).
Friday, June 8, 2007 11:50 PM