asp.net C#
根据RadioButton的选择情况,改变同一网站下的另一网页的背景图片。代码该怎么写啊?菜鸟求助!!!我只知道改变本页面的,假如本页面body 的id为MyBody,则MyBody.Style["background-image"] = "url(image/road.jpg)";
根据RadioButton的选择情况,改变同一网站下的另一网页的背景图片。代码该怎么写啊?菜鸟求助!!!我只知道改变本页面的,假如本页面body 的id为MyBody,则MyBody.Style["background-image"] = "url(image/road.jpg)";
public static string strurl;RadioButtonprivate void radioButton_CheckedChanged(object sender, EventArgs e)
{
RadioButton radio = (RadioButton)sender;
if (radio.Checked)
{
strurl=.....路径.
} }
public static string strurl;RadioButtonprivate void radioButton_CheckedChanged(object sender, EventArgs e)
{
RadioButton radio = (RadioButton)sender;
if (radio.Checked)
{
strurl=.....路径.
} }
二楼的大哥很好很好,代码都给出来了,我能看懂,但就是不知道该把public static string strurl放在本页面还是另一个页面,总是提示出错说上下文不存在strurl。最后,我把本页面做成一个面板放在那个要改背景的页面里了,汗……
因为两个页面要公用一个strul!