souptoy's Profile User Rating: -----

Reputation: 54 Whiz
Group:
Active Members
Active Posts:
244 (0.1 per day)
Joined:
17-January 08
Profile Views:
13,090
Last Active:
User is offline Nov 04 2013 02:07 PM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Who Cares
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Icon   souptoy has not set their status

Posts I've Made

  1. In Topic: textbox.text validation

    Posted 26 Sep 2013

    You could also do the following:

    decimal AppID = 0;
    decimal.TryParse(txtAppId.Text, out AppID);
    
    


    TryParse will attempt to convert your string into the decimal base type and set it to the out variable. If it cannot, the out variable will be 0. This, in turn does not throw an exception.

    Optionally, you can do the following:

    decimal AppID = 0;
    bool blnIsConverted = false;
    blnIsConverted = decimal.TryParse(txtAppId.Text, out AppID);
    
    if (!blnIsConverted){
        //handle missing value
    }
    
    


    As far as I know, Convert.ToDecimal really does Decimal.Parse so if you have an issue converting the string, an Exception will be thrown.
  2. In Topic: clearing textboxes (foreach) not working

    Posted 19 May 2013

    I don't have my test project in front of me right now but I believe you are looking for something like this:
    public void ClearTextBoxes(Control control) {
        foreach (Control c in control.Controls) {
            //can also be System.Web.UI.WebControls for web forms
            if (c.GetType() == System.Windows.Forms.Textbox) 
                ((TextBox)c).Text = "";
        }
    }
    
    


    Line 4 may not be entirely correct cause I am writing this free hand but I think that's the basic idea of what you're looking for
  3. In Topic: Getting Text To Appear Depending On Drop Down List Choice ?

    Posted 24 Dec 2012

    Glad to help :D
  4. In Topic: Getting Text To Appear Depending On Drop Down List Choice ?

    Posted 24 Dec 2012

    Have you set up your DropDownList1 to listen for the SelectedIndexChanged event in the UI side as well as set AutoPostBack = true?

    <asp:DropDownList id="DropDownList1" runat="server" AutoPostBack="true" onselectedIndexChanged="DropDownList1_SelectedIndexChanged" />
    
    


    Note: Line 4 in DropDownList1_TextChanged & 7 in DropDownList1_SelectedIndexChanged does nothing since it's not being assigned to anything.
  5. In Topic: How do you get the selected cell of a gridview?

    Posted 14 Dec 2012

    View Postrobgw3, on 14 December 2012 - 12:10 PM, said:

    I dont like MSDN because it is incredably hard to understand them, I find it easiest to understand when I can see an actual example, not just a bunch of lines that can be put into code. In fact most sites like MSDN are often useless to me which is why I asked here in the first place.


    I don't know if you know this or not but if you click on any of the properties listed on MSDN in the link I provided, it shows examples of how to use them. Check out the SelectedRow property.

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Location:
CA

Contact Information

E-mail:
Private
Website URL:
Website URL  http://