Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. after postback font-sizes go crazy!!

after postback font-sizes go crazy!!

Scheduled Pinned Locked Moved ASP.NET
helpquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Seishin
    wrote on last edited by
    #1

    Hi! on a site I'm writing i use a TextBox and a Button for some search functionality..in the Button's onClick event i assigned a method : public void Search(object sender, EventArgs e) { Response.Write(string.Concat("window.open(\"SearchResluts.aspx?KeyWord=", tbSearch.Text, "\",\"iContent\");")); } all it does is open SearchResluts page in iContent iframe.. above the button and textbox there is a treeview and when i click the button it does what it should and changes font-size in the treeview.. i saw it somewhere before that after postback some control's font-size is changed (for larger one).. does anyone have any idea why this happens and maybe knows a workaround? thanks for any help..

    life is study!!!

    I T A 3 Replies Last reply
    0
    • S Seishin

      Hi! on a site I'm writing i use a TextBox and a Button for some search functionality..in the Button's onClick event i assigned a method : public void Search(object sender, EventArgs e) { Response.Write(string.Concat("window.open(\"SearchResluts.aspx?KeyWord=", tbSearch.Text, "\",\"iContent\");")); } all it does is open SearchResluts page in iContent iframe.. above the button and textbox there is a treeview and when i click the button it does what it should and changes font-size in the treeview.. i saw it somewhere before that after postback some control's font-size is changed (for larger one).. does anyone have any idea why this happens and maybe knows a workaround? thanks for any help..

      life is study!!!

      I Offline
      I Offline
      Imran Khan Pathan
      wrote on last edited by
      #2

      Instead Of Response.Write , try this Page.RegisterStartupScript("p", string.Concat("window.open(\"SearchResluts.aspx?KeyWord=", tbSearch.Text, "\",\"iContent\");")); " If u got solution plz vote here " Best Regard Pathan

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

      1 Reply Last reply
      0
      • S Seishin

        Hi! on a site I'm writing i use a TextBox and a Button for some search functionality..in the Button's onClick event i assigned a method : public void Search(object sender, EventArgs e) { Response.Write(string.Concat("window.open(\"SearchResluts.aspx?KeyWord=", tbSearch.Text, "\",\"iContent\");")); } all it does is open SearchResluts page in iContent iframe.. above the button and textbox there is a treeview and when i click the button it does what it should and changes font-size in the treeview.. i saw it somewhere before that after postback some control's font-size is changed (for larger one).. does anyone have any idea why this happens and maybe knows a workaround? thanks for any help..

        life is study!!!

        T Offline
        T Offline
        Tarakeshwar Reddy
        wrote on last edited by
        #3

        You should use RegisterClientScriptBlock instead. When you do a Response.Write the code gets written on top of the page and that affects the font sizes. When you use RegisterClientScriptBlock, the code goes into the HTML tag. This code is for Asp.Net 2.0, if your using Asp.Net 1.1 then you will have to use Page.RegisterClientScriptBlock

        StringBuilder strScript = new StringBuilder();
        strScript.Append("<script language="javascript">window.open('FileToOpen.aspx');</script>");
        ClientScript.RegisterClientScriptBlock(Page.GetType(), "subscribescript", strScript.ToString());


        Tarakeshwar Reddy MCP, CCIE Q(R&S) There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi

        1 Reply Last reply
        0
        • S Seishin

          Hi! on a site I'm writing i use a TextBox and a Button for some search functionality..in the Button's onClick event i assigned a method : public void Search(object sender, EventArgs e) { Response.Write(string.Concat("window.open(\"SearchResluts.aspx?KeyWord=", tbSearch.Text, "\",\"iContent\");")); } all it does is open SearchResluts page in iContent iframe.. above the button and textbox there is a treeview and when i click the button it does what it should and changes font-size in the treeview.. i saw it somewhere before that after postback some control's font-size is changed (for larger one).. does anyone have any idea why this happens and maybe knows a workaround? thanks for any help..

          life is study!!!

          A Offline
          A Offline
          Ankur m
          wrote on last edited by
          #4

          When you use javascript using response.write, the javascript is written before tag That makes the browser ignore the doctype, and the page is displayed in quirks mode. The solution suggested above is the best way to do it. There is also a workaround: write response.write() code before response.write tag. don't know how good this solution is, but it works perfectly well.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups