asp.net - How to Bind Sql DataSource using code? -
I have a SQL data source that I have built with Gridview.
Where I have the column name. I am updating the value in the data base, using the AJ rating, and I want to show that value even after updating.
But this will not show an updated value until the page is refreshed.
& lt; ItemTemplate & gt; & Lt; Table range = "0" cell padding = "0" cell area = "0" width = "auto" & gt; & Lt; Tr style = "width: 150px;" Valign = "top" & gt; & Lt; Td style = "height: 30px;" & Gt; & Lt; Asp: Label ID = "lblTotalRate" runat = "server" text = '& lt;% # DataBinder.Eval (container.datetime, "total right")% & gt;' & Gt; & Lt; / Asp: Label & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; Tr style = "width: 150px;" Valign = "top" & gt; & Lt; Td style = "height: 30px;" & Gt; & Lt; Asp: UpdatePanel id = "updtpnlTweet" runat = "server" & gt; & Lt; ContentTemplate & gt; & Lt; Cc1: rating id = "rate" runat = "server" current rating = '& lt;% # bind ("rating")% & gt; EmptyStarCssClass = "EmpatyStarRating" FilledStarCssClass = "Filling Starring" MaxRating = "5" onchanged = "rateTweet_Changed" StarCssClass = "Rating" Star "Class Class" = "Saved Startup" & gt; & Lt; / CC1: Ratings & gt; & Lt; / ContentTemplate & gt; & Lt; / ASP: UpdatePanel & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / ItemTemplate & gt;
This example is a miss code that forces UpdatePanel. By default it prevents POSBACK events from any child, then just set the autopost of the rating = "True"
Comments
Post a Comment