CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 1/23/2005 1:51:31 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 24 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
ceder
Asp.Net User
Create a new CheckBox Control1/23/2005 1:51:31 PM

0/0

Hello,

I have created a new CheckBox Control, that looks like this:
public class CheckBoxID : CheckBox
{
int m_PdfId;

public int PdfId
{
get
{
return m_PdfId;
}
set
{
m_PdfId = value;
}
}
}

I set the PdfId in the ItemDataBound for a repeater, using the following code:
void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
((CheckBoxID)e.Item.FindControl("CheckBoxVisable")).PdfId = ((Pdf)e.Item.DataItem).Id;
}
}

I use the CheckBox with autopostback=true. My OnCheckChanged function looks like this:
void CheckBoxVisable_OnCheckedChanged(object sender, EventArgs e)
{
Label1.Text = ((CheckBoxID)sender).PdfId.ToString();
}

--

For some reason the PdfId is 0 on the postback, why?

If I set it with <Test:CheckBoxId PdfId="66" /> It works fine. Any idea what I need to do for it to save the value?

Thanks
Lasse
ab13122k
Asp.Net User
Re: Create a new CheckBox Control1/24/2005 7:42:06 AM

0/0

I found this Note in MSDN.

Note The property defined in the example is not persisted during round trips to the client. To define properties that are persisted, you must use the ViewState property to hold property data, as described in Maintaining State in a Control.



you will also need to take above note in considration, because you also want to use stored PDFId in future events, which is similer to roundtrip.
ab13122k
Asp.Net User
Re: Create a new CheckBox Control1/24/2005 7:47:31 AM

0/0

Goto http://msdn.microsoft.com/library/default.asp

From left side tree navigate to below given page :-

..NET Development -> .NET Framework -> Building Applicatons ->
Creating ASP.NET Web Applications -> Developing ASP.NET Server Controls ->
Properties in ASP.NET Server Controls -> Defining a Property


At the end of the page you will find one NOTE on how to persiste property value.
AndrewSeven
Asp.Net User
Re: Create a new CheckBox Control1/26/2005 2:23:17 AM

0/0

public int PdfId
{
get
{
object val = ViewState["PdfId "];
if(val!=null)
{
return (int)val;
}
return 0;
}
set
{
ViewState["PdfId "] = value;
}
}
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007
Visual Basic 2005 Express: Now Playing Authors: Wally Wang, Pages: 452, Published: 2005
Visual Basic 2005 Recipes: A Problem-Solution Approach Authors: Todd Herman, Allen Jones, Matthew MacDonald, Rakesh Rajan, Pages: 664, Published: 2007
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
Visual Basic 2005: A Developer's Notebook Authors: Matthew MacDonald, MacDonald Matthew, Pages: 243, Published: 2005
Delivering Business Intelligence with Microsoft SQL Server 2005 Authors: Brian Larson, Pages: 776, Published: 2006
The Official InstallShield for Windows Installer Developer's Guide Authors: Bob Baker, Pages: 950, Published: 2001
Mastering Windows XP Home Edition Authors: Guy Hart-Davis, Pages: 1009, Published: 2004
Visual Basic 2005 Cookbook: Solutions for VB 2005 Programmers Authors: Tim Patrick, John Craig, John Clark Craig, Pages: 713, Published: 2006

Web:
How to create checkbox control in PDF document using Bytescout.PDF ... Creating checkbox control in PDF document file generated by Bytescout. ... Create new check box AcroCheckBox checkBox1 = new AcroCheckBox(page, rect, ...
CheckBox Class (System.Windows.Forms) Public Sub InstantiateMyCheckBox() ' Create and initialize a CheckBox. Dim checkBox1 As New CheckBox() ' Make the check box control appear as a toggle ...
CheckBox - Kirix Documentation CheckBox.getLabel: Gets the text associated with the check box control. ... create a new checkbox sample form var f = new MyForm("CheckBox Example", 0, 0, ...
.NET - Windows Forms 2.0 – CheckBox Control Recipes How Do I Create a ReadOnly CheckBox Without Disabling the Control ... cbRead = new CheckBox();. cbRead.CheckedChanged += new EventHandler(this. ...
KBAlertz.com: (306227) - Use this step-by-step guide to add a ... After the initial setup is completed, add a CheckBox control to the DataGrid, ... Create an instance of a CheckBox object. Dim oCheckBox As CheckBox = New ...
4GuysFromRolla.com - User Tips: Creating a Validation Control for ... Creating CheckBox and CheckBoxList Validators in ASP.NET 2.0 ... NET is that you can simply create a new custom Web control that includes the desired ...
Microsoft Visual C++ .NET Controls - CheckBox To create a check box control, you can use the CheckBox class. ... this->Text = S"Windows Controls"; // Create the check box ExtraCheese = new CheckBox; ...
Flex 3 - Creating and managing component instances at run time To create a component instance at run time, you define it, ... CheckBox; // Define a variable to hold the new CheckBox control. private var ...
Visual Basic Explorer - Tutorials - Create Controls At Runtime Once the Index property has been set to 0, the Checkbox is now a member of the Check1 Checkbox Control Array---which makes creating a new checkbox at ...
Creating a toggleable LinkButton control in Flex at Flex Examples CHANGE, toggleCheckBox_change); selectedCheckBox = new CheckBox(); selectedCheckBox. ... 6 Responses to “Creating a toggleable LinkButton control in Flex” ...

Videos:
Power Point: Master Slides Episode 4 (of a 18-part series) This Nortel LearniT tutorial explains and reviews the master slides in Power Point.




Search This Site:










how to turn off error list in video studio pro 2005

visual basic vs visual web developer

wanted - interactive assessment form/table

preferences page error

how to get a user control's rendered content in code?

what control fired the page load event?

how does the new daab affect the data access layer (dal) ?

dot net solution for web as well as cd

masterpage and control formatting (table control, html table control)

master page changes

first time setup

domain name "www.xxx.com" does not exist in the database

need good and cheap vps hosting

custom sec. policy file

odd error - can't view any .ascx files in vs 2003

include

forms authentication and writing to a xml file

menu control with delete confirm?

dropdownlist selectedindexchanged without postback?

convert function from old asp

sometimes treeview does not load completely, why ?

equivalent linkbutton from anchor tag

after delployment of app with sql express to sql 2005 hosted server - cannot logon to localhost??

voice of asp net 2.0 menu completely clickable

custom template for code behind and class files ?

invoking a sound to a server evaluated event

clustering

web services and dnn

compatibility...

dynamically disable personalization

 
All Times Are GMT