Click here to Skip to main content
15,914,608 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Persistent client side changes Pin
derm229-Apr-08 6:43
derm229-Apr-08 6:43 
Questioncleaing memory on client side -javascript Pin
michael@cohen27-Apr-08 6:22
michael@cohen27-Apr-08 6:22 
GeneralRe: cleaing memory on client side -javascript Pin
Christian Graus27-Apr-08 11:32
protectorChristian Graus27-Apr-08 11:32 
GeneralTimed Exams Pin
Mohammad A Gdeisat27-Apr-08 3:09
Mohammad A Gdeisat27-Apr-08 3:09 
GeneralRe: Timed Exams Pin
Krazy Programmer27-Apr-08 7:42
Krazy Programmer27-Apr-08 7:42 
GeneralRe: Timed Exams Pin
Mohammad A Gdeisat27-Apr-08 10:40
Mohammad A Gdeisat27-Apr-08 10:40 
GeneralRe: Timed Exams Pin
Christian Graus27-Apr-08 11:36
protectorChristian Graus27-Apr-08 11:36 
GeneralProblem dynamically painting a control in a SharePoint WebPart Pin
JimmyRopes26-Apr-08 13:13
professionalJimmyRopes26-Apr-08 13:13 
I am writing a WebPart for SharePoint and am having trouble re-painting a control (not ASP control) when I want to reflect some scripting action.

My class inherits from "Microsoft.SharePoint.WebPartPages.WebPart".

I found the ASP listbox control lacking because I wanted to include a checkbox, graphics as well as text for each item.

An array of checkboxes contained within a div (for scrolling) contained in a feldset (for a border to contain the entire set) made for a good display of the data with the ability to access each item individuality.

The array is rendering the way I want it with a checkbox, icon and text for each item and the scrolling is working properly.

I am able to check and un-check each individual item in the array of checkboxes but the CheckAll() and ClearAll() functions are not checking or clearing all the items in the array.

Can anyone tell me what I need to do to make the CheckAll() and ClearAll() functions work?


In "protected override void RenderContents(HtmlTextWriter writer)"
<br />
                writer.Write("<fieldset style='width: 760px;'>");<br />
                writer.Write("<legend><strong>" + lblDocInfo.Text + "</strong></legend>");<br />
<br />
                writer.Write("<div style='overflow: auto; height: 145px;'>");<br />
<br />
                foreach (string folder_key in current_folders)<br />
                {<br />
                    writer.Write("<input type=checkbox name='" + folder_key + "' id='" + folder_key + "'><img src='http://sharepointservername/projectname/websitename/icons/folder.ico' align='middle'> " + folder_key.Substring(folder_key.LastIndexOf("/") + 1) + "</input><br />");<br />
                } // foreach(string folder in current_folders)<br />
<br />
                foreach (string doc_key in current_docs)<br />
                {<br />
                    writer.Write("<input type=checkbox name='" + doc_key + "' id='" + doc_key + "'><img src='http://sharepointservername/projectname/websitename/icons/doc.ico' align='middle'> " + doc_key.Substring(doc_key.LastIndexOf("/") + 1) + "</input><br />");<br />
                } // foreach(string doc in current_docs)<br />
<br />
                writer.Write("</div>"); // <div style='overflow: auto; height: 145px;'><br />
<br />
                writer.Write("</fieldset>");<br />
<br />
                writer.Write("<br /><br />");<br />
                writer.Write("<input id='btnCheckAll' type='button' value='Check All Documents' onclick='CheckAll();' style='width: 380px;' />");<br />
                writer.Write("<input id='btnClearAll'type='button' value='Clear All Checked Documents' onclick='ClearAll();' style='width: 380px;' />");<br />
                writer.Write("<br />");<br />
                btnProcess.RenderControl(writer);<br />
                writer.Write("<br /><br />");<br />


and further down in the code

<br />
                writer.Write("<script type='text/javascript'>");<br />
<br />
                writer.Write("function CheckAll(){");<br />
                foreach (string doc_key in current_docs)<br />
                {<br />
                    writer.Write("document.getElementById(doc_key).checked = true;");<br />
                } // foreach(string doc in current_docs)<br />
                writer.Write("document.getElementById('btnClearAll').disabled = false;");<br />
                writer.Write("}"); // function CheckAll()<br />
<br />
                writer.Write("function ClearAll(){");<br />
                foreach (string doc_key in current_docs)<br />
                {<br />
                    writer.Write("document.getElementById(doc_key).checked = false;");<br />
                } // foreach(string doc in current_docs)<br />
                writer.Write("document.getElementById('btnClearAll').disabled = true;");<br />
                writer.Write("}"); // function ClearAll()<br />
<br />
                writer.Write("</script>");<br />



Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems

I'm on-line therefore I am.
JimmyRopes



QuestionError 7 Pin
razi_Seyyedi26-Apr-08 11:53
razi_Seyyedi26-Apr-08 11:53 
GeneralRe: Error 7 Pin
Christian Graus26-Apr-08 13:44
protectorChristian Graus26-Apr-08 13:44 
GeneralRe: Error 7 Pin
Guffa26-Apr-08 14:33
Guffa26-Apr-08 14:33 
QuestionDynamic Internationalization Pin
harshGupta26-Apr-08 10:03
harshGupta26-Apr-08 10:03 
GeneralRe: Dynamic Internationalization Pin
Christian Graus26-Apr-08 11:16
protectorChristian Graus26-Apr-08 11:16 
QuestionUsing javascript functions ? Pin
kindman_nb26-Apr-08 9:46
kindman_nb26-Apr-08 9:46 
AnswerRe: Using javascript functions ? Pin
Blue_Boy26-Apr-08 10:12
Blue_Boy26-Apr-08 10:12 
GeneralRe: Using javascript functions ? Pin
kindman_nb26-Apr-08 20:53
kindman_nb26-Apr-08 20:53 
AnswerRe: Using javascript functions ? Pin
Christian Graus26-Apr-08 11:15
protectorChristian Graus26-Apr-08 11:15 
GeneralRe: Using javascript functions ? Pin
kindman_nb26-Apr-08 20:54
kindman_nb26-Apr-08 20:54 
AnswerRe: Using javascript functions ? Pin
samMaster27-Apr-08 0:18
samMaster27-Apr-08 0:18 
GeneralRe: Using javascript functions ? Pin
kindman_nb27-Apr-08 5:02
kindman_nb27-Apr-08 5:02 
GeneralRe: Using javascript functions ? Pin
samMaster27-Apr-08 18:44
samMaster27-Apr-08 18:44 
GeneralRe: Using javascript functions ? Pin
kindman_nb28-Apr-08 3:53
kindman_nb28-Apr-08 3:53 
GeneralAccessing a DropDownList inside a DetailsView Pin
Ekjon26-Apr-08 7:07
Ekjon26-Apr-08 7:07 
GeneralRe: Accessing a DropDownList inside a DetailsView Pin
AlexeiXX326-Apr-08 7:34
AlexeiXX326-Apr-08 7:34 
GeneralRe: Accessing a DropDownList inside a DetailsView Pin
Ekjon26-Apr-08 10:02
Ekjon26-Apr-08 10:02 

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.