Click here to Skip to main content
15,914,013 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Redirect to Word document??? Pin
JimFeng28-Apr-06 8:48
JimFeng28-Apr-06 8:48 
GeneralRe: Redirect to Word document??? Pin
gyokusei28-Apr-06 16:19
gyokusei28-Apr-06 16:19 
QuestionExecuting an .exe within ASP.NET Pin
Are Jay28-Apr-06 3:53
Are Jay28-Apr-06 3:53 
AnswerRe: Executing an .exe within ASP.NET Pin
minhpc_bk30-Apr-06 0:44
minhpc_bk30-Apr-06 0:44 
QuestionBest data type for currency - asp.net & sql? Pin
FionaDM28-Apr-06 3:40
FionaDM28-Apr-06 3:40 
AnswerRe: Best data type for currency - asp.net & sql? Pin
Paddy Boyd28-Apr-06 3:49
Paddy Boyd28-Apr-06 3:49 
QuestionImage Button Pin
kuwl_mark28-Apr-06 1:59
kuwl_mark28-Apr-06 1:59 
AnswerRe: Image Button Pin
Mike Ellison28-Apr-06 3:15
Mike Ellison28-Apr-06 3:15 
The Height and Width properties here are Unit types, for which the addition operator is invalid... but I'm not sure that's the way you would want to set them anyway.

I wrote some code to try this and I think Height and Width are being ignored in this context. The following did work (but I have to wonder if there is a better way). It's in C#, but you should be able to follow what's going on. It uses a Session variable to track the current size and increases it on a click of the image. The size is then assigned directly to "height" and "width" attributes (rather than relying on Height and Width properties of the ImageButton).
<% @Page Language="C#" %>

<script runat="server">

  const int kDefaultSize = 32;

  int GetImageSize()
  {
    // retrieve the size in a session variable
    if (Session["imagesize"] == null)
      SetImageSize(kDefaultSize);
      
    return Convert.ToInt32(Session["imagesize"]);
  }
    
  void SetImageSize(int amount)
  {
    // store the image size in a session variable
    Session["imagesize"] = amount;
  }


  void Page_Load()
  {
    if (!IsPostBack)
    {
      // Default size
      SetImageSize(kDefaultSize);
      
      ImageButton1.Attributes["height"] = kDefaultSize.ToString();
      ImageButton1.Attributes["width"] = kDefaultSize.ToString();
    }
  }


  void BtnClick(object o, ImageClickEventArgs e)
  {
    // increase the image size
    int i = GetImageSize();
    i = i + kDefaultSize;
    SetImageSize(i);

    ImageButton1.Attributes["height"] = i.ToString();
    ImageButton1.Attributes["width"] = i.ToString();
  }

  
</script>

<html>
  <head>
    <title>Growing Image</title>
  </head>
  
  <body>    
    <form runat="server">
        <p>Click the image to see it grow</p>
        <asp:ImageButton id="ImageButton1" runat="server" OnClick="BtnClick"
                         Src="/help.gif"
                         />
                         
    
    </form>    
  </body>
  
</html>
See if this helps give you some ideas.
GeneralRe: Image Button Pin
kuwl_mark28-Apr-06 18:40
kuwl_mark28-Apr-06 18:40 
QuestionHTML to image Pin
hartzer28-Apr-06 1:53
hartzer28-Apr-06 1:53 
AnswerRe: HTML to image Pin
Mike Ellison28-Apr-06 2:49
Mike Ellison28-Apr-06 2:49 
GeneralRe: HTML to image Pin
hartzer28-Apr-06 11:57
hartzer28-Apr-06 11:57 
GeneralRe: HTML to image Pin
Mike Ellison29-Apr-06 3:32
Mike Ellison29-Apr-06 3:32 
GeneralRe: HTML to image Pin
hartzer30-Apr-06 6:40
hartzer30-Apr-06 6:40 
GeneralRe: HTML to image Pin
Mike Ellison1-May-06 2:56
Mike Ellison1-May-06 2:56 
QuestionMobile Device ASP Pin
Ohmos28-Apr-06 1:20
Ohmos28-Apr-06 1:20 
AnswerRe: Mobile Device ASP Pin
Paddy Boyd28-Apr-06 4:11
Paddy Boyd28-Apr-06 4:11 
QuestionCan we bring third part tool in the browser Pin
jith - iii28-Apr-06 0:44
jith - iii28-Apr-06 0:44 
AnswerRe: Can we bring third part tool in the browser Pin
Mike Ellison28-Apr-06 2:53
Mike Ellison28-Apr-06 2:53 
AnswerRe: Can we bring third part tool in the browser Pin
Paddy Boyd28-Apr-06 2:54
Paddy Boyd28-Apr-06 2:54 
GeneralRe: Can we bring third part tool in the browser Pin
jith - iii28-Apr-06 6:11
jith - iii28-Apr-06 6:11 
QuestionLogon failed while using crystal report Pin
sumathi_k28-Apr-06 0:20
sumathi_k28-Apr-06 0:20 
AnswerRe: Logon failed while using crystal report Pin
Mike Ellison28-Apr-06 2:55
Mike Ellison28-Apr-06 2:55 
AnswerRe: Logon failed while using crystal report Pin
Ista28-Apr-06 5:28
Ista28-Apr-06 5:28 
AnswerRe: Logon failed while using crystal report Pin
jith - iii28-Apr-06 6:22
jith - iii28-Apr-06 6:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.