Control Scaling???

Discussion in 'ASP .Net' started by =?Utf-8?B?REVXcmlnaHRfQ0E=?=, Apr 26, 2005.

  1. I have 2 controls on a page that need to be defined by absolute horiz. and
    vert. sizes, and both need to be a percentage of the screen size. Does anyone
    know of a easy way to grab the screen extents, divide them by fractions that
    can then be assigned to the controls on initialization.

    I am working in C# in ASP.Net!

    --
    D @ premierdata
     
    =?Utf-8?B?REVXcmlnaHRfQ0E=?=, Apr 26, 2005
    #1
    1. Advertising

  2. Hi Dewright,

    Welcome to ASP.NET newsgroup.
    As for the grabing the screen size of clientside in asp.net page, here are
    some of my suggestions:

    Since the screen size is the clientside information, currently we could
    only retrieve it through clientside scripts. The problem is that clientside
    scripts need to be executed at clientside (browser context), so we need to
    at least let our page be render to client once to get those info. Since
    you need to get the screen size so as to coordinate your serverside
    control's size, I think we have the following means:

    1. We retreive the clientside screen size in client script and also use
    client script to modify our server control's size( through the attributes
    of the controls' rendered html elements at client)

    2. We use client script to get the screen size and post back to server
    again and adjust the control's size in serverside code. This'll need an
    additional roundtrip to clientside.

    Here is a web link which provide the clientscripts on how to get the screen
    size at clientside;

    #Screen Size
    http://www.javascripter.net/faq/screensi.htm

    Hope helps. Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Apr 27, 2005
    #2
    1. Advertising

  3. Great stuff, you are always a great source of info. To go along with this
    then is there a easy way to take these values from the Javascript and add
    them to my session variables? I will pass them from page to page to scale the
    individual controls appropriatley.

    Thanks Steven!

    "Steven Cheng[MSFT]" wrote:

    > Hi Dewright,
    >
    > Welcome to ASP.NET newsgroup.
    > As for the grabing the screen size of clientside in asp.net page, here are
    > some of my suggestions:
    >
    > Since the screen size is the clientside information, currently we could
    > only retrieve it through clientside scripts. The problem is that clientside
    > scripts need to be executed at clientside (browser context), so we need to
    > at least let our page be render to client once to get those info. Since
    > you need to get the screen size so as to coordinate your serverside
    > control's size, I think we have the following means:
    >
    > 1. We retreive the clientside screen size in client script and also use
    > client script to modify our server control's size( through the attributes
    > of the controls' rendered html elements at client)
    >
    > 2. We use client script to get the screen size and post back to server
    > again and adjust the control's size in serverside code. This'll need an
    > additional roundtrip to clientside.
    >
    > Here is a web link which provide the clientscripts on how to get the screen
    > size at clientside;
    >
    > #Screen Size
    > http://www.javascripter.net/faq/screensi.htm
    >
    > Hope helps. Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    >
    >
    >
    >
    >
    >
    >
     
    =?Utf-8?B?REVXcmlnaHRfQ0E=?=, Apr 27, 2005
    #3
  4. Thanks for your sincere reply,

    I'm very glad that my suggestion was of assistance. As for the further
    question you mentioned, I think we can consider the following approach:

    Since you said that you'll retrieve this information just at the first time
    the user visited the application and then cache them in Session, I think we
    can makeing a particular page which is used to collect such clientside
    information. So when the user visit our web application, we can check the
    session state( or maybe a flag in cookie) which indicate whether we've
    cached the user's clientside info or not. If not, we store the current
    requested page's address and then redirect to the particular page the
    particular page collect the information through those client scripts
    mentioned in former message and postback to store the collected info into
    session. After that , the user is redirected to the originally requesting
    page.

    How do you think of this? Please feel free to let me know if you have any
    other questions or ideas.

    Thanks & Regards,

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Apr 28, 2005
    #4
    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. =?Utf-8?B?REVXcmlnaHRfQ0E=?=

    Control Scaling???

    =?Utf-8?B?REVXcmlnaHRfQ0E=?=, Apr 26, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    339
    Steven Cheng[MSFT]
    Apr 27, 2005
  2. =?Utf-8?B?REVXcmlnaHRfQ0E=?=

    Page & Control Scaling?

    =?Utf-8?B?REVXcmlnaHRfQ0E=?=, May 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    373
    Steven Cheng[MSFT]
    May 26, 2005
  3. AndrewF
    Replies:
    1
    Views:
    811
    Bruce Barker
    Oct 10, 2005
  4. Scaling PNG image

    , Apr 29, 2004, in forum: Java
    Replies:
    3
    Views:
    714
    Thomas Weidenfeller
    Apr 30, 2004
  5. Replies:
    6
    Views:
    465
Loading...

Share This Page