Click here to Skip to main content
15,919,613 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionhow to find out the row in ASp.net Pin
Rmesh6-Dec-06 5:27
Rmesh6-Dec-06 5:27 
AnswerRe: how to find out the row in ASp.net Pin
l0kke6-Dec-06 6:45
l0kke6-Dec-06 6:45 
AnswerRe: how to find out the row in ASp.net Pin
Vasudevan Deepak Kumar6-Dec-06 6:48
Vasudevan Deepak Kumar6-Dec-06 6:48 
Questionhow to write write code in asp.net? Pin
Rmesh6-Dec-06 5:17
Rmesh6-Dec-06 5:17 
AnswerRe: how to write write code in asp.net? Pin
l0kke6-Dec-06 6:43
l0kke6-Dec-06 6:43 
AnswerRe: how to write write code in asp.net? Pin
Vasudevan Deepak Kumar6-Dec-06 6:47
Vasudevan Deepak Kumar6-Dec-06 6:47 
AnswerRe: how to write write code in asp.net? Pin
Smiles746-Dec-06 9:36
Smiles746-Dec-06 9:36 
GeneralRe: how to write write code in asp.net? Pin
szukuro7-Dec-06 1:55
szukuro7-Dec-06 1:55 
There's a much easier way if you want to use client-side code:

string script="<script>function CheckAll(){";<br />
script += "document.getElementById('" + CheckBox1.ClientID + "').checked = true";<br />
script += "document.getElementById('" + CheckBox2.ClientID + "').checked = true";<br />
...<br />
script += "}</script>";<br />
<br />
Page.RegisterStarupScript("CheckAll", script);<br />
Button1.Attributes.Add("onclick", "Checkall();return false");<br />


Obviously this code has some bad things about it (if you have 100 CheckBoxes, it gets very lengthy, and also much slower, then if you would use StringBuilder). Also for ASP.NET 2.0 use should use

Page.ClientScript.RegisterStarupScript(this, "CheckAll", script);

I just wanted to show that you can do this without writing tons of nasty Javascript, and still get it working on the client-side, and also the you DO know the client-side ID of server controls (ClientID property).
Question'&nbsp;' and NVL(abc,'') [modified] Pin
Smiles746-Dec-06 5:17
Smiles746-Dec-06 5:17 
Questionhow can i find and html element position Pin
m.rastgar6-Dec-06 3:20
m.rastgar6-Dec-06 3:20 
QuestionMousehover control in code behind Pin
krishna_mag6-Dec-06 3:16
krishna_mag6-Dec-06 3:16 
AnswerRe: Mousehover control in code behind Pin
eggsovereasy6-Dec-06 3:38
eggsovereasy6-Dec-06 3:38 
Questionupload file security risk? Pin
abdz6-Dec-06 2:47
abdz6-Dec-06 2:47 
AnswerRe: upload file security risk? Pin
Vasudevan Deepak Kumar6-Dec-06 6:50
Vasudevan Deepak Kumar6-Dec-06 6:50 
AnswerRe: upload file security risk? Pin
l0kke6-Dec-06 6:52
l0kke6-Dec-06 6:52 
Questionhelp Pin
rony_mansy6-Dec-06 2:26
rony_mansy6-Dec-06 2:26 
AnswerRe: help Pin
Not Active6-Dec-06 2:38
mentorNot Active6-Dec-06 2:38 
AnswerRe: help Pin
Vasudevan Deepak Kumar6-Dec-06 6:50
Vasudevan Deepak Kumar6-Dec-06 6:50 
QuestionJavascript Problem Pin
monika_vasvani6-Dec-06 1:48
monika_vasvani6-Dec-06 1:48 
AnswerRe: Javascript Problem Pin
thomas_joyee6-Dec-06 2:46
thomas_joyee6-Dec-06 2:46 
GeneralRe: Javascript Problem Pin
monika_vasvani6-Dec-06 17:43
monika_vasvani6-Dec-06 17:43 
AnswerRe: Javascript Problem Pin
kalyan_vb7-Dec-06 9:07
kalyan_vb7-Dec-06 9:07 
AnswerRe: TreeView question Pin
Not Active6-Dec-06 2:41
mentorNot Active6-Dec-06 2:41 
QuestionSimple problem Pin
-Yoyosh-6-Dec-06 1:25
-Yoyosh-6-Dec-06 1:25 
AnswerRe: Simple problem Pin
Guffa6-Dec-06 8:45
Guffa6-Dec-06 8:45 

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.