RadioButton rb; ラベルlb;私は他のページに// Labe2のテキストを送信する必要がbecuseプログラムで作成したラベルのテキストをhtml本文の他のラベルにどのように割り当てることができますか?
while (reader.Read())
{
rb = new RadioButton(); **//radio buttuns created**
lb = new Label(); **// labels created**
lb.Text = reader[0].ToString(); *// each label's text assigned*
rb.Attributes.Add("OnClick", "getSelectedAuthor('"+lb.Text.ToString()+"')");
PlaceHolder1.Controls.Add(rb); *//when the radio clicked,function called*
PlaceHolder1.Controls.Add(lb); *// to set use the text of label*
PlaceHolder1.Controls.Add(new LiteralControl("<br />"));
}
conAuthorTbl.Close();
// innerthtmlは私がのResponse.Redirect(..)を使用する場合、//があります//、//、目的のために動作しません。 Label2をから//
<script language="javascript" type="text/javascript">
function getSelectedAuthor(text) {
document.getElementById("Label2").innerText = text;
}
</script>
//来て何の文字列私は
<div>
<asp:Label ID="Label2" runat="server" Text="" ></asp:Label>
</div>
あなたの質問は、Aの葉想像力にロット。 Response.Redirectを使用している場合は、リダイレクトされたページで使用するQueryStringにRadioButtonの値を追加できます。 – aaroncatlin
クライアント側ではなくサーバー側からLabel Textプロパティを設定する必要があります。 – arunes
Response.Redirect( "Default4.aspx" + "?variable =" + ")のように記述すると、Response.Reditectを正しく使用しましたが、動作しません。問題はLabel2 – user1214973