Please put your full .aspx and .cs both files code here , then we can find where it the hidden fault . Try to find whether may be somewhere you are redirecting your page to itself like (Response.Redirect(this.Page) . Check it , 2ndly just remove rating control
and comment its event then check whether it is still refreshing or not , Debug using these steps by commenting portions one by one
Umair Aslam MCP
Blog Please remember to Mark as answer if any post help you , it help others to find right solution in less time
Please put your full .aspx and .cs both files code here , then we can find where it the hidden fault . Try to find whether may be somewhere you are redirecting your page to itself like (Response.Redirect(this.Page) . Check it , 2ndly just remove rating control
and comment its event then check whether it is still refreshing or not , Debug using these steps by commenting portions one by one
If i comment out the rating control, then there's nothing on the page which would cause a postback or any sort of update. I uploaded a zip file of the pages here: http://www.mediafire.com/?are3c086xsw1imz
Thank you for taking the time to post that code. I just tried copying all of your code. The only changes i made were to include some css info so the stars for the rating control would display properly. Unfortunately, it still does not work. When i click
a star, the page refreshes.
This code worked for you without a page refresh? If so, then i think the error must either be in my ajax toolkit dll or could there be something wrong with my web.config? I've made no entries to the web.config regarding this.
umairaslam22
Contributor
3992 Points
846 Posts
Re: whole page getting refreshed
Jan 27, 2012 08:57 AM|LINK
Please put your full .aspx and .cs both files code here , then we can find where it the hidden fault . Try to find whether may be somewhere you are redirecting your page to itself like (Response.Redirect(this.Page) . Check it , 2ndly just remove rating control and comment its event then check whether it is still refreshing or not , Debug using these steps by commenting portions one by one
MCP
Blog
Please remember to Mark as answer if any post help you , it help others to find right solution in less time
merk
Participant
766 Points
380 Posts
Re: whole page getting refreshed
Jan 27, 2012 11:47 AM|LINK
Actually, a previous poster suggested making that change, and i did, but to no effect.
http://www.mediafire.com/?are3c086xsw1imz
I created a zip file of the default. aspx and site.master files (and cs files). Thanks to everyone for helping with this.
merk
Participant
766 Points
380 Posts
Re: whole page getting refreshed
Jan 27, 2012 11:48 AM|LINK
If i comment out the rating control, then there's nothing on the page which would cause a postback or any sort of update. I uploaded a zip file of the pages here: http://www.mediafire.com/?are3c086xsw1imz
Thank you
WishStar99
Contributor
2857 Points
879 Posts
Re: whole page getting refreshed
Jan 27, 2012 03:02 PM|LINK
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ListViewControl.aspx.cs" Inherits="ListViewControl" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>List View Control</title> <link href="StyleSheet.css" rel="stylesheet" type="text/css" /> </head> <body> <form id="form1" runat="server"> <ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" /> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <asp:ListView ID="listview1" DataKeyNames="ID" EnableViewState="true" runat="server"> <LayoutTemplate> <ul id="template"> <asp:PlaceHolder ID="itemPlaceholder" runat="server" /> </ul> </LayoutTemplate> <ItemTemplate> <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:Label ID="lblName" Text='<%#Eval("Name")%>' runat="server" /> <ajax:Rating ID="Rating1" MaxRating="5" OnChanged="Rating1_OnChanged" AutoPostBack="true" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" FilledStarCssClass="filledRatingStar" EmptyStarCssClass="emptyRatingStar" runat="server" /> </ContentTemplate> </asp:UpdatePanel> </ItemTemplate> </asp:ListView> </form> </body> </html>WishStar99
Contributor
2857 Points
879 Posts
Re: whole page getting refreshed
Jan 27, 2012 03:03 PM|LINK
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using AjaxControlToolkit; public partial class ListViewControl : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataRow newrow = null; DataTable dt = new DataTable(); dt.Columns.Add("ID", typeof(int)); dt.Columns.Add("Name", typeof(string)); newrow = dt.NewRow(); newrow["ID"] = 1; newrow["Name"] = "Jack"; dt.Rows.Add(newrow); newrow = dt.NewRow(); newrow["ID"] = 2; newrow["Name"] = "Daniel"; dt.Rows.Add(newrow); listview1.DataSource = dt; listview1.DataBind(); } } protected void Rating1_OnChanged(object sender, RatingEventArgs e) { string t = string.Empty; t = "HELLO"; } }WishStar99
Contributor
2857 Points
879 Posts
Re: whole page getting refreshed
Jan 27, 2012 03:04 PM|LINK
So there's the HTML, the <p>1</p> is just to force the browser to have scrolling and that the listview is at the moment to test the star rating.
merk
Participant
766 Points
380 Posts
Re: whole page getting refreshed
Jan 28, 2012 07:22 AM|LINK
Thank you for taking the time to post that code. I just tried copying all of your code. The only changes i made were to include some css info so the stars for the rating control would display properly. Unfortunately, it still does not work. When i click a star, the page refreshes.
This code worked for you without a page refresh? If so, then i think the error must either be in my ajax toolkit dll or could there be something wrong with my web.config? I've made no entries to the web.config regarding this.
WishStar99
Contributor
2857 Points
879 Posts
Re: whole page getting refreshed
Jan 30, 2012 04:17 PM|LINK
can you repost your HTML?
merk
Participant
766 Points
380 Posts
Re: whole page getting refreshed
Jan 30, 2012 11:46 PM|LINK
my code can be downloaded from here:
http://www.mediafire.com/?are3c086xsw1imz
WishStar99
Contributor
2857 Points
879 Posts
Re: whole page getting refreshed
Feb 02, 2012 11:40 PM|LINK
Since your ListView is already inside the UpdatePanel, there's no need to point the Trigger at the ListView again. You can remove the Trigger.
<Triggers> <asp:AsyncPostBackTrigger ControlID="ListView1" /> </Triggers> <ContentTemplate>