Click here to Skip to main content
15,913,941 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionWeb service SOAP exception Pin
mpavas5-Jun-08 20:48
mpavas5-Jun-08 20:48 
Questionin modalpopup javascript validation doesnot work in firefox Pin
vishal parekh5-Jun-08 20:40
vishal parekh5-Jun-08 20:40 
AnswerRe: in modalpopup javascript validation doesnot work in firefox Pin
eyeseetee5-Jun-08 22:06
eyeseetee5-Jun-08 22:06 
GeneralRe: in modalpopup javascript validation doesnot work in firefox Pin
vishal parekh6-Jun-08 4:20
vishal parekh6-Jun-08 4:20 
Question<asp:calendar> and "Arithmetic overflow error converting expression to data type datetime."</asp:calendar> Pin
epp11235-Jun-08 20:22
epp11235-Jun-08 20:22 
AnswerRe: and "Arithmetic overflow error converting expression to data type datetime." Pin
eyeseetee5-Jun-08 22:05
eyeseetee5-Jun-08 22:05 
QuestionIs it possible to Get id of a row in repeater Pin
S.Aijaz5-Jun-08 20:11
S.Aijaz5-Jun-08 20:11 
AnswerRe: Is it possible to Get id of a row in repeater Pin
Gayani Devapriya5-Jun-08 21:21
Gayani Devapriya5-Jun-08 21:21 
Hi,
Let’s say you are going to click on a button placed in the repeater. And I assume that there is a field that you want to get the ID of. So here I will assume it to be ‘CustomerID’. Duing item bound this customer ID will be assigned as the CommandArgument of the button that you will be clicking.

Sample - Code
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<ItemTemplate>
<br />
<asp:Label ID="lblCustomerName" Text='<%#Eval("CustomerName") %>' runat="server"
Width="100px"></asp:Label>
<asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="Edit" CommandArgument='<%#Eval("CustomerID") %>' />
</ItemTemplate>
</asp:Repeater>

In the ItemDataBound event of the Repeater, access the button, and get the commandargument, which will be the ID you want and here, I’m calling an alert to return the ID.
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
Button btnEdit = (Button)e.Item.FindControl("btnEdit");
if (btnEdit != null)
{
string sId = "The selected item ID:" + btnEdit.CommandArgument.ToString();
btnEdit.Attributes.Add("onclick", "javascript:return " +
"alert('" + sId + "')");

}
}
Hope it’s clear.
Thx,
Gayani
GeneralRe: Is it possible to Get id of a row in repeater Pin
S.Aijaz5-Jun-08 21:40
S.Aijaz5-Jun-08 21:40 
GeneralRe: Is it possible to Get id of a row in repeater Pin
S.Aijaz5-Jun-08 22:08
S.Aijaz5-Jun-08 22:08 
GeneralRe: Is it possible to Get id of a row in repeater [modified] Pin
Gayani Devapriya5-Jun-08 22:18
Gayani Devapriya5-Jun-08 22:18 
GeneralRe: Is it possible to Get id of a row in repeater Pin
S.Aijaz5-Jun-08 22:53
S.Aijaz5-Jun-08 22:53 
GeneralRe: Is it possible to Get id of a row in repeater [modified] Pin
Gayani Devapriya6-Jun-08 1:54
Gayani Devapriya6-Jun-08 1:54 
QuestionAuto Redirect from Paypal Pin
Krazy Programmer5-Jun-08 19:52
Krazy Programmer5-Jun-08 19:52 
AnswerRe: Auto Redirect from Paypal Pin
Bhumikabarot5-Jun-08 21:18
Bhumikabarot5-Jun-08 21:18 
AnswerRe: Auto Redirect from Paypal Pin
mdpavel6-Jun-08 7:02
mdpavel6-Jun-08 7:02 
QuestionFill table by XML document Pin
harunbagwan5-Jun-08 19:39
harunbagwan5-Jun-08 19:39 
QuestionFile upload control not accepting 15 MB document file Pin
Pankaj Garg5-Jun-08 19:12
Pankaj Garg5-Jun-08 19:12 
AnswerRe: File upload control not accepting 15 MB document file Pin
eyeseetee5-Jun-08 22:04
eyeseetee5-Jun-08 22:04 
QuestionRe: File upload control not accepting 15 MB document file Pin
Pankaj Garg6-Jun-08 1:10
Pankaj Garg6-Jun-08 1:10 
AnswerRe: File upload control not accepting 15 MB document file [modified] Pin
Gayani Devapriya6-Jun-08 3:07
Gayani Devapriya6-Jun-08 3:07 
QuestionTransfer failed to connect the server ??? Pin
koolprasad20035-Jun-08 18:19
professionalkoolprasad20035-Jun-08 18:19 
AnswerRe: Transfer failed to connect the server ??? Pin
eyeseetee5-Jun-08 22:03
eyeseetee5-Jun-08 22:03 
QuestionAutoComplete Extender Textbox With AutoPostbak Pin
Member 34533315-Jun-08 18:05
Member 34533315-Jun-08 18:05 
AnswerRe: AutoComplete Extender Textbox With AutoPostbak Pin
eyeseetee5-Jun-08 22:01
eyeseetee5-Jun-08 22:01 

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.