Font size changing while loading alert window through Javascript in response.write()


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: Font size changing while loading alert window through Javascript in response.write()

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Posts
    7

    Font size changing while loading alert window through Javascript in response.write()

    I am using javscript to open a alert window when a button is clicked.

    Here is the code in cs file :
    Response.Write("<script>alert('hai')</script>");

    Interesting thing is with the click of button, the font size changed (increased) in the original asp.net page; refreshing the screen brings back the original font size.

    The problem seems to point to the javascript I used; thank you in advance for your help.

  2. #2
    Join Date
    Dec 2008
    Posts
    7
    this forum is not usefull any more...............

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Not many people were around over Christmas.

    What is the javascript you are using that you believe is causing the problem?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  4. #4
    Join Date
    Dec 2008
    Posts
    7
    Not many people were around over Christmas.

    What is the javascript you are using that you believe is causing the problem?


    Response.Write("<script>alert('hai')</script>");

    after clicking ok button in the alert the font size of labels are increasing

  5. #5
    Join Date
    Dec 2008
    Posts
    7
    i saw one thread similar to this in this forum only.But he didnot mention the solution for that.details of that thread ...........
    ----------------------------------------------------------

    dootam
    Registered User
    ----------------------------------------------------------------------
    font size changed on asp.net page

    -------------------------------------------------------------------------

    I am using javscript to open a new browser window when a button is clicked.

    Here is the script:
    Response.Write("<script>window.open('newpage.aspx','_blank','scrollbars=1, resizable=1');</script>");

    Interesting thing is with the click of button, the font size changed (increased) in the original asp.net page; refreshing the screen brings back the original font size.
    I have a gridview on a different page with a selectable row. When a row is selected, I used javasript to open a new browser window and display selected data details; it has the similar effect of increased font size and upon refreshing screen, I got the original font size.

    On the pages, I have font-family:Arial and font-size:10pt

    The problem seems to point to the javascript I used; thank you in advance for your help.
    -----------------------------------------------------------------------
    His solution

    I would like to retract the above. Found the problem; has nothing to do with javascript at all.
    -----------------------------------------------------------------

  6. #6
    Join Date
    Dec 2008
    Posts
    7
    the above problem is caused because the script is coming outside the html in the rendered html page

    .Net Frame work has provide a class to manage client side scripts

    Try like this.

    // Define the name and type of the client scripts on the page.
    Type cstype = this.GetType();
    // Get a ClientScriptManager reference from the Page class.
    ClientScriptManager cs = Page.ClientScript;

    cs.RegisterStartupScript(cstype, "dateSrpt", "<script>alert('Select Date')</script>");


    This forum is not at all use full..........

  7. #7
    Join Date
    Jul 2011
    Posts
    1

    Smile Thank you!!

    Been working on this very issue for over a week and never thought about how the html was being rendered. thank you for the great insight and thank the .NET framework for having an API to handle this!

    -Paul Smietan

Similar Threads

  1. Replies: 2
    Last Post: 01-20-2003, 09:30 AM
  2. get window size, pls help
    By Zerg in forum Web
    Replies: 0
    Last Post: 09-05-2001, 06:24 AM
  3. javascript window problem
    By john in forum Web
    Replies: 4
    Last Post: 08-22-2001, 07:58 AM
  4. Changing IE text size with JavaScript
    By mad fiddler in forum Web
    Replies: 1
    Last Post: 11-22-2000, 06:33 AM
  5. Sample Sites.
    By Murray Foxcroft in forum Web
    Replies: 5
    Last Post: 11-02-2000, 02:42 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center