No worries Hermit!
I have made alot of posts but no one can seem to show me the write code to
achieve what I am looking for.
basically I have a user control. I use properties in that control. But I
cannot access the properties through my code.
Maybe if I showed you the complete code you could see what I mean...
This is the user control I made:
<%@ Control Language="VB" %>
<script runat="server">
Public Property strHomeURL As String
Get
Return strHomeURL
End Get
Set
ibtnHome.ImageURL = Value
End Set
End Property
</script>
<table cellspacing="0" cellpadding="0" width="800" border="0">
<tbody>
<tr>
<td>
<img height="45" src="images/top_logo.gif" width="421"
/></td>
</tr>
<tr>
<td>
<table cellspacing="0" cellpadding="0" width="800"
border="0">
<tbody>
<tr>
<td width="200" bgcolor="#fda146">
</td>
<td width="22">
<img height="23"
src="images/color_tranz.gif" width="22" /></td>
<td width="578"
background="images/gradient.gif"><div align="right" class="date"><%=
Now.ToString( "D" )%></div></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td bgcolor="#fda146" height="17">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td><asp:ImageButton id="ibtnHome"
runat="server" ImageURL="images/home_on.gif" height="17" width="53"
onmouseout="this.src='images/home.gif'"
onmouseover="this.src='images/home_on.gif'" OnClick="ImageButton_Click"
/></td>
<td><asp:ImageButton id="ibtnWho" runat="server"
ImageURL="images/who.gif" height="17" width="109"
onmouseout="this.src='images/who.gif'"
onmouseover="this.src='images/who_on.gif'" OnClick="ImageButton_Click"
/></td>
<td><asp:ImageButton id="ibtnIdea"
runat="server" ImageURL="images/idea.gif" height="17" width="83"
onmouseout="this.src='images/idea.gif'"
onmouseover="this.src='images/idea_on.gif'" OnClick="ImageButton_Click"
/></td>
<td><asp:ImageButton id="ibtnWhat"
runat="server" ImageURL="images/what.gif" height="17" width="117"
onmouseout="this.src='images/what.gif'"
onmouseover="this.src='images/what_on.gif'" OnClick="ImageButton_Click"
/></td>
<td><asp:ImageButton id="ibtnBenefits"
runat="server" ImageURL="images/benefits.gif" height="17" width="63"
onmouseout="this.src='images/benefits.gif'"
onmouseover="this.src='images/benefits_on.gif'" OnClick="ImageButton_Click"
/></td>
<td><asp:ImageButton id="ibtnJobs"
runat="server" ImageURL="images/jobs.gif" height="17" width="87"
onmouseout="this.src='images/jobs.gif'"
onmouseover="this.src='images/jobs_on.gif'" OnClick="ImageButton_Click"
/></td>
<td><asp:ImageButton id="ibtnApply"
runat="server" ImageURL="images/apply.gif" height="17" width="80"
onmouseout="this.src='images/apply.gif'"
onmouseover="this.src='images/apply_on.gif'" OnClick="ImageButton_Click"
/></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td height="5">
<img height="5" src="images/line_dot.gif" width="800"
border="0" /></td>
</tr>
</tbody>
</table>
Now here is the aspx page that calls the user control:
<%@ Page Language="VB" Debug="True" %>
<%@ Register TagPrefix="Sunterra" TagName="HR_Header" Src="TestHeader.ascx"
%>
<%@ Register TagPrefix="Sunterra" TagName="HR_Footer" Src="Footer.ascx" %>
<script runat="server" >
Sub Page_Load
Protected myHeader As HR_Header
myHeader.strHomeURL = "image/who.gif"
End Sub
</script>
<html>
<head>
<Title>Sunterra Human Resources</Title>
<LINK REL=StyleSheet HREF="HR_Style.css" TYPE="text/css">
</head>
<body>
<form runat="server">
<Sunterra:HR_Header id="ctlHeader" runat="server"
HomeURL="images/who.gif" />
Middle of the page
<Sunterra:HR_Footer id="ctlFooter" runat="server" />
</form>
</body>
</html>
I cannot get the ImageURL to change. Do you know a solution?
Thanks!
"Hermit Dave" <> wrote in message
news:...
> John,
>
> Sorry if i sound a bit rude. Please check your posts. You have made 3 / 4
> odd different posts on the same subject.
>
> --
>
> Regards,
>
> Hermit Dave
> (http://hdave.blogspot.com)
> "John Espinosa" <> wrote in message
> news:YgU9d.3584$kz3.3261@fed1read02...
>> The name should be the same...
>>
>> Sub Page_Load
>>
>> UC1.strHomeURL = "image/home.gif"
>> End Sub
>>
>> This still does not work!!!
>
>