default radio button in form

Discussion in 'ASP General' started by steve, Nov 10, 2004.

  1. steve

    steve Guest

    Hi all

    What I'm trying to achieve is:
    I have a form with two radio buttons,
    if a visitors check radio button 2 and click submit in the next page
    radio button 2 to be check by default

    If I use this code

    <% If Request.Item("col")="firstcoll" Then Response.Write "Checked"%>

    in .aspx page for example like that

    <input type="radio" name="col" value="firstcoll" <% If
    Request.Item("col")="firstcoll" Then Response.Write "Checked"%>>
    (I have try to omit the code and I have try <%@ but still the same)

    it breaking the script and I'm getting error BC30800
    I have post it below


    Server Error in '/esearch' Application.
    --------------------------------------------------------------------------------

    Compilation Error
    Description: An error occurred during the compilation of a resource
    required to service this request. Please review the following specific
    error details and modify your source code appropriately.

    Compiler Error Message: BC30800: Method arguments must be enclosed in
    parentheses.

    Source Error:



    Line 84: <input checked type="radio" name="col"
    value="fullcoll">
    Line 85: Africa
    Line 86: <input type="radio" name="col"
    value="test" <% If Request.Item("col")="test" Then Response.Write
    "Checked"%>>
    Line 87: Directory
    Line 88: <input type="radio" name="col">



    c:\inetpub\wwwroot\esearch\search.aspx(86) : error BC30800: Method
    arguments must be enclosed in parentheses.

    If Request.Item("col")="test" Then Response.Write
    "Checked"
    steve, Nov 10, 2004
    #1
    1. Advertising

  2. steve

    Larry Bud Guest

    "steve" <> wrote in message news:<cmrn6l$2v2$>...
    > Hi all
    >
    > What I'm trying to achieve is:
    > I have a form with two radio buttons,
    > if a visitors check radio button 2 and click submit in the next page
    > radio button 2 to be check by default
    >
    > If I use this code
    >
    > <% If Request.Item("col")="firstcoll" Then Response.Write "Checked"%>
    >
    > in .aspx page for example like that
    >
    > <input type="radio" name="col" value="firstcoll" <% If
    > Request.Item("col")="firstcoll" Then Response.Write "Checked"%>>
    > (I have try to omit the code and I have try <%@ but still the same)
    >
    > it breaking the script and I'm getting error BC30800
    > I have post it below
    >
    >
    > Server Error in '/esearch' Application.
    > --------------------------------------------------------------------------------
    >
    > Compilation Error
    > Description: An error occurred during the compilation of a resource
    > required to service this request. Please review the following specific
    > error details and modify your source code appropriately.
    >
    > Compiler Error Message: BC30800: Method arguments must be enclosed in
    > parentheses.
    >
    > Source Error:
    >
    >
    >
    > Line 84: <input checked type="radio" name="col"
    > value="fullcoll">
    > Line 85: Africa
    > Line 86: <input type="radio" name="col"
    > value="test" <% If Request.Item("col")="test" Then Response.Write
    > "Checked"%>>
    > Line 87: Directory
    > Line 88: <input type="radio" name="col">
    >
    >
    >
    > c:\inetpub\wwwroot\esearch\search.aspx(86) : error BC30800: Method
    > arguments must be enclosed in parentheses.
    >
    > If Request.Item("col")="test" Then Response.Write
    > "Checked"


    This is a Classic ASP forum, while you're posting an ASP.NET question.
    If I were to respond to this as a classic ASP page, then I would say
    that it should read

    response.write("Checked")
    instead of
    response.write "Checked"

    It's clearly bitching that you don't have parens around the string in
    line 86
    Larry Bud, Nov 10, 2004
    #2
    1. Advertising

  3. steve

    steve Guest

    > This is a Classic ASP forum, while you're posting an ASP.NET
    > question.
    > If I were to respond to this as a classic ASP page, then I would say
    > that it should read
    >
    > response.write("Checked")
    > instead of
    > response.write "Checked"
    >
    > It's clearly bitching that you don't have parens around the string
    > in
    > line 86


    We are blaming this on my pure English
    I should first done that
    http://www.google.com/search?sourceid=navclient&ie=UTF-8&q=what is parentheses
    before to post

    Thanks all for your help
    steve, Nov 11, 2004
    #3
    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. steve
    Replies:
    2
    Views:
    11,449
    steve
    Nov 10, 2004
  2. Hiten
    Replies:
    1
    Views:
    609
    Vidar Petursson
    May 26, 2004
  3. steve

    default radio button in form

    steve, Oct 23, 2004, in forum: ASP General
    Replies:
    7
    Views:
    166
    steve
    Nov 10, 2004
  4. steve

    default radio button in form

    steve, Nov 10, 2004, in forum: ASP General
    Replies:
    3
    Views:
    180
    steve
    Nov 11, 2004
  5. steve

    select default radio button in form

    steve, Nov 10, 2004, in forum: ASP General
    Replies:
    3
    Views:
    200
    steve
    Nov 10, 2004
Loading...

Share This Page