Help On Link Repaeter Control

Posted by Vijayar under C# on 2/23/2012 | Points: 10 | Views : 969 | Status : [Member] | Replies : 4
can we place a repeater with in a panel
But iam not getting it
<table style="width: 100%;">


<tr style="height: 30px">
<td style="width: 30px">
</td>

<td valign="top" align="right">
<asp:ImageButton ID="cancel1" runat="server" CausesValidation="False" ImageUrl="~/Images/window-close.png"
Width="20px" Height="20px" OnClick="cancel1_Click" />
</td>
</tr>

<tr>
<td>
</td>
<td>


</td></tr>


<tr> <td> </td> <td align="right">


<asp:LinkButton ID="lnkapply" runat="server" OnClick="lnkapply_Click" CommandArgument='<% #Bind("JobId")%>' CssClass="style" >Apply</asp:LinkButton></td></tr>-

<asp:Repeater>
<Item Template>


</asp:LinkButton> </itemtEmplate></td></tr>

</table>

But iam not viewing Text Apply .What is mistake

vijaya


Responses

Posted by: Ppathi on: 2/23/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

Actually u had placed link button out side the repeater. so it should not work like above described

Try like this


<asp:Repeater ID="career_rep" runat="server" OnItemCommand="career_Ontem" >
<ItemTemplate>
<tr style="height:35px">
<asp:Panel ID="panel1" runat="server">
<td class="CarrBoxtxt BG_CarrGrey" style="width:177.75px;padding-left:15px" align="right">
<asp:LinkButton ID="LinkButton1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Designation").ToString()%>' CommandArgument='<%#DataBinder.Eval(Container.DataItem,"jobid").ToString()%>' CommandName="Id"></asp:LinkButton>
</td>
</asp:Panel>
</tr>
</td>
</ItemTemplate>
</asp:Repeater>

and code behind side u should write OnItemCommand Event like this

protected void career_Ontem(object sender, RepeaterCommandEventArgs e)
{

string code=(string)e.CommandArgument;
Response.Write("/Career-Details.aspx?jobid="+ code);


}



Thanks & Regards,
Pasupathi G
No Pain No Gain

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vijayar on: 2/23/2012 [Member] Starter | Points: 25

Up
0
Down

<asp:Repeater ID="rptcareer1" runat="server" OnItemCommand="rptcareer1_ItemCommand">
<ItemTemplate>
<table>
<tr>
<td>

<asp:Panel ID="Panel1" runat="server" BorderColor="Black" BorderStyle="Groove" Width="300px"
Height="175px" Style="background-color: white; display: none;">


<table style="width: 100%;">


<tr style="height: 30px">
</tr>

<tr>
<td>
</td>
<td>
<asp:Label ID="Label1" runat="server" align="center" ForeColor="Black" Font-Bold="true" Text="Job Name"/> : <asp:Label ID="lbljobname" runat="server" align="center" ForeColor="Green" Font-Bold="true"></asp:Label><br />




</td></tr>

<tr>
<td></td>
<td>

<asp:LinkButton id="LinkButton2" CommandName="Id" CommandArgument='<%#Eval("JobId") %> ' CssClass="style" Runat="server" OnCommand="LinkButton2_Command">Apply
</asp:LinkButton> </td></tr></table></asp:Panel></td></tr>

</table> </ItemTemplate> </asp:Repeater>

<asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="HD2"
PopupControlID="Panel1" BackgroundCssClass="Background" CancelControlID="cancel1">
</asp:ModalPopupExtender>
<asp:HiddenField ID="HD2" runat="server" />

I am getting errors as lbljibname doesnot exist i current content .What is my Mistake


<









vijaya

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vijayar on: 2/23/2012 [Member] Starter | Points: 25

Up
0
Down
Actually i am displaying list just name by using repeater control and showing their details in popup.I am placing the details in another repaeter and placing link button and panel information in it and trying to redirect to other page.I tried by placing only link button in pop up. but not getting desired o/p.What to do

<marquee behavior="scroll" direction="up" height="240px" onmouseover="stop()" onmouseout="start()">
<asp:Repeater ID="rptcareer" runat="server" OnItemCommand="rptcareer_ItemCommand">
<ItemTemplate>
<table>
<tr style="width: 200px">
<td valign="middle">
<%-- <div class="imgl"><img src="../Images/11.jpg" alt="" /></div>--%>
</td>
<td valign="middle">
<asp:Label ID="lbljob" runat="server" Font-Size="Large"

Text='<%#Eval("JobName") %>'></asp:Label>
</td>
</tr>
<tr style="width: 200px">
<td valign="bottom" colspan="2" align="right">

<asp:LinkButton ID="lnkfac" runat="server" CommandArgument='<%#Eval("JobId") %> '>Read More...</asp:LinkButton>



</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater></marquee>

vijaya

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ppathi on: 2/23/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

Ok keep the above code and add the below mentioned steps

Write the javascript like this

function testpop(opt)
{
window.open("/Career-Details.aspx?jobid="+opt,'Title','width=400,height=400')
}

then codebehind side use this code

protected void career_Ontem(object sender, RepeaterCommandEventArgs e)
{

string code=(string)e.CommandArgument;
string myScript = @"javascript:testpop('" + code + "');";
Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
}

Now the popup window opened for selected job

Thanks & Regards,
Pasupathi G
No Pain No Gain

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response