473,396 Members | 1,914 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,396 software developers and data experts.

By default zero showing in the text box of .aspx page?

Hi experts,

I defined two integer values in the class. Like this

public class IntegerClass
public ID1 as Int32
public ID2 as Int32
End Class

then iam instantiating this class and assigning these values to the text box
id. After if i run the application by deafult zero is showing in the two text
boxes.

I don't want display the zero by deafult it should be blank. How to avoid
this zeros.

Can any one help me on this.

Thanks in advance

Nov 19 '05 #1
3 1592
in c#:

if (myIntegerClass.ID1 == 0)
txtBox.Text="";
else
txtBox.Text=myIntegerClass.ID1 ;

Eliyahu

"pesani" <pe****@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
Hi experts,

I defined two integer values in the class. Like this

public class IntegerClass
public ID1 as Int32
public ID2 as Int32
End Class

then iam instantiating this class and assigning these values to the text box id. After if i run the application by deafult zero is showing in the two text boxes.

I don't want display the zero by deafult it should be blank. How to avoid
this zeros.

Can any one help me on this.

Thanks in advance

Nov 19 '05 #2
thank you for your reply.
"Eliyahu Goldin" wrote:
in c#:

if (myIntegerClass.ID1 == 0)
txtBox.Text="";
else
txtBox.Text=myIntegerClass.ID1 ;

Eliyahu

"pesani" <pe****@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
Hi experts,

I defined two integer values in the class. Like this

public class IntegerClass
public ID1 as Int32
public ID2 as Int32
End Class

then iam instantiating this class and assigning these values to the text

box
id. After if i run the application by deafult zero is showing in the two

text
boxes.

I don't want display the zero by deafult it should be blank. How to avoid
this zeros.

Can any one help me on this.

Thanks in advance


Nov 19 '05 #3
Hello Pesani,

Int32 is a value type and therefore can not be assigned to null. It is always
initialized to 0. You should perform a check for zero, handling the situation
as appropriate.

--
Matt Berther
http://www.mattberther.com
Hi experts,

I defined two integer values in the class. Like this

public class IntegerClass
public ID1 as Int32
public ID2 as Int32
End Class
then iam instantiating this class and assigning these values to the
text box id. After if i run the application by deafult zero is showing
in the two text boxes.

I don't want display the zero by deafult it should be blank. How to
avoid this zeros.

Can any one help me on this.

Thanks in advance

Nov 19 '05 #4

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

Similar topics

9
by: JohnSmith | last post by:
I suspect this is easy, but I have been stumped for a day trying to solve this.. I want to be able to have an unlimited number of aspx pages that all use the code in one class file. I want code...
2
by: J Sahoo | last post by:
Hi, I have a browse page where I am showing few fields from my SQL Server table. One of the field is Image type, all the fields are bound to a single table. I want to show the image from the...
1
by: Milsnips | last post by:
hi there, i got 2 textboxes and 2 buttons..both are search input and search buttons.. when i have focus of the 2nd textbox and i press enter, it always fires the event for the 1st button. ...
1
by: digitalego | last post by:
Sorry if the title is a little confusing... Here is the problem. I am working with a "default.aspx" page that uses a user control I made: ------------------------------ | default.aspx ...
5
by: Steve | last post by:
Hi... new to ASP.NET... I am creating a DLL using VB.NET which my ASPX page will be calling. I have a class in the DLL (MyClass) which has a property (MyProperty). If the value assigned to...
1
by: Will Gillen | last post by:
I know this has probably been asked before, but I can't seem to find a solid answer in any of the archives. First, before my question, please forgive my limited knowledge of the event lifecycle...
4
by: ~john | last post by:
If I have a label on the Master Page that I would like to change its text with a button on one of the content pages, Default.aspx... It's giving me an error saying "Label1" is not found. Can you...
1
by: Jai | last post by:
Hi All, As When I am displaying my html page which contains images also inside content placeholder with panel control.....it is only showing text and not the Images.....................please...
2
by: AlecL | last post by:
Hi All, I have added a user control onto an aspx page and want to make the submit button of that user control the default button when the panel in which the user control is located is visible. ...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.