Click here to Skip to main content
15,910,603 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Displaying database content / best practices Pin
Not Active4-Jan-07 15:46
mentorNot Active4-Jan-07 15:46 
QuestionASP.NET master pages Pin
anikhil4-Jan-07 12:17
anikhil4-Jan-07 12:17 
AnswerRe: ASP.NET master pages Pin
Chris Buckett4-Jan-07 21:24
Chris Buckett4-Jan-07 21:24 
QuestionExport to excel Pin
felopater4-Jan-07 11:04
felopater4-Jan-07 11:04 
AnswerRe: Export to excel Pin
saravanan054-Jan-07 12:12
saravanan054-Jan-07 12:12 
Questioncheck1 not declared Pin
luvdairish4-Jan-07 8:26
luvdairish4-Jan-07 8:26 
AnswerRe: check1 not declared Pin
ednrgc4-Jan-07 9:33
ednrgc4-Jan-07 9:33 
AnswerRe: check1 not declared Pin
Christian Graus4-Jan-07 11:45
protectorChristian Graus4-Jan-07 11:45 
luvdairish wrote:
</blockquote>

Don't do this, it's nasty. Put the code in a code behind file.


<blockquote class="FQ"><div class="FQA">luvdairish wrote:</div><ItemTemplate>
47 <tr bgcolor="#f0f0f0">48 <td><%#Container.DataItem("ProductName")%> </td>49 <td><asp:CheckBox id="check1" runat="server" OnCheckedChanged="Check" AutoPostBack=true/></td>50 <td><asp:TextBox id="Qty" maxlength=3 runat="server" />
51 </td>52 </tr>53 </ItemTemplate></blockquote>

If you create a control in an item template, it's going to be created once per row. As such, those checkboxes can't all have the same name, and so the framework has to generate names for them. You need to handle the check changed event per row, or iterate over all the rows looking for which rows have been changed.



<div class="ForumSig">Christian Graus - Microsoft MVP - C++
<a href='http://blog.metalmusings.com/'>Metal Musings</a> - Rex and my new metal blog</div>

AnswerRe: check1 not declared Pin
nagendra rao s.v.4-Jan-07 18:42
nagendra rao s.v.4-Jan-07 18:42 
QuestionN-Tier question [modified] Pin
Marcus J. Smith4-Jan-07 7:47
professionalMarcus J. Smith4-Jan-07 7:47 
AnswerRe: N-Tier question Pin
Mike Ellison4-Jan-07 14:14
Mike Ellison4-Jan-07 14:14 
GeneralRe: N-Tier question Pin
Marcus J. Smith5-Jan-07 2:25
professionalMarcus J. Smith5-Jan-07 2:25 
GeneralRe: N-Tier question Pin
Mike Ellison8-Jan-07 6:24
Mike Ellison8-Jan-07 6:24 
QuestionSeeking advice Pin
Keith Andersch4-Jan-07 6:15
Keith Andersch4-Jan-07 6:15 
AnswerRe: Seeking advice Pin
ednrgc4-Jan-07 6:40
ednrgc4-Jan-07 6:40 
GeneralRe: Seeking advice Pin
Keith Andersch4-Jan-07 7:22
Keith Andersch4-Jan-07 7:22 
QuestionForum Software Pin
gvirden4-Jan-07 5:55
gvirden4-Jan-07 5:55 
AnswerRe: Forum Software Pin
Vasudevan Deepak Kumar4-Jan-07 6:08
Vasudevan Deepak Kumar4-Jan-07 6:08 
AnswerRe: Forum Software Pin
gvirden4-Jan-07 10:11
gvirden4-Jan-07 10:11 
Questionreg. database connection thru .bat file Pin
montu33774-Jan-07 5:00
montu33774-Jan-07 5:00 
AnswerRe: reg. database connection thru .bat file Pin
Vasudevan Deepak Kumar4-Jan-07 6:09
Vasudevan Deepak Kumar4-Jan-07 6:09 
QuestionCharacter Report (text Report) Pin
Haseeb Mukhtar4-Jan-07 2:49
Haseeb Mukhtar4-Jan-07 2:49 
AnswerRe: Character Report (text Report) Pin
ednrgc4-Jan-07 3:57
ednrgc4-Jan-07 3:57 
QuestionReturn XML in stead of HTML Pin
Eduard Keilholz4-Jan-07 1:59
Eduard Keilholz4-Jan-07 1:59 
AnswerRe: Return XML in stead of HTML Pin
DavidNohejl4-Jan-07 2:01
DavidNohejl4-Jan-07 2: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.