Click here to Skip to main content
15,892,643 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Best way to implement Rich Client Application Pin
Dean Oliver31-Jan-12 8:05
Dean Oliver31-Jan-12 8:05 
QuestionDropdown list to populate a gridview Pin
pmcm31-Jan-12 0:54
pmcm31-Jan-12 0:54 
AnswerRe: Dropdown list to populate a gridview Pin
pmcm31-Jan-12 1:13
pmcm31-Jan-12 1:13 
Questionasp.net toggle image Pin
disha desani30-Jan-12 21:54
disha desani30-Jan-12 21:54 
SuggestionRe: asp.net toggle image Pin
Rajeev Jayaram30-Jan-12 23:19
Rajeev Jayaram30-Jan-12 23:19 
GeneralRe: asp.net toggle image Pin
disha desani1-Feb-12 18:28
disha desani1-Feb-12 18:28 
AnswerRe: asp.net toggle image Pin
Sankalp Deep1-Feb-12 8:57
Sankalp Deep1-Feb-12 8:57 
GeneralRe: asp.net toggle image Pin
disha desani1-Feb-12 18:25
disha desani1-Feb-12 18:25 
I tried as u said and
My code is as below..



Protected Sub ImageButton2_Click1(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)

For i As Integer = 0 To GridView1.Rows.Count - 1


Dim imgbutton As ImageButton = DirectCast(GridView1.Rows(i).Cells(2).Controls(0), ImageButton)

If imgbutton.ImageUrl = "~/Image/Red.png" Then
imgbutton.ImageUrl = "~/Image/Green.png"

ElseIf imgbutton.ImageUrl = "~/Image/Green.png" Then
imgbutton.ImageUrl = "~/Image/Blue.png"

ElseIf imgbutton.ImageUrl = "~/Image/Blue.png" Then
imgbutton.ImageUrl = "~/Image/Black.png"

Else
imgbutton.ImageUrl = "~/Image/Red.png"

End If

Next

End Sub


but it gives me an error like..

Specified argument was out of the range of valid values. Parameter name: index

in this code line--> Dim imgbutton As ImageButton = DirectCast(GridView1.Rows(i).Cells(2).Controls(0), ImageButton)


Any solution for that??
GeneralRe: asp.net toggle image Pin
Satish_S2-Feb-12 2:19
Satish_S2-Feb-12 2:19 
GeneralRe: asp.net toggle image Pin
disha desani2-Feb-12 18:25
disha desani2-Feb-12 18:25 
GeneralRe: asp.net toggle image Pin
disha desani2-Feb-12 18:19
disha desani2-Feb-12 18:19 
GeneralRe: asp.net toggle image Pin
Satish_S5-Feb-12 20:37
Satish_S5-Feb-12 20:37 
QuestionSession expire Pin
Rectus30-Jan-12 7:05
Rectus30-Jan-12 7:05 
AnswerRe: Session expire Pin
Dean Oliver30-Jan-12 7:31
Dean Oliver30-Jan-12 7:31 
QuestionHow can we update row in database table if browser is closed Pin
Member 368287130-Jan-12 2:01
Member 368287130-Jan-12 2:01 
AnswerRe: How can we update row in database table if browser is closed Pin
Not Active30-Jan-12 2:09
mentorNot Active30-Jan-12 2:09 
AnswerRe: How can we update row in database table if browser is closed Pin
RK KL30-Jan-12 5:12
RK KL30-Jan-12 5:12 
AnswerRe: How can we update row in database table if browser is closed Pin
R. Giskard Reventlov30-Jan-12 6:36
R. Giskard Reventlov30-Jan-12 6:36 
AnswerRe: How can we update row in database table if browser is closed Pin
Sankalp Deep1-Feb-12 9:00
Sankalp Deep1-Feb-12 9:00 
QuestionFile Open/SaveAs/Delete Option Pin
Jagjit Saini29-Jan-12 1:27
Jagjit Saini29-Jan-12 1:27 
AnswerRe: File Open/SaveAs/Delete Option Pin
R. Giskard Reventlov30-Jan-12 6:35
R. Giskard Reventlov30-Jan-12 6:35 
QuestionMy site is localized. How do I use page_load to get querystrings? Pin
Jason P. Weber28-Jan-12 18:52
Jason P. Weber28-Jan-12 18:52 
AnswerRe: My site is localized. How do I use page_load to get querystrings? Pin
Ali Al Omairi(Abu AlHassan)29-Jan-12 3:27
professionalAli Al Omairi(Abu AlHassan)29-Jan-12 3:27 
GeneralRe: My site is localized. How do I use page_load to get querystrings? Pin
Jason P. Weber29-Jan-12 3:30
Jason P. Weber29-Jan-12 3:30 
GeneralRe: My site is localized. How do I use page_load to get querystrings? Pin
Ali Al Omairi(Abu AlHassan)29-Jan-12 3:42
professionalAli Al Omairi(Abu AlHassan)29-Jan-12 3:42 

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.