"ASP:" WebControls and Non-JavaScrip

Discussion in 'ASP .Net Web Controls' started by Alex Maghen, Feb 8, 2005.

  1. Alex Maghen

    Alex Maghen Guest

    Hi. I'm confused about something: I love using the <asp:...> WebControls and
    they work amazingly in IE, etc. But my problem is, let's say I've created a
    page and it has things like asp:LinkButtons and asp:Buttons, etc. but the
    browser doesn't support JavaScript (or, as really seems to be the problem, it
    *says* it supports JavaScript but doesn't somehow). Is there a way that I can
    designate those controls (or, in fact, the whole Page) NOT to use JavaScript
    but, instead, to do QueryString or Form stuff in the background???

    Alex
     
    Alex Maghen, Feb 8, 2005
    #1
    1. Advertising

  2. Alex Maghen

    Scott M. Guest

    Since when do LinkButtons and Buttons make use of JavaScript?


    "Alex Maghen" <> wrote in message
    news:...
    > Hi. I'm confused about something: I love using the <asp:...> WebControls
    > and
    > they work amazingly in IE, etc. But my problem is, let's say I've created
    > a
    > page and it has things like asp:LinkButtons and asp:Buttons, etc. but the
    > browser doesn't support JavaScript (or, as really seems to be the problem,
    > it
    > *says* it supports JavaScript but doesn't somehow). Is there a way that I
    > can
    > designate those controls (or, in fact, the whole Page) NOT to use
    > JavaScript
    > but, instead, to do QueryString or Form stuff in the background???
    >
    > Alex
     
    Scott M., Feb 9, 2005
    #2
    1. Advertising

  3. Alex Maghen

    Alex Maghen Guest

    Well they do for me. Example: I create a form in an ASPX page, stick an
    asp:Button in there with an onClick="SomeFunction". If I do NOTHING else,
    when I point at that button in the browser, the Status Bar shows that it'll
    be doing some JavaScript to get me where I'm going. Am I doing something
    wrong here???

    "Scott M." wrote:

    > Since when do LinkButtons and Buttons make use of JavaScript?
    >
    >
    > "Alex Maghen" <> wrote in message
    > news:...
    > > Hi. I'm confused about something: I love using the <asp:...> WebControls
    > > and
    > > they work amazingly in IE, etc. But my problem is, let's say I've created
    > > a
    > > page and it has things like asp:LinkButtons and asp:Buttons, etc. but the
    > > browser doesn't support JavaScript (or, as really seems to be the problem,
    > > it
    > > *says* it supports JavaScript but doesn't somehow). Is there a way that I
    > > can
    > > designate those controls (or, in fact, the whole Page) NOT to use
    > > JavaScript
    > > but, instead, to do QueryString or Form stuff in the background???
    > >
    > > Alex

    >
    >
    >
     
    Alex Maghen, Feb 9, 2005
    #3
  4. Uh - take a look at the generated HTML from an ASP.NET page for LinkButtons:

    javascript:__doPostBack('ldContent$_ctl1$uclSupplierEditor$dgSupplierContacts$_ctl2$lbtnEdit','')

    Anything that doesn't ordinarily incur a postback calls javascript to force
    the form to postback.



    "Scott M." <> wrote in message
    news:...
    > Since when do LinkButtons and Buttons make use of JavaScript?
    >
    >
    > "Alex Maghen" <> wrote in message
    > news:...
    >> Hi. I'm confused about something: I love using the <asp:...> WebControls
    >> and
    >> they work amazingly in IE, etc. But my problem is, let's say I've created
    >> a
    >> page and it has things like asp:LinkButtons and asp:Buttons, etc. but the
    >> browser doesn't support JavaScript (or, as really seems to be the
    >> problem, it
    >> *says* it supports JavaScript but doesn't somehow). Is there a way that I
    >> can
    >> designate those controls (or, in fact, the whole Page) NOT to use
    >> JavaScript
    >> but, instead, to do QueryString or Form stuff in the background???
    >>
    >> Alex

    >
    >
     
    Anthony Williams, Feb 9, 2005
    #4
  5. Alex Maghen

    Scott M. Guest

    Yes, but this is YOU adding JavaScript to the control, not the control
    having this automatically. And, with all JavaScript that you add, you run
    the risk of it running (or trying to run) in a browser that doesn't support
    it. It's not up to VS.NET to prevent YOU from squeezing JavaScript into the
    rendered output.

    What you may want to do is stop adding the client-side event handlers
    manually and add them programmatically instead only if the client supports
    JavaScript.

    You could check the ServerVariables collection to see what kind of client
    you are serving and then if it is a client that supports JavaScript, you
    could add something like:

    btnTest.attributes.add("onClick","SomeFunction")

    -Scott

    "Alex Maghen" <> wrote in message
    news:...
    > Well they do for me. Example: I create a form in an ASPX page, stick an
    > asp:Button in there with an onClick="SomeFunction". If I do NOTHING else,
    > when I point at that button in the browser, the Status Bar shows that
    > it'll
    > be doing some JavaScript to get me where I'm going. Am I doing something
    > wrong here???
    >
    > "Scott M." wrote:
    >
    >> Since when do LinkButtons and Buttons make use of JavaScript?
    >>
    >>
    >> "Alex Maghen" <> wrote in message
    >> news:...
    >> > Hi. I'm confused about something: I love using the <asp:...>
    >> > WebControls
    >> > and
    >> > they work amazingly in IE, etc. But my problem is, let's say I've
    >> > created
    >> > a
    >> > page and it has things like asp:LinkButtons and asp:Buttons, etc. but
    >> > the
    >> > browser doesn't support JavaScript (or, as really seems to be the
    >> > problem,
    >> > it
    >> > *says* it supports JavaScript but doesn't somehow). Is there a way that
    >> > I
    >> > can
    >> > designate those controls (or, in fact, the whole Page) NOT to use
    >> > JavaScript
    >> > but, instead, to do QueryString or Form stuff in the background???
    >> >
    >> > Alex

    >>
    >>
    >>
     
    Scott M., Feb 9, 2005
    #5
  6. Alex Maghen

    Scott M. Guest

    Ok, but the OP also asked about asp:button controls, which do not render
    with JavaScript. Not to mention that the OP was referring to JavaScript of
    his own, not the JS added by VS.NET.


    "Anthony Williams" <> wrote in message
    news:%...
    > Uh - take a look at the generated HTML from an ASP.NET page for
    > LinkButtons:
    >
    > javascript:__doPostBack('ldContent$_ctl1$uclSupplierEditor$dgSupplierContacts$_ctl2$lbtnEdit','')
    >
    > Anything that doesn't ordinarily incur a postback calls javascript to
    > force the form to postback.
    >
    >
    >
    > "Scott M." <> wrote in message
    > news:...
    >> Since when do LinkButtons and Buttons make use of JavaScript?
    >>
    >>
    >> "Alex Maghen" <> wrote in message
    >> news:...
    >>> Hi. I'm confused about something: I love using the <asp:...> WebControls
    >>> and
    >>> they work amazingly in IE, etc. But my problem is, let's say I've
    >>> created a
    >>> page and it has things like asp:LinkButtons and asp:Buttons, etc. but
    >>> the
    >>> browser doesn't support JavaScript (or, as really seems to be the
    >>> problem, it
    >>> *says* it supports JavaScript but doesn't somehow). Is there a way that
    >>> I can
    >>> designate those controls (or, in fact, the whole Page) NOT to use
    >>> JavaScript
    >>> but, instead, to do QueryString or Form stuff in the background???
    >>>
    >>> Alex

    >>
    >>

    >
    >
     
    Scott M., Feb 9, 2005
    #6
    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. Robert Ladd

    Disable Calendar Control from javascrip

    Robert Ladd, Feb 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,278
    Robert Ladd
    Feb 27, 2005
  2. =?utf-8?B?4pmlZVh0cmVtZSBvWHlnZW7imaU=?=

    How do i call JAVASCRIP function if...

    =?utf-8?B?4pmlZVh0cmVtZSBvWHlnZW7imaU=?=, Aug 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    481
    =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmE=?=
    Aug 25, 2006
  3. Ganesh
    Replies:
    1
    Views:
    444
    clintonG
    Aug 2, 2007
  4. deepak kumar
    Replies:
    0
    Views:
    139
    deepak kumar
    Oct 30, 2004
  5. Jean Pion

    JavaScrip, xml and Linux

    Jean Pion, Dec 21, 2004, in forum: Javascript
    Replies:
    5
    Views:
    186
    Mark Preston
    Dec 24, 2004
Loading...

Share This Page