Webmaster Forums Banner Professional Hosting from Just Host
Welcome Guest Search | Active Topics | Members | Log In | Register

syntex error problem Options
manzor
Posted: Thursday, May 22, 2008 7:07:44 AM
Rank: Advanced Member
Groups: Member

Joined: 1/31/2008
Posts: 32
Points: 96
Location: UK
Hi Gus,

I am facing the problem with hidden field. here is my code.

Code:
Dim i As Integer
If (dstFileDataSet.Tables(0).Rows.Count <> 0) Then
i = 0
For Each dr In dstFileDataSet.Tables(0).Rows
strChkUploadedBy = dr("UploadedBy").ToString()
Controls.Add(New LiteralControl("<input type=hidden id=""strChkUploadedBy"" name=""strChkUploadedBy<%=i%>"" value= """ + strChkUploadedBy + """ >"))
Next
i = i + 1
Response.Write(i)
End If


I am uable to get i vale like strChkUploadedBy1,strChkUploadedBy2....



Can any one help how to get like above?
Sponsor
Posted: Thursday, May 22, 2008 7:07:44 AM
steven
Posted: Thursday, May 22, 2008 7:09:28 AM
Rank: Advanced Member
Groups: Member

Joined: 4/3/2008
Posts: 63
Points: 189
Location: Sheffield, UK
try that that should solve your error

Code:
Dim i As Integer
If (dstFileDataSet.Tables(0).Rows.Count <> 0) Then
i = 0
For Each dr In dstFileDataSet.Tables(0).Rows


strChkUploadedBy = dr("UploadedBy").ToString()
Controls.Add(New LiteralControl(string.Format("<input type=hidden id='strChkUploadedBy{0}' name='strChkUploadedBy{0}' value= '{1}'>",i,strChkUploadedBy )))

i = i + 1
Next

Response.Write(i)
End If



this should fix the code but why dont you use a control like repeater to generate the list for you rather than having to loop through?

Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

ASPNET Theme created by Boskone (Dan Ferguson)
Powered by HaqTech.Com
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.472 seconds.