i found a poll control on this sit : obout.com , now i want to use it instead of my voting system in my website ...
my voting system is like below :
1- stored procedure to get the active vote :
ALTER PROCEDURE GetActiveVote
AS
Select VoteID, VoteQues From tblvoteQuestion Where IsActive='True'
another stored procedure to get Answers :
ALTER PROCEDURE GetVoteChoices
(
@VoteID int
)
AS
Select ChoicesID, Choices from tblVoteChoices
Where
VoteID = @VoteID
and the code behind the page is like below :
public partial class Vote : UserDataAccess
{
protected void Page_Load(object sender, EventArgs e)
{
// if its fresh page , get the Active vote
if (!IsPostBack)
{
DataTable dt = DA.GetActiveVote();
// if there is Active vote , bring it if not hide the vote table
if (dt.Rows.Count > 0)
{
lblVoteQuestion.Text = dt.Rows[0]["VoteQues"].ToString();
rdoLstChoices.DataSource = DA.GetVoteChoices(dt.Rows[0]["VoteID"].ToString());
rdoLstChoices.DataBind();
// after get questin and answer connect the btn valu to vote it
lnkBtnVote.Attributes.Add("VoteID", dt.Rows[0]["VoteID"].ToString());
// after user voting, it will save in cookies , so we have to check the cookies if ther is voteid ,
// if there is recor in the cookies for the voteid then disable lnkbtnVote and rdoLstVotechoice to prevent people to vote
if (Request.Cookies["VoteID"] != null && Request.Cookies["VoteID"].Value.Equals(lnkBtnVote.Attributes["VoteID"]))
{
// agar la kooki mawjwd bw awa lnkbtnvote u rdoLstvotechoice disable bka
rdoLstChoices.Enabled = lnkBtnVote.Enabled = false;
}
}
else
{
//if there is no active vote hid tblvote
tblVote.Visible = false;
}
}
}
protected void lnkBtnVote_Click(object sender, EventArgs e)
{
DA.UpdateChoiceCounter(rdoLstChoices.SelectedValue);
// write the cookie
Response.Cookies.Add(new HttpCookie("VoteID",lnkBtnVote.Attributes["VoteID"]));
// retrive the cookie
Request.Cookies["VoteID"].Expires = DateTime.Now.AddDays(2);
Response.Redirect("~/VoteResult.aspx");
}
}
so now how i implete the Poll control from obout.com website useing my concept ...
Ok, what you need to do here is opne the folder, and double-click RunExamples.exe Then click Install controls into Visual Studio toolbox. Once installed, you should be able to get access to the poll control.
If the controls don't appear automaticially in your VS toolbar, right-click and add a Tab under the toolbox. Right-click on the newly added tab and click Choose Items. Under .NET Framework Components, click Browse, Browse your system to the oBout folder
and open BIN, then select Obout.Ajax.UI.dll. You may continue to add the controls under the obout tab you created. This will make them available in Visual Studio. I think something is wrong with their installation routine.
siamand
Member
416 Points
307 Posts
How to ; configure this obout control in Visual studio 2010 ..
Feb 22, 2012 11:15 AM|LINK
Hi all
i found a poll control on this sit : obout.com , now i want to use it instead of my voting system in my website ...
my voting system is like below :
1- stored procedure to get the active vote :
another stored procedure to get Answers :
and the code behind the page is like below :
public partial class Vote : UserDataAccess { protected void Page_Load(object sender, EventArgs e) { // if its fresh page , get the Active vote if (!IsPostBack) { DataTable dt = DA.GetActiveVote(); // if there is Active vote , bring it if not hide the vote table if (dt.Rows.Count > 0) { lblVoteQuestion.Text = dt.Rows[0]["VoteQues"].ToString(); rdoLstChoices.DataSource = DA.GetVoteChoices(dt.Rows[0]["VoteID"].ToString()); rdoLstChoices.DataBind(); // after get questin and answer connect the btn valu to vote it lnkBtnVote.Attributes.Add("VoteID", dt.Rows[0]["VoteID"].ToString()); // after user voting, it will save in cookies , so we have to check the cookies if ther is voteid , // if there is recor in the cookies for the voteid then disable lnkbtnVote and rdoLstVotechoice to prevent people to vote if (Request.Cookies["VoteID"] != null && Request.Cookies["VoteID"].Value.Equals(lnkBtnVote.Attributes["VoteID"])) { // agar la kooki mawjwd bw awa lnkbtnvote u rdoLstvotechoice disable bka rdoLstChoices.Enabled = lnkBtnVote.Enabled = false; } } else { //if there is no active vote hid tblvote tblVote.Visible = false; } } } protected void lnkBtnVote_Click(object sender, EventArgs e) { DA.UpdateChoiceCounter(rdoLstChoices.SelectedValue); // write the cookie Response.Cookies.Add(new HttpCookie("VoteID",lnkBtnVote.Attributes["VoteID"])); // retrive the cookie Request.Cookies["VoteID"].Expires = DateTime.Now.AddDays(2); Response.Redirect("~/VoteResult.aspx"); } }so now how i implete the Poll control from obout.com website useing my concept ...
Regards
bbcompent1
All-Star
33824 Points
8760 Posts
Moderator
Re: How to ; configure this obout control in Visual studio 2010 ..
Feb 22, 2012 11:22 AM|LINK
Your backend stuff looks good but could you post your aspx page just so we can see what you have in the visual elements?
siamand
Member
416 Points
307 Posts
Re: How to ; configure this obout control in Visual studio 2010 ..
Feb 22, 2012 11:35 AM|LINK
thanks for you quick reply ,,
i have a webuser control for this purpose ...
<style type="text/css"> .style1 { width: 100%; } </style> <table cellpadding="0" cellspacing="0" class="style1" runat="server" id="tblVote"> <tr> <td> <asp:Label ID="lblVoteQuestion" runat="server" ForeColor="Red"></asp:Label> </td> <td> </td> </tr> <tr> <td > <asp:RadioButtonList ID="rdoLstChoices" runat="server" DataTextField="Choices" DataValueField="ChoicesID"> </asp:RadioButtonList> </td> <td> </td> </tr> <tr> <td> <asp:LinkButton ID="lnkBtnVote" runat="server" onclick="lnkBtnVote_Click">Vote</asp:LinkButton> <asp:HyperLink ID="hypVoteResult" runat="server">Vote Result</asp:HyperLink> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table>but what i want to do is using obout poll control instead of my simple controls...
Regards
bbcompent1
All-Star
33824 Points
8760 Posts
Moderator
Re: How to ; configure this obout control in Visual studio 2010 ..
Feb 22, 2012 11:46 AM|LINK
From the link you provided, it looks like they are willing to allow download of their control. Did you grab it from their site?
bbcompent1
All-Star
33824 Points
8760 Posts
Moderator
Re: How to ; configure this obout control in Visual studio 2010 ..
Feb 22, 2012 11:47 AM|LINK
It would appear that they allow downloading of their entire suite of controls here: http://www.obout.com/inc/suite_download/default.aspx?type=35
siamand
Member
416 Points
307 Posts
Re: How to ; configure this obout control in Visual studio 2010 ..
Feb 22, 2012 11:55 AM|LINK
yes i downloaded it ,and i put it to my project .. but dont know how to make this control to get data from my code ...
im biggener ..
Regards
bbcompent1
All-Star
33824 Points
8760 Posts
Moderator
Re: How to ; configure this obout control in Visual studio 2010 ..
Feb 22, 2012 12:19 PM|LINK
Alright, it looks like you may not be properly referencing it in the top of your page. Give me a littie time to turn around something for you...
siamand
Member
416 Points
307 Posts
Re: How to ; configure this obout control in Visual studio 2010 ..
Feb 22, 2012 12:27 PM|LINK
thank you very much for your help ,
i will wait , its not problem if you provide a nother poll system which is suitable with my code and nice looking ...
thanks again
bbcompent1
All-Star
33824 Points
8760 Posts
Moderator
Re: How to ; configure this obout control in Visual studio 2010 ..
Feb 22, 2012 12:48 PM|LINK
Ok, what you need to do here is opne the folder, and double-click RunExamples.exe Then click Install controls into Visual Studio toolbox. Once installed, you should be able to get access to the poll control.
bbcompent1
All-Star
33824 Points
8760 Posts
Moderator
Re: How to ; configure this obout control in Visual studio 2010 ..
Feb 22, 2012 01:11 PM|LINK
If the controls don't appear automaticially in your VS toolbar, right-click and add a Tab under the toolbox. Right-click on the newly added tab and click Choose Items. Under .NET Framework Components, click Browse, Browse your system to the oBout folder and open BIN, then select Obout.Ajax.UI.dll. You may continue to add the controls under the obout tab you created. This will make them available in Visual Studio. I think something is wrong with their installation routine.