js string in aspx page

Discussion in 'ASP .Net' started by DavidC, Aug 25, 2010.

  1. DavidC

    DavidC Guest

    I have a javascript function in my aspx page that is grabbing values in ddl
    and textboxes. I am forming a string to call the report server page via url
    and having problems. I suspect it has to do with string conversion of values
    pulled from the page, but I cannot figure out why as it works in other areas
    of the page. The commented out section does work when hard coded. Below is
    the snippet of js that I am having trouble with. Can someone point out the
    problem? I tried it both with and without the .toString() function. Thanks.

    var varQuarter = new String();
    varQuarter =
    document.getElementById('ctl00_ContentMain_ddlQtr').value;
    varQuarter.toString(1);
    var varYear = new String();
    varYear =
    document.getElementById('ctl00_ContentMain_txtYear1').value;
    varYear.toString(4);
    rpturl += varPageName + '&Quarter=' + varQuarter +
    '&Year=' + varYear + '&Branch=' + varBranch.toString(2);
    //rpturl += varPageName + '&Quarter=2&Year=2010' +
    '&Branch=' + varBranch;


    --
    David
     
    DavidC, Aug 25, 2010
    #1
    1. Advertising

  2. DavidC

    DavidC Guest

    Ignore this...spelling error.
    --
    David


    "DavidC" wrote:

    > I have a javascript function in my aspx page that is grabbing values in ddl
    > and textboxes. I am forming a string to call the report server page via url
    > and having problems. I suspect it has to do with string conversion of values
    > pulled from the page, but I cannot figure out why as it works in other areas
    > of the page. The commented out section does work when hard coded. Below is
    > the snippet of js that I am having trouble with. Can someone point out the
    > problem? I tried it both with and without the .toString() function. Thanks.
    >
    > var varQuarter = new String();
    > varQuarter =
    > document.getElementById('ctl00_ContentMain_ddlQtr').value;
    > varQuarter.toString(1);
    > var varYear = new String();
    > varYear =
    > document.getElementById('ctl00_ContentMain_txtYear1').value;
    > varYear.toString(4);
    > rpturl += varPageName + '&Quarter=' + varQuarter +
    > '&Year=' + varYear + '&Branch=' + varBranch.toString(2);
    > //rpturl += varPageName + '&Quarter=2&Year=2010' +
    > '&Branch=' + varBranch;
    >
    >
    > --
    > David
     
    DavidC, Aug 25, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sriram Mallajyosula

    How do I post data from aspx page to another aspx page.

    Sriram Mallajyosula, Nov 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,027
    Steve C. Orr [MVP, MCSD]
    Nov 5, 2003
  2. Marco Antonio Montalvo Durán
    Replies:
    2
    Views:
    4,204
    Matt Morris
    Jan 23, 2004
  3. John M
    Replies:
    1
    Views:
    1,257
    Kumar Reddi
    May 29, 2005
  4. =?Utf-8?B?Uk1M?=
    Replies:
    1
    Views:
    588
    =?Utf-8?B?QW5keSBMdWtzaWM=?=
    Sep 16, 2005
  5. Progman
    Replies:
    2
    Views:
    1,939
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 13, 2006
Loading...

Share This Page