Click here to Skip to main content
15,902,802 members

Comments by Prasad J (Top 10 by date)

Prasad J 8-Aug-12 2:53am View    
You can get the checked values from the checkboxlist as:
string values = getCheckBoxValues();
private string getCheckBoxValues()
{
string value = "";
for (int loopIndex = 0; loopIndex < CheckBoxList1.Items.Count; loopIndex++)
{
if (CheckBoxList1.Items[loopIndex].Selected)
value += "true,";
else
value += "false,";
}
return value.TrimEnd(',');
}

Also, you can preset the values by calling
presetChechbox("true,true,false,false");
private void presetChechbox(string value)
{
string[] values = value.Split(',');
// Ensure both chechbox itexs and string contain same number of items.
if (values.Length != CheckBoxList1.Items.Count)
return;

for (int loopIndex = 0; loopIndex < CheckBoxList1.Items.Count; loopIndex++)
{
bool selectedVal=false;
bool.TryParse(values[loopIndex], out selectedVal);
CheckBoxList1.Items[loopIndex].Selected = selectedVal;
}
}
Prasad J 8-Aug-12 2:09am View    
confirm that your variable [imgBinaryData] is a byte array.
Prasad J 8-Aug-12 1:27am View    
Before inserting the session id into the table, you have to check whether the new id is already exist, if so you have create a new session or remove the previous entry from the table.
Prasad J 8-Aug-12 1:20am View    
please remove 'xmlns:asp="#unknown"' from the aspx
Prasad J 6-Aug-12 1:03am View    
Instead of placing the entire ContentPlaceholder within UpdatePanel,
it will be better that you can place the UpdatePanel within each contentPages where actually needs the AJAX postback.