473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

I need help badly

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);
}
}
Nov 19 '05 #1
2 1516
On Mon, 27 Jun 2005 12:10:45 -0400, Sam Samnah wrote:
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);
}
}

Perhaps if you reload the hidden field from its value in ViewState.

Nov 19 '05 #2
I tried that. It does the same thing.
"intrader" <in******@attglobal.net> wrote in message
news:pa****************************@attglobal.net. ..
On Mon, 27 Jun 2005 12:10:45 -0400, Sam Samnah wrote:
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);
}
}

Perhaps if you reload the hidden field from its value in ViewState.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matthew Robinson | last post by:
http://www.houseproudlancs.co.uk/index.new.htm is the worst, can somebody please have a look and tell me where im going wrong? It shows fine in opera, konqueror, mozilla, netscape but not IE. i...
2
by: Gav | last post by:
Hi, I am new to PHP and was just curious, how "fool proof" is PHP against bad code? I.e. is it possible to cause major headaches for the server (infinite loops etc) with bad code or is the PHP...
1
by: Gil | last post by:
This is a question involving CORBA but the problem shows up using Sun C++. The problem doesn't occur with Visual C++ 6. I'm using a string in the following form in my CORBA IDL declaration so...
10
by: Garmt de Vries | last post by:
In an overview of book titles in many languages, which I wrote about in another thread, I've run across a problem with some titles in scripts that are written from right to left, like Arabic and...
5
by: Paul Reddin | last post by:
Hi, using ROWNUMBER() is affecting the plan of a view very badly... is there a way of writing the following view to ensure rownumber() is done as the last thing done? i.e after the calling...
3
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb)....
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
8
by: Seeker | last post by:
Hello, In using Solaris Pro Compiler to compile Pro*C code. I am getting this error: make: Fatal error in reader: parser_proc_online.mk, line 26: Badly formed macro assignment Based on other...
25
by: vikram Bhuskute | last post by:
I have plans to train some students for C in coming weeks. I am badly looking for C programming assignments fot them. Need 1) lots of them per topiic 2) Should be doable for beginners thanks...
15
by: rhino | last post by:
I've put together a prototype of two-tiered CSS tabs that works really well in IE6, IE7, and FF2. It also works very well in Opera 9.27 _except_ that the placement of the lower tier of tabs is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.