Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > I need help badly

Reply
Thread Tools

I need help badly

 
 
Sam Samnah
Guest
Posts: n/a
 
      06-27-2005
I am building a custome control and I need to access the information in the
hidden field (HtmlInputHidden HIH) so that when a button is pressed the
information in the hidden fields value is returned. Somehow, when the
submit button is pressed the value in the Hidden field disappears into cyber
nothing. Please help. This application is supremely important to me.

Anyhow is greatly appreciated thank you

the code is as follows:
public class FreeForm : WebControl, IPostBackDataHandler
{
HtmlGenericControl HGC;
HtmlInputHidden HIH;
public FreeForm(): base(HtmlTextWriterTag.Table)
{}
public string Text
{
get{return HIH.Value;}
set{HIH.Value=value;}
}

protected override void OnPreRender(EventArgs e)
{
base.OnPreRender (e);
if(!Page.IsClientScriptBlockRegistered("startUp"))
{
StringBuilder jsload=new StringBuilder();

jsload.Append(@"Some javascript not needed here"); // information is
transfered from the div tag to the hidden tag
// using client side code.

string CMSUpReg=jsload.ToString();
Page.RegisterClientScriptBlock("startUp",CMSUpReg) ;
}
}
protected override void CreateChildControls()
{

Controls.Add(new LiteralControl("<tr bgcolor='#ffffff' height='100%'
width='100%'>"));
Controls.Add(new LiteralControl("<td valign='top'>"));

HIH=new HtmlInputHidden();
HIH.Attributes.Add("value",Text);
HIH.Attributes.Add("name",this.UniqueID);
Controls.Add(HIH);

HGC=new HtmlGenericControl("div");
HGC.Attributes.Add("CONTENTEDITABLE","true");
HGC.Attributes.Add("width","100%");
HGC.Attributes.Add("height","100%");
HGC.Attributes.Add("onBlur","moveCurser(" + HIH.UniqueID + ");");
HGC.Attributes.Add("id","oDiv");
Controls.Add(HGC);

Controls.Add(new LiteralControl("</td>"));
Controls.Add(new LiteralControl("</tr>"));
base.CreateChildControls ();
}
#region IPostBackDataHandler Members

public event EventHandler TextChanged;
public void RaisePostDataChangedEvent()
{
onTextChanged(new EventArgs());
}

protected virtual void onTextChanged(EventArgs e)
{
if(TextChanged !=null)
{
TextChanged(this, e);
}
}
public bool LoadPostData(string postDataKey,
System.Collections.Specialized.NameValueCollection postCollection)
{
string postedValue=postCollection[postDataKey];
string val=Text;
if(val!=postedValue)
{
Text=postedValue;
return true;
}
else
{
return false;
}
}

#endregion
}
[ParseChildren()]
[PersistChildren(false)]
public class cToolRow : WebControl
{
public cToolCell cCell;
public cToolRow():base(HtmlTextWriterTag.Tr)
{}
protected override void AddAttributesToRender(HtmlTextWriter writer)
{
writer.AddAttribute(HtmlTextWriterAttribute.Height ,"1");
base.AddAttributesToRender (writer);
}
}
[ParseChildren()]
[PersistChildren(false)]
public class cToolCell : WebControl, INamingContainer
{
public cToolCell() : base(HtmlTextWriterTag.Td){}
protected override void AddAttributesToRender(HtmlTextWriter writer)
{
base.AddAttributesToRender (writer);
}
}



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VPN problems - need help badly pierce911 Cisco 8 02-23-2007 06:53 PM
need help...badly :-) vandresv Cisco 2 10-13-2005 12:45 AM
I need help badly Sam Samnah ASP .Net 2 06-27-2005 06:30 PM
Need help w/ Wireless Networking *BADLY* =?Utf-8?B?QmlnVEdhbWVz?= Wireless Networking 7 11-27-2004 03:41 AM
Urgent: Please need help badly =?Utf-8?B?QmlsYWw=?= ASP .Net 3 02-28-2004 01:31 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57