Click here to Skip to main content
15,885,984 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how to fetch values from stock market in asp.net application Pin
mr_muskurahat29-Jan-09 2:05
mr_muskurahat29-Jan-09 2:05 
AnswerRe: how to fetch values from stock market in asp.net application Pin
johnsontroye29-Jan-09 9:57
johnsontroye29-Jan-09 9:57 
QuestionFile download Pin
Radhakrishnan G.29-Jan-09 0:50
Radhakrishnan G.29-Jan-09 0:50 
AnswerRe: File download Pin
Guffa29-Jan-09 6:01
Guffa29-Jan-09 6:01 
AnswerRe: File download Pin
Rutvik Dave29-Jan-09 6:52
professionalRutvik Dave29-Jan-09 6:52 
QuestionAbout search from start Date to End Date Pin
sanjay3029-Jan-09 0:47
sanjay3029-Jan-09 0:47 
AnswerRe: About search from start Date to End Date Pin
Aman Bhullar29-Jan-09 0:57
Aman Bhullar29-Jan-09 0:57 
QuestionCan anybody help me pleaseeeeee Pin
AnuMaria29-Jan-09 0:31
AnuMaria29-Jan-09 0:31 
Hi,
I am create a custom server control. This control contains panel , check box list.check box list is reside in panel. While mouse getting out of the panel selected Items of check box list must display as alert. I tried this as follows,

In WebCustomControl1.cs,

private Panel _panel;
private CheckBoxList _chkList;

public override ControlCollection Controls
{
get
{
EnsureChildControls();
return base.Controls;

}

}

protected override void CreateChildControls()
{
string strItems;
string[] StrArrItem = null;
char cSplitChar = ',';
int intLegth = 0;
_panel = new Panel();
_chkList = new CheckBoxList();

_panel.ID = "Panel1";

_chkList.ID = "DDList";
_chkList.BorderColor = Color.White;
_chkList.BorderStyle = BorderStyle.Solid;
_chkList.Width = Unit.Percentage(100);

strItems = AddItem;
StrArrItem = strItems.Split(cSplitChar);
intLegth = StrArrItem.Length;
for (int i = 1; i < intLegth; i++)
{

_chkList.Items.Add(StrArrItem[i]);
}
_panel.Controls.Add(_chkList);
this.Controls.Add(_panel);
}


protected override void Render(HtmlTextWriter writer)
{

CreateCtrlLeave();
_panel.Attributes.Add("onmouseout", "CtrlLeave(); ");
_panel.RenderControl(writer);

}
public string AddItem
{
get
{
if (ViewState["Text"] != null)
{
_strAddItem = (String)ViewState["Text"];


if (_strAddItem.Length > 0)
{
_strAddItem = _strAddItem.Length > 0 ? _strAddItem.Substring(0, _strAddItem.Length - 1) : _strAddItem;
}
return ((_strAddItem == null) ? String.Empty : _strAddItem);
}
return ((_strAddItem == null) ? String.Empty : _strAddItem);
}

set
{
ViewState["Text"] = null;
_strAddItem += value + ",";
ViewState["Text"] = _strAddItem;
//ViewState["Text"] = value+",";
}
}

public void CreateCtrlLeave()
{
StringBuilder str = new StringBuilder();
str.Append("\n");
str.Append("function CheckItem(panel)\n");
str.Append("{\n");
str.Append("var chkList = panel.getElementsByTagName(\"input\"); \n");
str.Append("for(var i=0;i&lt;chklist.length;i++)\n");&gt;
str.Append("if(chkList[i].type==\"checkbox\" && chkList[i].checked)\n");
str.Append("{\n");
str.Append("alert(chkList[i].type)\n");
str.Append("}\n");
str.Append("}\n");
str.Append("");
if (!Page.IsClientScriptBlockRegistered("clients"))
{
Page.RegisterClientScriptBlock("clients", str.ToString());
}
}

After all i created 2 custom controls on my web page. But at runtime one error is getting like,Object expected.

Can anyone help me to solve this problem? please Sigh | :sigh:

Anu

AnswerRe: Can anybody help me pleaseeeeee Pin
Paddy Boyd29-Jan-09 2:48
Paddy Boyd29-Jan-09 2:48 
QuestionTextEditor Pin
sajjadlashari29-Jan-09 0:18
sajjadlashari29-Jan-09 0:18 
AnswerRe: TextEditor Pin
Tad McClellan29-Jan-09 11:06
professionalTad McClellan29-Jan-09 11:06 
AnswerRe: TextEditor Pin
samira_sm13-Nov-09 7:16
samira_sm13-Nov-09 7:16 
QuestionDropdownlist is getting null refernce eventhough there is a proper reference Pin
meeram39529-Jan-09 0:14
meeram39529-Jan-09 0:14 
QuestionHow to get Textbox value from dynamic generated onClick EventHandler Pin
Karan_TN28-Jan-09 23:09
Karan_TN28-Jan-09 23:09 
AnswerRe: How to get Textbox value from dynamic generated onClick EventHandler Pin
Tad McClellan29-Jan-09 17:22
professionalTad McClellan29-Jan-09 17:22 
Questionincrement the texbox value on mouse down[modified] Pin
yathika sekar28-Jan-09 23:03
yathika sekar28-Jan-09 23:03 
AnswerRe: increment the texbox value on mouse dow Pin
Tad McClellan29-Jan-09 17:24
professionalTad McClellan29-Jan-09 17:24 
Questionhow to convert awebsite from two tier archtecture to three tier archtecture Pin
anujbanka178428-Jan-09 23:02
anujbanka178428-Jan-09 23:02 
AnswerRe: how to convert awebsite from two tier archtecture to three tier archtecture Pin
SeMartens28-Jan-09 23:09
SeMartens28-Jan-09 23:09 
GeneralRe: how to convert awebsite from two tier archtecture to three tier archtecture Pin
anujbanka178428-Jan-09 23:22
anujbanka178428-Jan-09 23:22 
GeneralRe: how to convert awebsite from two tier archtecture to three tier archtecture Pin
SeMartens28-Jan-09 23:24
SeMartens28-Jan-09 23:24 
GeneralRe: how to convert awebsite from two tier archtecture to three tier archtecture Pin
anujbanka178428-Jan-09 23:27
anujbanka178428-Jan-09 23:27 
AnswerRe: how to convert awebsite from two tier archtecture to three tier archtecture Pin
Paddy Boyd29-Jan-09 2:48
Paddy Boyd29-Jan-09 2:48 
QuestionHow to refresh the Datagrid(WPF DataGrid) for every 5 minutes in WPF Browser application Pin
reach2narahari@gmail.com28-Jan-09 22:13
reach2narahari@gmail.com28-Jan-09 22:13 
Question[newbie] Retrieving values Pin
jon-8028-Jan-09 22:05
professionaljon-8028-Jan-09 22:05 

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.