Using JavaScript with ASP

Last post 01-29-2009 5:07 PM by AndyMoireASP. 10 replies.

Sort Posts:

  • Using JavaScript with ASP

    01-24-2009, 4:40 PM

    Hi 

    I have client who has an internal where the client's browsers can use JavaScript. However, because the design needs a gridview and they want to sort columns, which I note need javascript to do this, my question is whether it is possible to develop an application where javascript can only be enabled for this application.

    Has any developer been able to develop an application in this type situation? Would this type of tuning be carried out on Active Directory in order to achieve this?

    Alternatively, can someone let me know another way of enabling sorting on columns in a gridview?

    Thanks in advance

     

  • Re: Using JavaScript with ASP

    01-24-2009, 6:55 PM
    • Member
      222 point Member
    • TomKester
    • Member since 01-05-2009, 6:43 PM
    • Posts 64

    i'm pretty sure you can sort gridviews on the server side...

    http://www.asp.net/learn/data-access/tutorial-24-vb.aspx

     

     

    In the place I live in the only programmer i have to talk to is myself, no wonder people think i'm crazy.
  • Re: Using JavaScript with ASP

    01-24-2009, 7:28 PM
    • All-Star
      20,870 point All-Star
    • A1ien51
    • Member since 05-06-2005, 6:46 PM
    • MD USA
    • Posts 3,857

     You can not just tell a browser to enable JavaScript for a certain page. I honestly have no idea how people can surf the net without JavaScript. It would be painful. lol

     

    Eric

  • Re: Using JavaScript with ASP

    01-24-2009, 8:15 PM
    Answer

     Hi

    I think you may have misunderstood me, I was talking about enabling JavaScript for the whole the application, not just the one page. 

  • Re: Using JavaScript with ASP

    01-24-2009, 9:25 PM
    Answer
    • All-Star
      100,818 point All-Star
    • mbanavige
    • Member since 11-06-2003, 1:29 PM
    • New England, USA
    • Posts 10,509
    • Moderator
      TrustedFriends-MVPs

    Either javascript is enabled in the browser or it is not.  This is a choice the client makes and is not something you can affect with your application. 

    For internet explorer, the settings for script are in the security options section.  so it should be possible to enable scripting just for Trusted sites rather than for all sites.  Then, if your site were added to the trusted sites list, scripting could be enabled.

    Mike Banavige
    ~~~~~~~~~~~~
    Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/
  • Re: Using JavaScript with ASP

    01-29-2009, 10:04 AM
    • All-Star
      65,332 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 1:34 PM
    • England
    • Posts 12,708
    • TrustedFriends-MVPs

     >Either javascript is enabled in the browser or it is not.

    To the web site, this is correct. However for users of Firefox with NoScript, JavaScript is enabled on a site by site basis. If you detect that the user has not got JavaScript enabled and direct them to a warning page, then you should include some javascript on that page, so that the user can enable JavaScript for your site.

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
    See the FAQ on the correct forum to post at, at http://forums.asp.net/p/1337412/2699239.aspx#2699239
  • Re: Using JavaScript with ASP

    01-29-2009, 10:46 AM
    • All-Star
      81,997 point All-Star
    • NC01
    • Member since 08-26-2005, 3:33 PM
    • Posts 15,384
    • TrustedFriends-MVPs

    TATWORTH:

     >Either javascript is enabled in the browser or it is not.

    To the web site, this is correct. However for users of Firefox with NoScript, JavaScript is enabled on a site by site basis. If you detect that the user has not got JavaScript enabled and direct them to a warning page, then you should include some javascript on that page, so that the user can enable JavaScript for your site.

    What JavaScript will enable JavaScript for your site ? As has already been posted, only the user can do this from their browser settings, at least as far as I know.

    NC...

     

  • Re: Using JavaScript with ASP

    01-29-2009, 10:57 AM
    • All-Star
      65,332 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 1:34 PM
    • England
    • Posts 12,708
    • TrustedFriends-MVPs

     > What JavaScript will enable JavaScript for your site ? As has already been posted, only the user can do this from their browser settings, at least as far as I know.

    This is not Javascript but the user electing within an add-on to their browser to enable Javscript for a given site. NoScript is a FireFox add-on!

    Using NoScript grants a degree of freedom from Cross-Site scripting attack and spyware cookies like doubleclick.

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
    See the FAQ on the correct forum to post at, at http://forums.asp.net/p/1337412/2699239.aspx#2699239
  • Re: Using JavaScript with ASP

    01-29-2009, 11:21 AM
    • All-Star
      81,997 point All-Star
    • NC01
    • Member since 08-26-2005, 3:33 PM
    • Posts 15,384
    • TrustedFriends-MVPs

    You mean something like this?

    <div id="pageContent" style="display:none">
     <!-- All page content goes here. -->
    </div>

    <script type=text/javascript>
    <!--
    window.onload = function ()
    {
     document.getElementById('pageContent').style.display = 'block';
    }
    // -->
    </script>

    <noscript>
    <font color='Red'><h1>Please enable JavaScript to view this page.</h1></font><br>
    </noscript>

    NC...

  • Re: Using JavaScript with ASP

    01-29-2009, 11:57 AM
    • All-Star
      65,332 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 1:34 PM
    • England
    • Posts 12,708
    • TrustedFriends-MVPs

     As long as there is some JavaScript on the the page the user is redirected to, then a user of Firefox with NoScript will get the prompt (from NoScript) to enable JavaScript for that site.

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
    See the FAQ on the correct forum to post at, at http://forums.asp.net/p/1337412/2699239.aspx#2699239
  • Re: Using JavaScript with ASP

    01-29-2009, 5:07 PM

    Thank you all for your reply.

    However, I am persuading the customer the benefits for allowing JavaScript on their clients.

    Thank you again

Page 1 of 1 (11 items)