Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 8 of 8

Thread: Get Form Data - ShoppingCart.aspx

  1. #1
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Question Get Form Data - ShoppingCart.aspx

    I have added a drop down box which has auto-post back. The problem I have is I can not access that posted data.

    When the drop down is changed the page refreshes. Looking at the information sent I can see that correct data is posted as form data.

    DropDownCountry:86

    Yet when I try and access this information for DropDownCountry I just can't get it.
    I have tried using response, commonlogic (all different types) and I just can't get that int.

    At the moment I have just tried
    CommonLogic.FormCanBeDangerousContent("DropDownCou ntry");
    yet nothing.

    Can anyone help, I have no idea why I can't access this posted int.

    Thanks in advance.

    EDIT:
    Just to note the code I have posted creates a 500 error if you just load the page as DropDownCountry does not exist. So I know it is correctly seeing the post data when I change the drop down. I just can't do anything with it for some reason.
    Last edited by DotNetDevelopments; 01-12-2011 at 02:47 AM.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  2. #2
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Is there something I am missing? This should be an easy school boy task but I really can't get it to work, any ideas?
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  3. #3
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    Shouldn't it be DropDownCountry.SelectedValue ?
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  4. #4
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Just tried it with no luck. Even printing what information is shown the value is always the default 80 regardless of the value of the selected item.

    Is there any reason why the dropdown would always use the first value even if not selected.

    Just a bit of code I tried

    int CountryID = 86;
    CountryID = int.Parse(DropDownCountry.SelectedValue);

    The odd thing is the first country is GB which has a id of 80. Using this code also produces 80 no matter what the selected value is.
    Last edited by DotNetDevelopments; 01-13-2011 at 04:45 AM.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  5. #5
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    What about?
    Code:
    DropDownCountry.SelectedItem.Text
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  6. #6
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    No luck, it still doesn't work.

    It returns the first loaded item not the selected one... Very odd.

    edit:
    Just tried
    DropDownCountry.SelectedValue.Length

    and it returns 0.

    I am really not sure what to do about this.
    Last edited by DotNetDevelopments; 01-17-2011 at 07:27 AM.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  7. #7
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Something odd to note.
    If I use this code after the drop down has been filled out.

    C#/VB.NET Code:
    int CountryID 86;
    CountryID int.Parse(DropDownCountry.SelectedValue); 
    I get a countryid of 80, which is the default selected value. However when I select another value and the page automatically refreshes it does not update and stays at 80 yet the drop down selected value is the option you selected.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  8. #8
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Solved the problem by turning off auto post back.

    For some reason it does not work with auto post back enabled.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience