Click here to Skip to main content
15,921,212 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Continue C++ managed AND unmanaged project in VB Pin
Abhijit Jana31-Dec-09 9:40
professionalAbhijit Jana31-Dec-09 9:40 
QuestionSession being lost in a simple test webpage Pin
jpegny31-Dec-09 9:29
jpegny31-Dec-09 9:29 
AnswerRe: Session being lost in a simple test webpage Pin
Abhijit Jana31-Dec-09 9:39
professionalAbhijit Jana31-Dec-09 9:39 
GeneralRe: Session being lost in a simple test webpage Pin
jpegny31-Dec-09 9:42
jpegny31-Dec-09 9:42 
AnswerRe: Session being lost in a simple test webpage Pin
Sir Dot Net31-Dec-09 11:55
Sir Dot Net31-Dec-09 11:55 
GeneralRe: Session being lost in a simple test webpage Pin
jpegny31-Dec-09 12:30
jpegny31-Dec-09 12:30 
AnswerRe: Session being lost in a simple test webpage Pin
pd695-Jan-10 23:35
pd695-Jan-10 23:35 
QuestionWeb page compiler error Pin
mavoc31-Dec-09 7:50
mavoc31-Dec-09 7:50 
AnswerRe: Web page compiler error Pin
Abhijit Jana31-Dec-09 8:23
professionalAbhijit Jana31-Dec-09 8:23 
GeneralRe: Web page compiler error Pin
mavoc1-Jan-10 7:18
mavoc1-Jan-10 7:18 
GeneralRe: Web page compiler error Pin
Abhijit Jana2-Jan-10 9:21
professionalAbhijit Jana2-Jan-10 9:21 
GeneralRe: Web page compiler error [modified] Pin
mavoc4-Jan-10 6:50
mavoc4-Jan-10 6:50 
QuestionGetting function value Pin
Hema Bairavan31-Dec-09 4:47
Hema Bairavan31-Dec-09 4:47 
AnswerRe: Getting function value Pin
Abhishek Sur31-Dec-09 6:41
professionalAbhishek Sur31-Dec-09 6:41 
GeneralRe: Getting function value Pin
Hema Bairavan31-Dec-09 6:49
Hema Bairavan31-Dec-09 6:49 
GeneralRe: Getting function value Pin
Abhishek Sur31-Dec-09 7:15
professionalAbhishek Sur31-Dec-09 7:15 
Ya, I got your problem. Actually, if you dont place runat=server for a control inside Repeater, it will evaluate data correctly. For a control having runat="server" you need to do this from your codeBehind.

The ItemDataBound event is the best candidate for you.


Add asp:Repeater OnItemDataBound="RepeaterItemEventHandler" in the control

public void RepeaterItemEventHandler(object sender, RepeaterItemEventArgs e)
{
    if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternateItem)
    {
         Label lbl = e.Item.FindControl("lblitem") as Label;
         lbl.Text = DataBinder.Eval(e.Item.DataItem, "fao_subcategory");
         
    }
}


also to remind you, you can set the javascript there, but it will not execute when text property gets loaded. Rather put a RegisterStartupScript which will modify the data.

this.ClientScript.RegisterStartupScript(this.GetType, lbl.ClientId, "GetCatDesc('" + lbl.ClientId + "');" , true);<br />

like this.

Just modify this according to what you need. Do this inside the RepeaterItemEventHandler

Abhishek Sur
Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->

Windows7 API Code Pack

Simplify Code Using NDepend
Basics of Bing Search API using .NET

GeneralRe: Getting function value [modified] Pin
Hema Bairavan31-Dec-09 8:06
Hema Bairavan31-Dec-09 8:06 
GeneralRe: Getting function value Pin
Abhishek Sur31-Dec-09 8:39
professionalAbhishek Sur31-Dec-09 8:39 
Questionasp.net vb radiobuttonlist object reference Pin
janetb9931-Dec-09 4:31
janetb9931-Dec-09 4:31 
AnswerRe: asp.net vb radiobuttonlist object reference Pin
janetb994-Jan-10 10:33
janetb994-Jan-10 10:33 
QuestionNeed some expert advices on ViewState Pin
James Shao31-Dec-09 4:26
James Shao31-Dec-09 4:26 
AnswerRe: Need some expert advices on ViewState Pin
James Shao31-Dec-09 20:19
James Shao31-Dec-09 20:19 
AnswerRe: Need some expert advices on ViewState Pin
Anurag Gandhi31-Dec-09 20:57
professionalAnurag Gandhi31-Dec-09 20:57 
GeneralRe: Need some expert advices on ViewState Pin
James Shao1-Jan-10 4:26
James Shao1-Jan-10 4:26 
GeneralRe: Need some expert advices on ViewState Pin
Anurag Gandhi1-Jan-10 6:25
professionalAnurag Gandhi1-Jan-10 6:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.