I am trying to update the imageurl that the Image2 control looks at. I keep getting inner html problems...meaning I didn't write the dynamic page that keeps popping up. Please help.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/.../xhtml1-transitional.dtd">
<script runat="server">
[System.Web.Services.WebMethod()]
[System.Web.Script.Services.ScriptMethod()]
public static string GetDynamicContent(string contextKey)
{
System.Threading.Thread.Sleep(500);
string img_hdr = "ImageUrl = ";
string img_lctn = "";
string final = "";
if (contextKey == "y")
{
img_lctn = "~/Indicator Light/yellow.bmp";
}
else if (contextKey=="g")
{
img_lctn = "~/Indicator Light/green.bmp";
}
else if (contextKey == "b")
{
img_lctn = "~/Indicator Light/blue.bmp";
}
else
{
img_lctn = "~/Indicator Light/red.bmp";
}
final = img_hdr + img_lctn;
return final;
}
protected void cmdHome_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 0;
}
protected void cmdEval_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 1;
}
protected void cmdPyramids_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 2;
}
</script>
<html xmlns="www.w3.org/.../xhtml">
<head runat="server">
<title></title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<asp:scriptmanager ID="Scriptmanager1" runat="server" />
<script type="text/javascript">
function updateDateKey(value) {
var behavior = $find('Image2_DynamicPopulateExtender');
if (behavior) {
behavior.populate(value);
}
}
Sys.Application.add_load(function(){updateDateKey('r');});
</script>
style="z-index: 1; left: 700px; top: 124px; position: absolute; height: 378px; width: 405px">
<asp:Panel ID="Panel10" runat="server" style="position: relative; top: 55px; left: 8px; height: 313px; width: 344px">
<asp:Image ID="Image2" runat="server" Height="46px" Width="49px" CssClass="dynamicPopulate_Normal"
ImageUrl="~/Indicator Light/red.bmp" />
<cc1:DynamicPopulateExtender ID="Image2_DynamicPopulateExtender" runat="server"
Enabled="True" PopulateTriggerControlID="" ServiceMethod="GetDynamicContent"
TargetControlID="Image2" UpdatingCssClass="dynamicPopulate_Updating">
</cc1:DynamicPopulateExtender>
<%-- <asp:RadioButtonList ID="RadioButtonList1" runat="server"
style="position: absolute; top: 7px; left: 124px; height: 82px; width: 214px"
onselectedindexchanged="RadioButtonList1_SelectedIndexChang ed"
AutoPostBack="True">
<asp:ListItem>Not meeting current obligations</asp:ListItem>
<asp:ListItem>Turning away new work</asp:ListItem>
<asp:ListItem>Able to accept new work</asp:ListItem>
<asp:ListItem>Excess capacity</asp:ListItem>
</asp:RadioButtonList>--%>
<asp:Label ID="Label13" runat="server" Text=""></asp:Label>
<div>
<label for="r0">
<input id="r0" checked="checked" name="rbFormat" onclick="updateDateKey(this.value);"
type="radio" value='r' />R)Not meeting current obligations</label><br />
<label for="r1">
<input id="r1" name="rbFormat" onclick="updateDateKey(this.value);" type="radio"
value='y' />Y)Turning away new work</label><br />
<label for="r2">
<input id="r2" name="rbFormat" onclick="updateDateKey(this.value);" type="radio"
value='g' />G)Ready to accept future work</label><br />
<label for="r3">
<input id="r3" name="rbFormat" onclick="updateDateKey(this.value);" type="radio"
value='b' />B)Excess acity</label><br />
</div>
</asp:Panel>
Sorry about the poor indenting'I have been playing with the functionality and not the appearance.