<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Web Forms</title><link>http://forums.asp.net/18.aspx</link><description>All about building ASP.NET Pages - server controls, events, validation, etc.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: loop through dynamic form fields</title><link>http://forums.asp.net/thread/1513647.aspx</link><pubDate>Sun, 31 Dec 2006 04:56:26 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1513647</guid><dc:creator>mi32dogs</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1513647.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1513647</wfw:commentRss><description>Thanks for all the help&lt;br /&gt;</description></item><item><title>Re: loop through dynamic form fields</title><link>http://forums.asp.net/thread/1513625.aspx</link><pubDate>Sun, 31 Dec 2006 03:33:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1513625</guid><dc:creator>mbanavige</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1513625.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1513625</wfw:commentRss><description>&lt;p&gt;Yes - each placeholder declared on the masterpage represents a namingcontainer.&lt;/p&gt;
&lt;p&gt;Findcontrol can only find controls declared within the naming container from which findcontrol is called.&lt;/p&gt;
&lt;p&gt;So with a master page you get&lt;/p&gt;
&lt;p&gt;Page&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; --- Master Page&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --- Master Page "Content" Placeholder&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--- Your content&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://forums.asp.net/emoticons/emotion-1.gif" alt="Smile" /&gt; Dont forget to close out your thread if you're all set.&amp;nbsp; You can mark it as "Resolved" at the top if there is no individual post that represents your answer.&amp;nbsp; Or if you consider any reply to be your&amp;nbsp;answer, you can click the "Mark As Answer" button for that specific post.&amp;nbsp; This action also sets the thread status to "Resolved"&lt;/p&gt;
&lt;p&gt;Welcome to the forum.&lt;/p&gt;</description></item><item><title>Re: loop through dynamic form fields</title><link>http://forums.asp.net/thread/1513617.aspx</link><pubDate>Sun, 31 Dec 2006 02:57:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1513617</guid><dc:creator>mi32dogs</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1513617.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1513617</wfw:commentRss><description>Ok, I found the problem i use master pages so i have to use &lt;br /&gt;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;Dim&lt;/span&gt; ShowID &lt;span class="kwd"&gt;As&lt;/span&gt; DropDownList = &lt;span class="kwd"&gt;DirectCast&lt;/span&gt;(Master.FindControl(&lt;span class="st"&gt;"Content"&lt;/span&gt;).FindControl(controlName), DropDownList)&lt;/pre&gt;&amp;nbsp;I found this http://west-wind.com/weblog/posts/5127.aspx&lt;br /&gt;</description></item><item><title>Re: loop through dynamic form fields</title><link>http://forums.asp.net/thread/1513611.aspx</link><pubDate>Sun, 31 Dec 2006 02:27:50 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1513611</guid><dc:creator>mi32dogs</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1513611.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1513611</wfw:commentRss><description>&lt;p&gt;I tried it with Me.FindControl but i get the same error&lt;/p&gt;&lt;p&gt;I also tested ShowID1 to see if it is Nothing&amp;nbsp; but if i use ShowID1.Text i get the value so thats fine&lt;/p&gt;&lt;p&gt;I'm not sure why it is not working&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: loop through dynamic form fields</title><link>http://forums.asp.net/thread/1513521.aspx</link><pubDate>Sat, 30 Dec 2006 22:28:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1513521</guid><dc:creator>mbanavige</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1513521.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1513521</wfw:commentRss><description>&lt;p&gt;Check to see if ShowId is Nothing.&lt;/p&gt;
&lt;p&gt;Findcontrol only finds controls inside the naming container&amp;nbsp;from which findcontrol is called.&lt;/p&gt;
&lt;p&gt;You could try replacing Page.FindControl with Me.FindControl if these controls are not directly on the page.&lt;/p&gt;</description></item><item><title>Re: loop through dynamic form fields</title><link>http://forums.asp.net/thread/1513518.aspx</link><pubDate>Sat, 30 Dec 2006 22:18:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1513518</guid><dc:creator>mi32dogs</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1513518.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1513518</wfw:commentRss><description>&lt;p&gt;Hi Thanks but if do this i get a "Object reference not set to an instance of an object." Error&lt;br /&gt;This is part of the script&lt;br /&gt;&lt;/p&gt;&amp;nbsp;&amp;nbsp;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;For&lt;/span&gt; Z = 1 &lt;span class="kwd"&gt;To&lt;/span&gt; 12&lt;br /&gt;	&lt;span class="kwd"&gt;Dim&lt;/span&gt; controlName &lt;span class="kwd"&gt;As String&lt;/span&gt; = &lt;span class="st"&gt;"ShowID"&lt;/span&gt; &amp;amp; Z.ToString&lt;br /&gt;	&lt;span class="kwd"&gt;Dim&lt;/span&gt; ShowID &lt;span class="kwd"&gt;As&lt;/span&gt; DropDownList = &lt;span class="kwd"&gt;DirectCast&lt;/span&gt;(Page.FindControl(controlName), DropDownList)&lt;br /&gt;&lt;br /&gt;	controlName = &lt;span class="st"&gt;"Onsale"&lt;/span&gt; &amp;amp; Z.ToString&lt;br /&gt;	&lt;span class="kwd"&gt;Dim&lt;/span&gt; Onsale &lt;span class="kwd"&gt;As&lt;/span&gt; CheckBox = &lt;span class="kwd"&gt;DirectCast&lt;/span&gt;(Page.FindControl(controlName), CheckBox)&lt;br /&gt;&lt;br /&gt;	controlName = &lt;span class="st"&gt;"PreStart"&lt;/span&gt; &amp;amp; Z.ToString&lt;br /&gt;	&lt;span class="kwd"&gt;Dim&lt;/span&gt; PreStart &lt;span class="kwd"&gt;As&lt;/span&gt; BasicFrame.WebControls.BDPLite = &lt;span class="kwd"&gt;DirectCast&lt;/span&gt;(Page.FindControl(controlName), BasicFrame.WebControls.BDPLite)&lt;br /&gt;&lt;br /&gt;	controlName = &lt;span class="st"&gt;"STime"&lt;/span&gt; &amp;amp; Z.ToString&lt;br /&gt;	&lt;span class="kwd"&gt;Dim&lt;/span&gt; STime &lt;span class="kwd"&gt;As&lt;/span&gt; TextBox = &lt;span class="kwd"&gt;DirectCast&lt;/span&gt;(Page.FindControl(controlName), TextBox)&lt;br /&gt;&lt;br /&gt;	controlName = &lt;span class="st"&gt;"PreEnd"&lt;/span&gt; &amp;amp; Z.ToString&lt;br /&gt;	&lt;span class="kwd"&gt;Dim&lt;/span&gt; PreEnd &lt;span class="kwd"&gt;As&lt;/span&gt; BasicFrame.WebControls.BDPLite = &lt;span class="kwd"&gt;DirectCast&lt;/span&gt;(Page.FindControl(controlName), BasicFrame.WebControls.BDPLite)&lt;br /&gt;&lt;br /&gt;	controlName = &lt;span class="st"&gt;"ETime"&lt;/span&gt; &amp;amp; Z.ToString&lt;br /&gt;	&lt;span class="kwd"&gt;Dim&lt;/span&gt; ETime &lt;span class="kwd"&gt;As&lt;/span&gt; TextBox = &lt;span class="kwd"&gt;DirectCast&lt;/span&gt;(Page.FindControl(controlName), TextBox)&lt;br /&gt;&lt;br /&gt;	controlName = &lt;span class="st"&gt;"Password"&lt;/span&gt; &amp;amp; Z.ToString&lt;br /&gt;	&lt;span class="kwd"&gt;Dim&lt;/span&gt; Password &lt;span class="kwd"&gt;As&lt;/span&gt; TextBox = &lt;span class="kwd"&gt;DirectCast&lt;/span&gt;(Page.FindControl(controlName), TextBox)&lt;br /&gt;&lt;br /&gt;	controlName = &lt;span class="st"&gt;"SDate"&lt;/span&gt; &amp;amp; Z.ToString&lt;br /&gt;	&lt;span class="kwd"&gt;Dim&lt;/span&gt; SDate &lt;span class="kwd"&gt;As&lt;/span&gt; CheckBox = &lt;span class="kwd"&gt;DirectCast&lt;/span&gt;(Page.FindControl(controlName), CheckBox)&lt;br /&gt;&lt;br /&gt;	&lt;span class="cmt"&gt;'test if field is empty&lt;/span&gt;
	&lt;span class="kwd"&gt;If&lt;/span&gt; ShowID.Text.ToString &amp;lt;&amp;gt; &lt;span class="st"&gt;"0"&lt;/span&gt; &lt;span class="kwd"&gt;Then 'here i'm getting the &lt;/span&gt;"Object reference not set to an instance of an object." Error
		&lt;span class="cmt"&gt;'Do something&lt;/span&gt;
	&lt;span class="kwd"&gt;End If &lt;br /&gt;Next&lt;/span&gt; &lt;/pre&gt;&amp;nbsp;&lt;pre class="coloredcode"&gt;&lt;/pre&gt;&amp;nbsp;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: loop through dynamic form fields</title><link>http://forums.asp.net/thread/1513451.aspx</link><pubDate>Sat, 30 Dec 2006 20:27:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1513451</guid><dc:creator>mbanavige</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1513451.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1513451</wfw:commentRss><description>&lt;p&gt;you could try something like this:&lt;/p&gt;&lt;pre class=coloredcode&gt;    &lt;span class=kwd&gt;For&lt;/span&gt; Z &lt;span class=kwd&gt;As Integer&lt;/span&gt; = 1 &lt;span class=kwd&gt;To&lt;/span&gt; 12
      &lt;span class=kwd&gt;Dim&lt;/span&gt; controlName &lt;span class=kwd&gt;As String&lt;/span&gt; = &lt;span class=st&gt;"Checkbox"&lt;/span&gt; &amp;amp; Z.ToString
      &lt;span class=kwd&gt;Dim&lt;/span&gt; thisCheckbox &lt;span class=kwd&gt;As&lt;/span&gt; CheckBox = &lt;span class=kwd&gt;DirectCast&lt;/span&gt;(Page.FindControl(controlName), CheckBox)
      &lt;span class=kwd&gt;If Not&lt;/span&gt; thisCheckbox &lt;span class=kwd&gt;Is Nothing AndAlso&lt;/span&gt; thisCheckbox.Checked = &lt;span class=kwd&gt;True Then&lt;/span&gt;
        &lt;span class=cmt&gt;'Do something
&lt;/span&gt;      &lt;span class=kwd&gt;End If    
    Next&lt;/span&gt;
&lt;/pre&gt;&amp;nbsp;</description></item><item><title>loop through dynamic form fields</title><link>http://forums.asp.net/thread/1513418.aspx</link><pubDate>Sat, 30 Dec 2006 19:51:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1513418</guid><dc:creator>mi32dogs</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1513418.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1513418</wfw:commentRss><description>&lt;p class="MsoNormal"&gt;Here is my problem&lt;/p&gt;

&lt;p class="MsoNormal"&gt;I have a form with 12 rows with all the same fields (row 1
has textbox1, checkbox1, etc.. Row 2 has textbox2, checkbox2, etc..)&lt;/p&gt;

&lt;p class="MsoNormal"&gt;If the form gets submitted I like to loop through the form
data but how do I call the form data&lt;br /&gt;
for example checkbox+Z.Checked dos not work&lt;span&gt;&amp;nbsp;
&lt;/span&gt;in JS you can use eval() but that dos not work &lt;/p&gt;

&lt;p class="MsoNormal"&gt;For Z = 1 To 12&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-left:0.5in;"&gt;If checkbox+Z.Checked Then&lt;br /&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;‘Do something&lt;br /&gt;
End If&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Next&lt;/p&gt;</description></item></channel></rss>