<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.aspnetzone.de/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>Webforms, Webcontrols, usw. (C# und VB.NET)</title><link>http://www.aspnetzone.de/forums/29/ShowForum.aspx</link><description>Hier können Fragen zu Webforms, Webcontrols, usw. gestellt werden.</description><dc:language /><generator>CommunityServer 2.1 SP2 (Build: 61120.2)</generator><item><title>AW: Zugriff auf TextBoxes</title><link>http://www.aspnetzone.de/forums/thread/224254.aspx</link><pubDate>Tue, 08 May 2012 08:01:34 GMT</pubDate><guid isPermaLink="false">ce930855-ae9b-4fa4-8077-06a76071cc6a:224254</guid><dc:creator>carromo</dc:creator><slash:comments>0</slash:comments><comments>http://www.aspnetzone.de/forums/thread/224254.aspx</comments><wfw:commentRss>http://www.aspnetzone.de/forums/commentrss.aspx?SectionID=29&amp;PostID=224254</wfw:commentRss><description>&lt;P&gt;Super, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vielen Dank Euch beiden, hat alles wunderbar geklappt jetzt &lt;img src="http://www.aspnetzone.de/emoticons/emotion-46.gif" alt="Drinks" /&gt;&lt;/P&gt;</description></item><item><title>AW: Zugriff auf TextBoxes</title><link>http://www.aspnetzone.de/forums/thread/224252.aspx</link><pubDate>Tue, 08 May 2012 07:01:27 GMT</pubDate><guid isPermaLink="false">ce930855-ae9b-4fa4-8077-06a76071cc6a:224252</guid><dc:creator>TiSch</dc:creator><slash:comments>0</slash:comments><comments>http://www.aspnetzone.de/forums/thread/224252.aspx</comments><wfw:commentRss>http://www.aspnetzone.de/forums/commentrss.aspx?SectionID=29&amp;PostID=224252</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://www.aspnetzone.de/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;carromo:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;vielen Dank für die Antwort - auch wenn es nicht das ist was ich hören wollte &lt;img src="http://www.aspnetzone.de/emoticons/emotion-7.gif" alt="Tongue Tied" /&gt;. Wenn ich Dich richtig verstanden habe, müssten meine Controls schon im Page_load erstellt werden, allerdings weiß ich nicht wie ich das realisieren soll. Der Ablauf der gesamten Eingabe ist folgednermaßen:&lt;/p&gt;...&lt;br&gt;&lt;br&gt;Da die Anzahl und die IDs der TextBoxes ja erst bei "Schritt 2" bekannt sind können diese ja nicht beim Page_Load erstellt werden oder funktioniert es, wenn ich im Page Load den Inhalt des Textes auswerte und die Boxes erstelle?&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br&gt;&lt;br&gt;Du kannst Controls erstellen wann Du willst, sie müssen nur allerspätestens in page_load (besser page_init) wiedererstellt werden. Dynamisch erzeugte Controls müssen in ASP.NET nach jedem Postback neu erstellt werden. Das sollte eben nicht später als Page_Load stattfinden damit der ViewState noch funktioniert, um Events auszulösen(immer de gleichen ID's verwenden) oder Werte auszulesen (z.B. TextBox.Text). Du brauchst normalerweise bloss die derzeitige Anzahl irgendwo zu speichern (Session,VieewState,Hiddenfield,...). Anhand dieser kannst Du dann die Control erzeugen.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href="http://weblogs.asp.net/infinitiesloop/archive/2006/08/25/TRULY-Understanding-Dynamic-Controls-_2800_Part-1_2900_.aspx"&gt;TRULY Understanding Dynamic Controls&lt;/a&gt;&lt;br&gt;</description></item><item><title>AW: Zugriff auf TextBoxes</title><link>http://www.aspnetzone.de/forums/thread/224249.aspx</link><pubDate>Tue, 08 May 2012 05:43:33 GMT</pubDate><guid isPermaLink="false">ce930855-ae9b-4fa4-8077-06a76071cc6a:224249</guid><dc:creator>carromo</dc:creator><slash:comments>0</slash:comments><comments>http://www.aspnetzone.de/forums/thread/224249.aspx</comments><wfw:commentRss>http://www.aspnetzone.de/forums/commentrss.aspx?SectionID=29&amp;PostID=224249</wfw:commentRss><description>&lt;P&gt;Guten morgen Stefan, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vielen Dank für die Antwort - auch wenn es nicht das ist was ich hören wollte &lt;img src="http://www.aspnetzone.de/emoticons/emotion-7.gif" alt="Tongue Tied" /&gt;. Wenn ich Dich richtig verstanden habe, müssten meine Controls schon im Page_load erstellt werden, allerdings weiß ich nicht wie ich das realisieren soll. Der Ablauf der gesamten Eingabe ist folgednermaßen:&lt;/P&gt;
&lt;P&gt;1. Auswahl einer Zielgruppe --&amp;gt; es wird das entsprechende View des Multiviews aufegrufen&lt;/P&gt;
&lt;P&gt;2. Im View wir eine Textauswahl angeboten --&amp;gt;im ausgewählten Text sind x Platzhalter der Form [Uhrzeit], [strasse] etc. enthalten. Anhand dieser Platzhalter werden die TExtBoxes zur eingabe der Werte erstellt. (ID wird anhand des Platzhalters erstellt)&lt;/P&gt;
&lt;P&gt;3. Genereiren des Briefes --&amp;gt;Im Text sollen die Platzhalter durch die Eingaben ersetzt werden und der Serienbrief erstellt werden&lt;/P&gt;
&lt;P&gt;Da die Anzahl und die IDs der TextBoxes ja erst bei "Schritt 2" bekannt sind können diese ja nicht beim Page_Load erstellt werden oder funktioniert es, wenn ich im Page Load den Inhalt des Textes auswerte und die Boxes erstelle??&amp;nbsp;&amp;nbsp;Oder hast Du vielleicht eine einfachere Idee?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>AW: Zugriff auf TextBoxes</title><link>http://www.aspnetzone.de/forums/thread/224244.aspx</link><pubDate>Mon, 07 May 2012 14:57:26 GMT</pubDate><guid isPermaLink="false">ce930855-ae9b-4fa4-8077-06a76071cc6a:224244</guid><dc:creator>Stefan Falz</dc:creator><slash:comments>0</slash:comments><comments>http://www.aspnetzone.de/forums/thread/224244.aspx</comments><wfw:commentRss>http://www.aspnetzone.de/forums/commentrss.aspx?SectionID=29&amp;PostID=224244</wfw:commentRss><description>Hi,&lt;br&gt;&lt;br&gt;wann erzeugst Du diese TextBoxen? Nur einmalig nach Auswahl eines Werts in der ListBox? Falls ja, das geht so nicht. Dynamisch erstellte Controls müssen immer erzeugt werden, auch bei PostBacks. Zudem sollten diese Controls in Page_Init, spät. aber in Page_Load erzeugt werden, ansonsten können diese für eigene PostBack Verarbeitung meist nicht mehr verwendet werden.&lt;br&gt;&lt;br&gt;</description></item><item><title>Zugriff auf TextBoxes</title><link>http://www.aspnetzone.de/forums/thread/224241.aspx</link><pubDate>Mon, 07 May 2012 13:14:08 GMT</pubDate><guid isPermaLink="false">ce930855-ae9b-4fa4-8077-06a76071cc6a:224241</guid><dc:creator>carromo</dc:creator><slash:comments>0</slash:comments><comments>http://www.aspnetzone.de/forums/thread/224241.aspx</comments><wfw:commentRss>http://www.aspnetzone.de/forums/commentrss.aspx?SectionID=29&amp;PostID=224241</wfw:commentRss><description>&lt;P&gt;Hallo an alle, &lt;/P&gt;
&lt;P&gt;ich habe ein Problem, bei dem ich scheinbar gerade etwas auf dem Schlauch stehe &lt;img src="http://www.aspnetzone.de/emoticons/emotion-6.gif" alt="Sad" /&gt;.&lt;/P&gt;
&lt;P&gt;Ich habe ein Multiview, in dem unter anderen ein DropDown Feld mit Textvorlagen hinterlegt ist. In diesen Textvorlagen gibt es Platzhalter (gekennzeichnet durch [platzhalter]), die über Texteingaben gefüllt werden müssen. Das habe ich ich über die DropDown Flder gelöst (AutoPostback). Das klappt auch, zumidest erscheinen die TextBoxes:&lt;/P&gt;
&lt;P&gt;&lt;code&gt;&lt;span style="color: Black;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style="color: Green;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;//tmpStart und tmpEnde werden korrekt ermittelt und die Boxen auch korrekt benannt ---&amp;gt;lt. Quelltext im IE)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;TextBox tb &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;=&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;new&lt;/span&gt; TextBox();&lt;br /&gt;tb.ID &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;=&lt;/span&gt; &lt;span style="color: #666666;background-color: #e4e4e4;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;"TextBox_"&lt;/span&gt; &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;+&lt;/span&gt; tmpText.Substring(tmpStart, (tmpEnde &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;-&lt;/span&gt; tmpStart));&lt;br /&gt;&lt;br /&gt;View tnView &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;=&lt;/span&gt; (View)&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;this&lt;/span&gt;.viewAnschreiben.FindControl(&lt;span style="color: #666666;background-color: #e4e4e4;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;"aktuelleView"&lt;/span&gt;);&lt;br /&gt;tnView.Controls.Add(tb);&lt;/span&gt;&lt;/code&gt;&lt;/P&gt;
&lt;P&gt;Mein Problem ist nun, dass ich die TextBoxen "nicht finde", d.h. nach einen Klick auf einen Button müsste ich diese auslesen. Ich habe schon alles mögliche versucht. Mein letzter VErsuch:&lt;/P&gt;
&lt;P&gt;&lt;code&gt;&lt;span style="color: Black;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt; &lt;br /&gt;&lt;br /&gt;View tnView &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;=&lt;/span&gt; (View)&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;this&lt;/span&gt;.viewAnschreiben.FindControl(&lt;span style="color: #666666;background-color: #e4e4e4;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;"aktuelleView"&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;foreach&lt;/span&gt; (Control c &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;in&lt;/span&gt; tnView.Controls)&lt;br /&gt;{&lt;br /&gt;Response.Write(c.ID);&lt;br /&gt;Response.Write(&lt;span style="color: #666666;background-color: #e4e4e4;font-family: Courier New;font-size: 14px;font-weight: normal;"&gt;"&amp;lt;br&amp;gt;"&lt;/span&gt;);&lt;br /&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;JA, Response.Write soll nicht benutzt werden, aber zum "ausprobieren" finde ich das ganz praktisch. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Sehe ich das falsch, dass die TextBoxes hier auftauchen müssten oder habe ich hier eine Schleife zu viel im Hirn?? Alle anderen Controls (u.a. die DropDown Liste taucht auf.)&lt;/P&gt;
&lt;P&gt;Vielen Dank für Eure Hilfe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item></channel></rss>