Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i call the variable out of the function

Status
Not open for further replies.

hlybbi

Programmer
Mar 19, 2003
91
IS
How can i call the variable picSize_witdh


<script language=&quot;C#&quot; runat=&quot;Server&quot;>

void Page_Load
(object sender, System.EventArgs e)
{
int picSize_width = 320;
int picSize_Height = 215;

string Location,ImageName;

Location = Request.QueryString[&quot;Location&quot;];
ImageName = Request.QueryString[&quot;Pic&quot;];
}


</script>

<html>
<img border=&quot;1&quot; height=&quot;<%=picSize_Height%>&quot; src=&quot;../images/Image_manager.gif&quot;>
</html>


Best regards Hlynur
 
Hlynur,
Why not use the asp:image tag instead of the img tag. Your code would then look something like this:

<script language=&quot;C#&quot; runat=&quot;Server&quot;>
void Page_Load
(object sender, System.EventArgs e)
{
    int
picSize_width = 320;
int picSize_Height = 215;
string Location,ImageName;
Location = Request.QueryString[&quot;Location&quot;];
ImageName = Request.QueryString[&quot;Pic&quot;];
Image1.Width = picSize_width;
    }
</script>


<asp:Image id=&quot;Image1&quot; runat=&quot;server&quot;></asp:Image>

Try this and see if it works.

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top